Closed sfjes closed 5 years ago
Just confirming: Works on my machine ;-) An original envoy C with production only.
Rebased this PR on the current master. @jesserizzo any problem with merging it? Without it consumption meter reading is broken on my Envoy-S.
@sfjes Sorry about that, I just never even saw this PR. I'll take a look at it this weekend.
Sorry that took me 6 months. Looks great, thanks. And btw newer Envoys have a third section for storage, that's why it was === 3 originally.
No worries! Thanks for merging it. My Envoy-S is capable of storage support but I'm guessing either it'd get a firmware update or need some flag enabled before it started reporting three sections (as I don't have any storage).
This small tweak fixes the check of the json length , which was causing a false negative on the detection of my Envoy-S with consumption metering. My Envoy-S returns two top sections, one for production and one for consumption.
This manifested as envoy_reader failing to pull my consumption data ("Consumption data not available for your Envoy device.") and was less transparent as it was reported in Home Assistant ("Unable to connect to Envoy. Check that the device is up at 'http://envoy'.").
I left it as a >=2 check since I'm unsure if other Envoy-S hardware revisions have different output. Has someone else confirmed they have a json response with 3 sections?