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

Powerplay compensation sensor #103

Closed martijnrusschen closed 4 months ago

martijnrusschen commented 5 months ago

Zonneplan has added Powerplay support for their PV panel customers. See https://www.zonneplan.nl/powerplay/zonnepanelen. I'm seeing the first compensation since today, as you can see in the screenshot below:

IMG_2761

I'd love to see if there's a way to add this as a sensor to Home Assistant so i can track the additional income of this feature without having to check their app. Same with the status, it seems they indicate in the app when it was active which I guess could be exposed in their API as well.

TLDR:

I've looked into the logs, but couldn't find any field yet that really does what I'm looking to get here. Perhaps I haven't looked closely enough yet, but curious if these asks are reasonable.

fsaris commented 5 months ago

Sensor for Powerplay compensation

Can you post your logs?

Sensor for PV status (is Powerplay pausing my inverter?)

Need to check though that there was some state value in de api data. But see that's currently not available as a sensor.

fsaris commented 5 months ago

@martijnrusschen can you check your logs for the value powerplay and grid_stabilization_active?

martijnrusschen commented 5 months ago

Need to check though that there was some state value in de api data. But see that's currently not available as a sensor.

Could be! I can see different statuses as also shown in the screenshot, the status will say for example "Productie gepauzeerd" when Powerplay is pausing the PV inverter. In normal situations the status reports like you can see in the screenshot.

Powerplay mentions in the log: Screenshot 2024-03-27 at 19 09 24@2x Screenshot 2024-03-27 at 19 09 07@2x

I don't see a mention of grid_stabilization_active. I can share the full logs but need to redact some info. what's the best way to share? And since it seems there are multiple types of requests, do you need all of them?

fsaris commented 5 months ago

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

The log that starts with [custom_components.zonneplan_one.coordinator] Result should give the info. But the other logs could also be helpful

martijnrusschen commented 5 months ago

Done.

fsaris commented 5 months ago

Can you test https://github.com/fsaris/home-assistant-zonneplan-one/tree/2024.4.0b1 to see if this give some more info about the powerplay status.

Couldn't find anything yet related to the compensation values

martijnrusschen commented 5 months ago

Installed the beta version, will monitor the statuses tomorrow to see when and if they change.

fsaris commented 5 months ago

👍🏼

I'm curious if the following sensors give some meaningful values:

martijnrusschen commented 5 months ago

Current status:

martijnrusschen commented 5 months ago

Update:

Zonneplan paused the inverter just now. Here are the statuses:

IMG_2764

Screenshot 2024-03-28 at 14 27 42@2x

martijnrusschen commented 5 months ago

Power limit active changed to "On" Current scenario changed to "1"

martijnrusschen commented 5 months ago

Current scenario: 1 = Afregelen

fsaris commented 5 months ago

So only power limit active is relevant?

Does Expected surplus or Powerplay change?

martijnrusschen commented 5 months ago

Here's a good overview of the different sensors during a Powerplay moment yesterday: Screenshot 2024-04-01 at 13 28 45@2x

It looks like the main sensor to track is the power limit active, and the timings perfectly sync with the current scenario sensor. I haven't been able to tell the difference between 0 and unknown in this sensor yet. Perhaps more time will tell.

martijnrusschen commented 4 months ago

Update:

This is working great so far. I made a helper sensor to capture a more friendly text of the current powerplay state in my own config:

powerplay_friendly_status:
      friendly_name: "Powerplay Status"
      value_template: >-
        {% if is_state('sensor.zonneplan_one_optimized_omvormer_current_scenario', 'unknown')  %}
          Bescherming aan
        {% elif is_state('sensor.zonneplan_one_optimized_omvormer_current_scenario', '0') %} 
          Afregelen
        {% elif is_state('sensor.zonneplan_one_optimized_omvormer_current_scenario', '1') %} 
          Afregelen
        {% else %}
          {{ states('sensor.zonneplan_one_optimized_omvormer_current_scenario') }}
        {% endif %}

So far, it's only been unknown, 0, or 1. There are scenarios that I haven't encountered yet (disabled because of negative price) and I assume it's just a matter of waiting until those show up.

fsaris commented 4 months ago

Released current state https://github.com/fsaris/home-assistant-zonneplan-one/releases/tag/2024.4.0

Sensor improvements can be added in follow ups