I trying to get a drive to update the state of charge
ive looked at SolArk/ SunSynk Inverter API Link - #24 by OttoMation
and home assistant GitHub - martinville/solarsynkv3: Integrate your Sunsynk account with Home Assistant for real-time solar energy monitoring. Track power generation, battery storage, and grid usage while enabling smart automations and custom alerts. Optimize energy efficiency, reduce costs, and stay in control with seamless remote access and intuitive dashboards. · GitHub
and used copilot AI but it says
Final diagnosis: why you are still getting 403
Your request is correct — Sunsynk is blocking Hubitat deliberately
You have now passed all common failure points (URL, method, headers, MFA, rate‑limit, credentials).
At this stage, the only remaining cause is:
Sunsynk now enforces Cloudflare bot protection on the OAuth password login, which Hubitat cannot satisfy.
This change has been rolled out gradually since late 2024 / 2025 and affects new and many existing accounts.
is ther anyone smarter who can take a look at the code
def login() {
def params = [
uri: "https://api.sunsynk.net/api/v1/oauth/token",
headers: [
"User-Agent" : "okhttp/4.9.0",
"Accept" : "application/json",
"Content-Type": "application/x-www-form-urlencoded"
],
body: [
username : settings.username.trim(),
password : settings.password.trim(),
grant_type: "password",
client_id : "csp-web"
]
]
try {
httpPost(params) { resp ->
if (resp.status == 200 && resp.data?.access_token) {
state.accessToken = resp.data.access_token
state.refreshToken = resp.data.refresh_token
log.info "Sunsynk login successful"
} else {
log.error "Login failed: ${resp.status}"
}
}
} catch (e) {
log.error "Login exception: ${e.message}"
}
}