Hypfer / deye-microinverter-cloud-free

Documentation and tooling to use Deye microinverters without the solarman cloud
106 stars 14 forks source link

How to get Yield today working #1

Closed realthargor closed 1 year ago

realthargor commented 1 year ago

@Hypfer Thanks for your great documentation on this!

The one thing I'm a bit unclear on is how to get Yield today working:

Note that with internet access blocked, the inverter never receives any time information. This breaks the Yield today counter as it will never properly reset unless you manually set the time on each boot using modbus register 22, 23 and 24

Is this something homeassistant can do by setting the registers via modbus if the device comes online? Do you have the config for this and can you publish it?

Hypfer commented 1 year ago

Because I was lazy at the time, I just configured a utility meter with daily reset for the total consumption.

You can also try setting up an automation that writes those registers on state change but IMO such logic would be better suited for the integration code itself instead of an automation glued on top

rezeero25 commented 10 months ago

https://neobiker.de/wiki/DEYE_Wechselrichter A Deamon is set up there, which writes the current date into register 22 every day as soon as the inverter goes online.

The problem with the implementation in Home Assistant is that the power remains "frozen" after the inverter is switched off, e.g. at 4 W. With the use of a template sensor (using /config/sensor.yaml) this can be worked around (power below 4 W for longer than 7.5 min (450 s) [because 5min is the inverter's time interval] are set to zero):

      # Template sensor for values of solargen (active_power > 0)
      power_solargen:
        friendly_name: "Power Solargen"
        unit_of_measurement: 'W'
        value_template: >-
          {% if (states('sensor.solarman_total_ac_output_power_active')|float) < 4 and (as_timestamp(now()) - as_timestamp(states.sensor.solarman_total_ac_output_power_active.last_changed)) > 450 %}
            {{ 0 }}
          {% elif (states('sensor.solarman_total_ac_output_power_active')|float) >= 4 %}
            {{ states('sensor.solarman_total_ac_output_power_active')|float }}
          {% else %}
            {{ 0 }}
          {% endif %}
        availability_template: "{{
            [ states('sensor.solarman_total_ac_output_power_active')
            ] | map('is_number') | min
          }}"