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

Create Energy kwh measurement for energy dashboard from

$
0
0

Hey
I’m trying to make a sensor for the energy dashboard (from watts reading with a couple of conditions) but for some reason it’s not working.




  - platform: template
    sensors:
     energy_in:
       friendly_name: "Energy Into House"
       device_class: energy
       unit_of_measurement: 'W'
       value_template: >
         {% set watts_out = states('sensor.shelly_shem_3_######_1_current_consumption') | float %}
         {% if watts_out <= 0 %}
             {{states('sensor.shelly_shem_3_######_1_current_consumption')| float * -1 }}
         {% elif watts_out > 0 %}
             {{states(0) }}
         {% endif %}

  - platform: integration
    source: sensor.energy_in
    name: energy_from_grid
    unit_prefix: k
    method: left
    round: 2
    unit: kWh

Please help

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 103101

Trending Articles



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