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

4G status batterij #132

Open Dominic-070 opened 1 month ago

Dominic-070 commented 1 month ago

Hi Nice work with this integration.

Is it possible to implement 4G status sensor.

When 4G is offline, the battery and inverter status continue to indicate operational. therefore I would like to monitor the 4G connection. I also noticed that the kWh values are always a few minutes (5-10) behind compared to the app. As a result, the energy dashboard provides an incorrect overview because measurements are taken at the wrong hour. Perhaps it is an idea to optional retrieve local information from the battery. based on the Solarman wifi logger. You can interface with the battery's LAN / WiFi, port 8899

Screenshot_20240723_215902_Zonneplan

fsaris commented 1 month ago

Will check if we can expose the 4G status

I also noticed that the kWh values are always a few minutes (5-10) behind compared to the app

Can you share some screenshots of the graph from the app and from HA? Some differences could be there as we only get every 5min an update. But that is similar to the interval the app gets new data.

Perhaps it is an idea to optional retrieve local information from the battery. based on the Solarman wifi logger. You can interface with the battery's LAN / WiFi, port 8899

This is out of scope for this integration. This integration uses the zonneplan api.

Dominic-070 commented 1 month ago

Here is a series of screenshots where I compare the Zonneplan app with home assistant at the same time. Also pay special attention to the last update transition from 23:59 to 0:00 Zonneplan integratie

fsaris commented 1 month ago

@Dominic-070 from the test examples I have I'm not able to find the 4G status. I have only network data for the P1 reader. Can you check your logs to check if you can find some values that represent the 4G status?

Dominic-070 commented 1 month ago

mayby this:

'custom_attributes': {'source': 'app'}}, 'notification_setting_groups': [{'slug': 'general', 'name': 'Algemeen', 'description': 'Algemene notificaties over Zonneplan van onderwerpen die relevant zijn voor jou', 'settings': [{'slug': 'new-updates', 'name': 'Algemeen', 'description': 'Ontvang als eerste updates over de laatste ontwikkelingen aan de Zonneplan App', 'push_enabled': True}, {'slug': 'conversation-updates', 'name': 'Nieuwe berichten', 'description': 'Gemiste berichten in chat gesprekken met een medewerker', 'push_enabled': True}]}, {'slug': 'prices', 'name': 'Prijsupdates', 'description': 'Notificaties bij belangrijke prijsupdates wanneer je klant bent bij Zonneplan Energie', 'settings': [{'slug': 'high-energy-price', 'name': 'Hoge energieprijzen', 'description': 'Hoge energieprijzen', 'push_enabled': True}, {'slug': 'low-energy-price', 'name': 'Lage energieprijzen', 'description': 'Lage energieprijzen', 'push_enabled': True}]}, {'slug': 'malfunctions', 'name': 'Proactieve monitoring', 'description': 'Notificaties bij storingen', 'settings': [{'slug': 'battery-malfunction', 'name': 'Batterijstoring', 'description': 'Storingen omtrent je thuisbatterij', 'push_enabled': True}, {'slug': 'chargepoint-malfunction', 'name': 'Laadpuntstoring', 'description': 'Storingen omtrent je laadpunt', 'push_enabled': True}, {'slug': 'solar-malfunction', 'name': 'Zonnepanelen storing', 'description': 'Storingen omtrent je zonnepanelen & omvormer', 'push_enabled': True}, {'slug': 'no-sgn-connection', 'name': 'Geen verbinding', 'description': 'Verbindingstoringen', 'push_enabled': True}]}]}}
2024-08-06 09:23:22.089 INFO (MainThread) [custom_components.zonneplan_one.coordinator] _async_update_data: parse addresses
2024-08-06 09:23:22.090 INFO (MainThread) [custom_components.zonneplan_one.coordinator] _async_update_data: fetch live data
fsaris commented 6 days ago

@Dominic-070 this only look like some labels.

fsaris commented 6 days ago

@Dominic-070 some notes about the difference in values + dates

The sensors in HA will always run a little behind, even if you would get the poll interval to sync with the last update value of Zonneplan. And sadly there is no (easy) way to handle historic data in HA. Even if it are just a few minutes of seconds it's already historic data.

Hope this explanation makes some sense.

Dominic-070 commented 2 days ago
  • "last updated" was updated and not the "last updated" value itself. So there is always a little difference Example:

    • Zonneplan returns a last updated value 12:45
    • HA polls for the data at 12:47
    • The sensor "last updated" gets the value: 12:45 with a last updated value: 12:47

The sensors in HA will always run a little behind, even if you would get the poll interval to sync with the last update value of Zonneplan. And sadly there is no (easy) way to handle historic data in HA. Even if it are just a few minutes of seconds it's already historic data.

Hope this explanation makes some sense.

The battery was offline today. I checked the logs but I can't find anything about the connection. Is there a way to interface with the API, I can simulate the connection status by removing the dongle.