daniel-jong / esp8266_p1meter

DSMR5 P1 meter to mqtt using esp8266
GNU General Public License v3.0
152 stars 54 forks source link

Have these sensor show up in the energydashboard configuration #11

Closed spoetnik closed 2 years ago

spoetnik commented 2 years ago

Fixes https://github.com/daniel-jong/esp8266_p1meter/issues/10#issue-1038873285

daniel-jong commented 2 years ago

Hey there and thanks for the contribution! :+1:

I've fiddled with this a couple months ago but did not manage to get this to work, seems like I wasn't using the device_class: energy statement. I've then settled on (ab)using the utility_meter integration myself, but this is much better cleaner

SjamonDaal commented 2 years ago

Could you fix this for gas as well?

Update: This should fix gas

- platform: mqtt
    name: P1 Gas Usage
    unique_id: 'sensor.p1_gas_usage'
    device_class: gas
    state_class: total_increasing
    unit_of_measurement: 'm³'
    state_topic: "sensors/power/p1meter/gas_meter_m3"
    value_template: "{{ value|float / 1000 }}"

The superscript m³ is important.