Rest sensor summing up

Hello!

I have gone through the forum and made my HA able to read data from my Solax inverter via Wi-Fi and rest. Everything works fine but I would like to display days total of PV which Solax itself does not count.

Here is my config:

rest:
  - resource: http://<inverter_ip>/optType=ReadRealTimeData
    method: POST
    headers:
      Content-Type: application/json
    scan_interval: 5
    sensor:
      - name: "Solax PV power"
        value_template: "{{ value_json.Data[8] + value_json.Data[9] }}"
        unit_of_measurement: 'W'

This works as it should and sums data from PV1 and PV2 but now I need to have another sensor “Solax total PV power” which adds every scan = 5s present value to the previous one and so on. Then I would divide it to have correct number in kWh.

I tried to make separate from the rest and it works but I think it would be better to have only one cycle and that would not work for me :frowning:

Could you please point me in the right direction?

Thank you very much,

Lukas

Feed your rest sensor to this:

Pay particular attention to the method option.

Thank you very much, it seems to do the work but now I can not find a way to reset the sensor daily to zero. I tried it with automation via recorder but it does nothing.

Is there a way to do this?

Thank you

Yes, feed the energy sensor to a utility meter helper with a daily cycle.