So after todays release of 2021.08 with the new long term statistics and energy focus I wanted to include my IKEA Sparsnäs reciever. I read up on the info page Sensor Entity | Home Assistant Developer Docs and added what I thought was the required parts to my mqtt:
sensor:
- platform: mqtt
state_topic: "EspSparsnasGateway/+/state"
name: "House power usage"
unit_of_measurement: "W"
value_template: '{{ float(value_json.watt) | round(0) }}'
icon: mdi:flash-circle
state_class: measurement
device_class: power
- platform: mqtt
state_topic: "EspSparsnasGateway/+/state"
name: "House energy usage"
unit_of_measurement: "kWh"
value_template: '{{ float(value_json.total) | round(0) }}'
icon: mdi:flash-circle
state_class: measurement
device_class: energy
I can see the attributes in the dev tools but I still can’t select it in the energy config screen?
Is there some other setting I need to configure to?