Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 106299

Another "Energy Dashboard showing no data" post

$
0
0

I have tried working with the energy dashboard multiple times. I thought I had this time, but after leaving the new sensors on the dashboard overnight there is still no data. I have three sensors which are total accumulations in Kwh.

In my template.yaml

- sensor:
    - name: total_power_consumed
      unit_of_measurement: "kWh"
      state_class: measurement
      device_class: energy
      state: >
        {% set battery_consumed = state_attr('sensor.victron_power_data', 'Bc') | float(0) %}
        {% set solar_consumed = state_attr('sensor.victron_power_data', 'Pc') | float(0) %}
        {% set generator_consumed = state_attr('sensor.victron_power_data', 'gc') | float(0) %}
        {{ float(battery_consumed) + float(solar_consumed) + float(generator_consumed) }}
      attributes:
        last_reset: '1970-01-01T00:00:00+00:00'
    - name: total_generator_used
      unit_of_measurement: "kWh"
      state_class: measurement
      device_class: energy
      state: >
        {% set to_battery = state_attr('sensor.victron_power_data', 'gb') | float(0) %}
        {% set direct = state_attr('sensor.victron_power_data', 'gc') | float(0) %}
        {{ float(to_battery) + float(direct) }}
      attributes:
        last_reset: '1970-01-01T00:00:00+00:00'
    - name: total_solar_produced
      unit_of_measurement: "kWh"
      state_class: measurement
      device_class: energy
      state: >
        {% set to_battery = state_attr('sensor.victron_power_data', 'Pb') | float(0) %}
        {% set direct = state_attr('sensor.victron_power_data', 'Pc') | float(0) %}
        {{ float(to_battery) + float(direct) }}
      attributes:
        last_reset: '1970-01-01T00:00:00+00:00'
    - name: total_battery_consumption
      unit_of_measurement: "kWh"
      state_class: measurement
      device_class: energy
      state: >
        {{ state_attr('sensor.victron_power_data', 'Bc') | float(0) }}
      attributes:
        last_reset: '1970-01-01T00:00:00+00:00'
    - name: total_to_battery
      unit_of_measurement: "kWh"
      state_class: measurement
      device_class: energy
      state: >
        {% set solar_to_battery = state_attr('sensor.victron_power_data', 'Pb') | float(0) %}
        {% set gen_to_battery = state_attr('sensor.victron_power_data', 'gb') | float(0) %}
        {{ float(solar_to_battery) + float(gen_to_battery) }}
      attributes:
        last_reset: '1970-01-01T00:00:00+00:00'

States for those sensors:

Energy Dashboard Config:

Energy Dashboard (has been live for 6+ hours):

What am I doing wrong?

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 106299

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>