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

Add cycles (batterijcycli) to available sensors after update 2024-07-17 #131

Open TFhdKi95ae8L opened 1 month ago

TFhdKi95ae8L commented 1 month ago

Latest update also provides battery cycle counter. Can you add that to the available sensors as well? In the app it is available under "systeem" Thanks!

fsaris commented 1 month ago

Can you provide some debug logs to provide the correct name for the sensor value

TFhdKi95ae8L commented 1 month ago

I enabled the logger, but nothing to be seen in the logs. I'm on mobile far away from home for the next week and a half, so not really sure if I could see something with a proper look.

TFhdKi95ae8L commented 1 month ago

Comfortably at home again, and cannot find anything in the logs. Can you share a making a debug log for dummies here?

fsaris commented 1 month ago
  1. Goto https://my.home-assistant.io/redirect/integration/?domain=zonneplan_one and enable debug logging
  2. Goto https://my.home-assistant.io/redirect/logs/ scroll down and click "Laad volledige logboeken"

Every 5min it should log the API calls

TFhdKi95ae8L commented 1 month ago
          },
          {
            'uuid': 'xxxx1234567890',
            'label': 'Thuisbatterij',
            'type': 'home_battery_installation',
            'start_date': '2024-05-01T22:00:00.000000Z',
            'end_date': None,
            'meta': {
              'identifier': 'yyyy0987654321',
              'first_measured_at': '2024-01-01T11:11:47.000000Z',
              'last_measured_at': '2024-07-31T07:35:01.000000Z',
              'state_of_charge': 870,
              'power_ac': -10,
              'inverter_state': 'Operative',
              'battery_state': 'Operative',
              'dynamic_charging_enabled': True,
              'dynamic_load_balancing_enabled': True,
              'dynamic_load_balancing_overload_active': False,
              'manual_control_enabled': False,
              'manual_control_state': None,
              'self_consumption_enabled': False,
              'cycle_count': 138,
              'show_in_contract_screen': True

Gotcha. See second to last entry: cycle_count

TFhdKi95ae8L commented 1 month ago

See pull request #134 Note that I am a novice at best, so please triple check my work ;-)

Edit: Tested the code on my system, but could not load any sensors, so I think I messed something up...

fsaris commented 1 month ago

Will give it a look/try in one of the next daya

fsaris commented 1 month ago

@TFhdKi95ae8L this cycle is a number that only increases? As in the total number of (loading) cycles that where performed?

TFhdKi95ae8L commented 1 month ago

Yes, should be increasing only, everytime the battery completes one nominal capacity cycle.

fsaris commented 1 month ago

@TFhdKi95ae8L can you give the main version a try?

TFhdKi95ae8L commented 1 month ago

Works! image

TFhdKi95ae8L commented 1 month ago

I see you also implemented the self consumption as a sensor. Great job!

fsaris commented 3 weeks ago

Will keep the issue open until it's part of an official release/version