fsaris / home-assistant-zonneplan-one

Unofficial Zonneplan integration for Home Assistant
https://github.com/fsaris/home-assistant-zonneplan-one
MIT License
104 stars 17 forks source link

Thuisbatteriij sensors stopped updating #107

Closed mvdzwaan closed 4 months ago

mvdzwaan commented 4 months ago

All thuisbatterij sensors stopped updating at around 17:00 local time on apr 11th.

If I enable debug logging I get the following in the logs, which does still provide the data :

"data":{ "contracts":[ { "uuid":"xxxxxxxxxxx", "label":"Thuisbatterij", "type":"home_battery_installation", "start_date":"2024-03-13T23:00:00.000000Z", "end_date":"None", "meta":{ "identifier":"xxxxxxxxx", "first_measured_at":"2024-03-14T12:02:37.000000Z", "last_measured_at":"2024-04-12T09:49:39.000000Z", "state_of_charge":410, "power_ac":10100, "inverter_state":"Operative", "battery_state":"Charging", "dynamic_charging_enabled":true, "dynamic_load_balancing_enabled":true, "dynamic_load_balancing_overload_active":false, "manual_control_enabled":false, "manual_control_state":"None", "show_in_contract_screen":true, "total_earned":2830856535, "total_day":20120402, "delivery_day":26630, "production_day":28360 } } ],

mvdzwaan commented 4 months ago

I tried removing the integration and the hacs install. Then redownloaded latest version, restarted HA, and added the integration.

I now get only 2 devices, laadpaal/batterij, with limited sensors on them

Thuisbatterij Sensors Dynamic charging enabled On Dynamic load balancing overload active Off Dynamic load balancing overload enabled On Manual control enabled Off

Charge point Controls Start charge Stop charge Sensors Charge point can charge On Charge point can schedule On Charge point charging automatically Off Charge point charging manually Off Charge point connectivity state On Charge point plug and charge Off

fsaris commented 4 months ago

@mvdzwaan o lot of sensors are disabled by default. So if you removed the integration you probably need to enable the sensors again.

Are you using latest stable release or the beta?

Your log states "last_measured_at":"2024-04-12T09:49:39.000000Z" so you are still receiving up-to-date info for the Zonneplan api.

Are you sure non of the sensors updated? No other messages in the logs?

mvdzwaan commented 4 months ago

I am using latest stable, and have also tried latest beta.

I did a HA restore now from 5 days ago, but now even more sensors are not working anymore.

Now showing mostly : 'Deze entiteit is niet meer beschikbaar vanuit de zonneplan_one integratie. Wanneer de entiteit niet meer in gebruik is, kan deze vanuit de instellingen verwijderd worden.'

even sensor.zonneplan_current_electricity_tariff is showing that

Sensoren Battery state Niet beschikbaar Last measured Niet beschikbaar Percentage Niet beschikbaar Dynamic charging enabled Aan Dynamic load balancing overload active Uit Dynamic load balancing overload enabled Aan Manual control enabled Uit Ontladen Niet beschikbaar Opgeladen Niet beschikbaar Totaal Niet beschikbaar Vandaag Niet beschikbaar Vermogen Niet beschikbaar

fsaris commented 4 months ago

Can you provide some logs?

You can send it to me for example using direct message on the forum https://community.home-assistant.io/u/minifranske/

mvdzwaan commented 4 months ago

Some of the return values of type timestamp are now numeric epoch values. If I add a cast to str() in sensor.py I start getting all sensors again. Line 285

value = dt_util.parse_datetime(str(value))

This fixed my issues

bobbomoon commented 4 months ago

This ajustment also worked for me!! Thanks!! @mvdzwaan