Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### sensor in config
- - platform: mqtt
- name: "Kitchen Motion"
- state_topic: "Hassio/433/Honeywell/Honeywell_Door/Window_Sensor/699555"
- qos: 0
- value_template: '{% if (value_json.event is equalto 0) %} on {% elif (value_json.event is equalto 9) %} off {% endif %}'
- ################ Motion Detection
- - alias: KitchenMotionDetectionON
- trigger:
- - platform: state
- entity_id: sensor.kitchen_motion
- from: 'off'
- to: 'on'
- condition:
- - condition: state
- entity_id: switch.under_cabinet_lighting
- state: 'off'
- - condition: state
- entity_id: group.all_devices
- state: 'home'
- - condition: or
- conditions:
- - condition: time
- after: '21:30:00'
- - condition: template
- value_template: "{{ states('sensor.time') == (states.input_datetime.cabinetlightsoff.attributes.timestamp| int | timestamp_custom('%H:%M', False)) }}"
- - condition: time
- before: '06:40:00'
- action:
- service: switch.turn_on
- entity_id: switch.under_cabinet_lighting
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement