Usage template energy meter to add to presence lights

You mean like you mentioned in your post here?

So i figure I should add the following lines in my configuration.yaml

[code]sensor:
2. - platform: yr
3. - platform: template
4. sensors:
5. energy_meter:

if using less than 10 Watts

  1.   value_template: "{{ states('sensor.energie_tv_woonkamer_power_8_8') | int < 10 }}"
    
  2.   unit_of_measurement: 'W'[/code]
    

The automation should look something like this?

- alias: 'Lights turn off after 3:30 minutes' trigger: platform: state entity_id: binary_sensor.pir_woonkamer_sensor_6_0 to: 'off' for: minutes: 3 seconds: 30 condition: condition: state entity_id: sensor.energie_tv_woonkamer_power_8_8 state: '<10' action: - service: switch.turn_off entity_id: switch.test_lamp_woonkamer - service: switch.turn_off entity_id: switch.grijze_lamp_woonkamer

This last part I don’t know how to implement.

1 Like