I need another YAML code for the code below:
If one of the sensors (sensor.toon_p1_power_use_low) or (sensor.toon_p1_power_use_high)
is unavailble they must not be used, because i get an error when this happens on the dasboard graph.
My YAML code
platform: template
sensors:
energie_verbruik_totaal:
friendly_name: “Energie Verbruik (totaal)”
unit_of_measurement: ‘W’
value_template: “{{states(‘sensor.toon_p1_power_use_low’) | float(0)+ states(‘sensor.toon_p1_power_use_high’) | float(0) }}”