Energy Dashboard Not Displaying Correct Autarco Solar Data

Hi Everyone,

I need some help with my Energy dashboard. I have added my PV output via a REST call to my Home Assistant configuration, which I found here: Extract data from Autarco Solar panels - Third party integrations - Home Assistant Community (home-assistant.io). The data is visible and matches what I see on my.autarco.com.

Issue

The problems start when I try to make this data visible on my Energy dashboard. The link mentions using helpers to fix this, but I can’t get that to work.

One workaround I tried is to use other sensors. The strangest thing is that the pv_today_template is working fine, but I would like to get a more detailed visualization, so I want to use the pv_now_template template. However, the pv_now_template doesn’t add up to what it should be, and I can’t figure out what’s wrong.

Steps Taken

  • Checked for issues via Dev Tools → Statistics
  • Data matches with the data on my.autarco.com.
  • Used Riemann sum integral sensor, but got the same problem; data from pv.now is strange

Configuration

Here’s my current configuration:

homeassistant:
  customize_glob:
    sensor.pv_to_date:
      last_reset: "1970-01-01T00:00:00+00:00"
      device_class: energy
      state_class: total_increasing
    sensor.pv_now_template:
      last_reset: "1970-01-01T00:00:00+00:00"
      device_class: energy
      state_class: measurement
    sensor.pv_today:
      last_reset: "1970-01-01T00:00:00+00:00"
      device_class: energy
      state_class: total_increasing      
    sensor.pv_today_template:
      last_reset: "1970-01-01T00:00:00+00:00"
      device_class: energy
      state_class: total_increasing

sensor:
  - platform: template
    sensors:
      pv_today_template:
        friendly_name: "PV Today Template"
        unique_id: "pv_today_template"
        unit_of_measurement: "kWh"
        device_class: energy
        value_template: "{{ states('sensor.pv_today') }}"
  - platform: template
    sensors:      
      pv_now_template:
        friendly_name: "PV Now Template"
        unique_id: "pv_now_template"
        unit_of_measurement: "kWh"
        device_class: energy
        value_template: "{{ states('sensor.pv_now') }}"
  - platform: template
    sensors:      
      pv_to_date_template:
        friendly_name: "PV To Date Template"
        unique_id: "pv_to_date_template"
        unit_of_measurement: "kWh"
        device_class: energy
        value_template: "{{ states('sensor.pv_to_date') }}"

rest:
  - authentication: basic
    username: !secret autarco_username
    password: !secret autarco_password
    scan_interval: 120
    resource: https://my.autarco.com/api/m1/site/xxxxx/power
    sensor:
      - name: "pv_now"
        value_template: "{{ value_json.stats.kpis.pv_now / 1000 }}"
        unit_of_measurement: "kW"
        device_class: power
        state_class: measurement
  - authentication: basic
    username: !secret autarco_username
    password: !secret autarco_password
    scan_interval: 120
    resource: https://my.autarco.com/api/m1/site/xxxxx/energy
    sensor:
      - name: "pv_today"
        value_template: "{{ value_json.stats.kpis.pv_today }}"
        unit_of_measurement: "kWh"
        device_class: energy
        state_class: total_increasing
      - name: "pv_month"
        value_template: "{{ value_json.stats.kpis.pv_month }}"
        unit_of_measurement: "kWh"
        device_class: energy
        state_class: total_increasing
      - name: "pv_to_date"
        value_template: "{{ value_json.stats.kpis.pv_to_date }}"
        unit_of_measurement: "kWh"
        device_class: energy
        state_class: total_increasing

Help Needed

  • Why is the data from pv_now_template not adding up correctly?
  • How can I get pv_now_template to provide a more detailed visualization?
  • Or is the best way to use an helper? Any tips on properly using the Riemann sum integral sensor to fix this?

Thanks in advance for any help you can provide!