I cannot find the answer on my problem:
I have some electric devices that are turned on if I have a lot of excess solar energy. I wish to have a “dummy sensor” that shows the total power of the turned on devices.
So for example: I have 2 heaters controlled each by a switch:
- “switch.switch1” → turns on 800W heater
- “switch.switch2” → turns on 1600W heater
I think the best option is to create a template sensor, but how to calculate the value?
sensor: - platform: template sensors: totalpower: friendly_name: Total power consumption unit_of_measurement: Watt value_template: > ??? (value = (800 when switch1 on) + (1600 when switch2 on))
The only solution I currently have is to build an if statement:
- if(switch1 and not switch2) → 800W
- if(switch2 and not switch1) → 1600W
This would problably work, but will become a extremelly long if statement when adding more and more electric devices.