-
-
Notifications
You must be signed in to change notification settings - Fork 720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enphase: energy and power empty #17817
Comments
/cc @premultiply @ivoks |
I see. Assumption was that the key are universal, but it seems that they are not. We need to check if they exist before we use them. I'll try to work on this today. @othi does production.json?details=1 return different set of keys? I see you are using http, and not https, so you have an older firmware too (not using tokens for auth)? |
The
but it returns a 301 to the https URL anyway. My gateway is on firmware 8.2.4264, which seems to be fairly recent (november 2024), and I do use a token. As for the output of
|
Hey there I believe I have an answer for this. I've tested with your production.json as well as mine and from few other folks and it gives the right answer: jq 'if (.production | length) > 1 and (.production[] | select(.measurementType == "production").activeCount >= 1) then .production[] | select(.measurementType == "production").wNow else .production[] | select(.type == "inverters").wNow end' jq 'if (.production | length) > 1 and (.production[] | select(.measurementType == "production").activeCount >= 1) then .production[] | select(.measurementType == "production").whLifetime else .production[] | select(.type == "inverters").whLifetime end' If there are more than 1 member of production array, it checks if production's activeCount is, basically, not null (which means it's enabled). If all that is true, it returns the value from CT's wNow reading. If any other case it just returns inverter's wNow. I'll prepare a patch for this... |
Describe the bug
My Enphase Envoy API returns the following at the URL
http://{{ .host }}/production.json
:{"production":[{"type":"inverters","activeCount":22,"readingTime":1734616504,"wNow":207,"whLifetime":6787031}],"storage":[{"type":"acb","activeCount":0,"readingTime":0,"wNow":0,"whNow":0,"state":"idle"}]}
The jq query as defined here
evcc/templates/definition/meter/enphase.yaml
Line 44 in e33a682
(.production[] | select(.measurementType == "production").wNow) // (.production[] | select(.type == "inverters").wNow)
does work for me but I don't have an instance that returnsmeasurementType
so I can't be sure if the jq is correct. It's probably missing theactiveCount
check.The same is true for
evcc/templates/definition/meter/enphase.yaml
Line 54 in e33a682
wNow
withwhLifetime
Steps to reproduce
Configuration details
Log details
What type of operating system are you running?
HomeAssistant Add-on
Nightly build
Version
0.131.12
The text was updated successfully, but these errors were encountered: