Hi all,
I’m in the quest of moving everything from Domoticz to HA. The journey is quite exiting. However, I’m building my first (mushroom) front-end, but there’s something I would like to see but cannot find (maybe wrong search terms).
Perhaps the community is willing to help me out.
In the screenshot below, there is a button shown which is based on a template to convert kW to W:
sensor:
- platform: template
sensors:
dsmr_in_watts:
friendly_name: “Current Power Usage”
unit_of_measurement: “W”
value_template: “{{ states(‘sensor.slave_electricity_meter_power_consumption’)|float * 1000 }}”
However, when my solar panels are producing more power then I’m currently consuming, the value of this sensor is 0,0 W. Coming from Domoticz I did like the calculation that Domoticz by using the current energy consumption and subtracting the current production.
For example when my current consumption is 200W and my solar panels are generating 300W the output in Domoticz would be -100W. Meaning I’m delivering 100W back to the grid at that point.
I currently have 2 entities in HA for my P1 meter;
sensor.slave_electricity_meter_power_production
sensor.slave_electricity_meter_power_consumption
Being new to yaml and coding, my question is, is this also possible in HA and if so, how to configure? Side question; is it possible to remove show whole values instead of decimal values. For exmpale 0W instead of 0,0W.
Much appreciated!