Energy Dashboard: Wh to kWh

Hello All,

Two questions here:

I have a newly-installed IoTaWatt device with a configured output of “sensor.total_power_wh”. When I add that to the Energy Dashboard and I try to input the static price of $0.000088/wh (price per kWh is $0.88), the input box returns a red outline (though, it still lets me save). I’m not sure if Home Assistant is configured correctly at that point - given the red outline.

Given that, I tried to convert “sensor.total_power_wh” to kWh using a template sensor. Here is that code:

- platform: template
          friendly_name: "Total Power kWh"
          unique_id: '6e2f379d-5abd-4f1e-a609-05662f0eaeff'
          unit_of_measurement: 'kWh'
          device_class: energy
          value_template: "{{ states('sensor.total_power_wh') | float / 1000 }}"

That seems to have worked and I have the “sensor.total_power_kwh” in home assistant but I can’t add it to the energy dashboard (it just doesn’t show up).

Any help here?


I was able to figure it out with this post:

Error in template sensor