I am still very new to HA. I have a Deye inverter that I monitor with the Solarman integration and displaying various power readings in custom apexcharts-card. We suffer regular power outages (load-shedding, this is South Africa) and the Solarman integration provides a sensor to see if it is on or off grid. When off grid, the grid power goes to zero but no actual samples are taken, so when the power is restored it does some kind of interpolation of values since the power cut and when it restores, almost like a sinusoidal ramp. It would like to use the grid online status to force 0 values while the grid is off for every sample during that time.
Can anyone please provide guidance on this, either useful reference material or a possible way to achieve it? As mentioned, I’m still very new to HA and I’ve already spent many hours to find and try-it possible solutions, but nothing successful yet.
While the grid is available the Solarman Grid-connected Status shows ‘On-Grid’.
Thank you in advance.
I don’t have any experience with that integration. So there may be a way to change its configuration to do what you want. It’s a common problem that when a power reading is static (in your case 0), that is does not get accumulated properly or in a timely fashion. What I do is use a template sensor and force it to update periodically based on a time_pattern trigger. This example below will force a state update every 10 minutes or when the source sensor changes.
template:
- trigger:
- platform: time_pattern
minutes: "/10"
- platform: state
entity_id: sensor.YOUR_POWER_SENSOR
sensor:
- name: pw_solar_power
state: "{{ states("sensor.YOUR_POWER_SENSOR") }}"
unit_of_measurement: W
device_class: power
attributes:
triggered_at: "{{ now() }}"
Thank you very much @PeteRage, I really appreciate your response. I have been rather occupied with work and did not follow up on this. I shall try this out, it seems like a good way to handle this.