weltmeyer / ha_sonnenbatterie

Homeassistant integration to show many stats of Sonnenbatterie
GNU General Public License v3.0
51 stars 24 forks source link

Introduce "debug_mode" and ... #24

Closed RustyDust closed 1 year ago

RustyDust commented 1 year ago
weltmeyer commented 1 year ago

wow! that looks much cleaner.

jepperc commented 1 year ago

@weltmeyer @RustyDust PPV2 and all the new things are not working anymore after this merge :(

RustyDust commented 1 year ago

Can you send a log? Preferably with debug enabled.

RustyDust commented 1 year ago

Reason I ask is: My Sonnebatterie doesn't provide ppv so I can't check. From looking at the code I see no reason why it should have stopped working.

jepperc commented 1 year ago

Regular log:

2023-01-05 19:55:28.586 WARNING (Thread-6 (watcher)) [custom_components.sonnenbatterie] No 'ppv2' in inverter -> sensor disabled 2023-01-05 19:55:28.586 WARNING (Thread-6 (watcher)) [custom_components.sonnenbatterie] No 'ipv' in inverter -> sensor disabled 2023-01-05 19:55:28.586 WARNING (Thread-6 (watcher)) [custom_components.sonnenbatterie] No 'ipv2' in inverter -> sensor disabled 2023-01-05 19:55:28.586 WARNING (Thread-6 (watcher)) [custom_components.sonnenbatterie] No 'upv' in inverter -> sensor disabled 2023-01-05 19:55:28.586 WARNING (Thread-6 (watcher)) [custom_components.sonnenbatterie] No 'upv2' in inverter -> sensor disabled

jepperc commented 1 year ago

Debug log: https://pastebin.com/Afjv4uph

So the values are obviously not where being looked for.. But they were where I got them from in my PR, with values showing up in HA. Something else must have changed?

jepperc commented 1 year ago

I'm thinking line 166 in sensor.py.. the movement of inverter['status']['status']. I can't think of anything else.

jepperc commented 1 year ago

Also getting an error when trying to add this integration to a clean HA now.. Config flow could not be loaded: {"message":"Invalid handler specified"} Something wrong with the new config thing?

RustyDust commented 1 year ago

@jepperc I don't really think that it's a problem with line 166 and even if the config flow doesn't work that shouldn't affect a running version. What I can see on my system is that most of the values that are looked for aren't in inverter. But to make sure it's not a problem with line 166, can you please run this gist: https://gist.github.com/RustyDust/2dfdd9e9d0f3b5476b5e466203123f6f and send the output it generates?

Make sure to edit the USERNAME, PASSWORD and HOSTADDR variables before running. You may also need to install the needed python modules request, hashlib and pprint.

weltmeyer commented 1 year ago

Status always exists in status...

weltmeyer commented 1 year ago
image
weltmeyer commented 1 year ago

fixed in bce3747534d4173bde15a130a632cfad18c2c059

weltmeyer commented 1 year ago

Interesting... i am using /api/inverter without the v1. v1 is giving me a 404