Advertisement
Guest User

Untitled

a guest
Jun 19th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. ### sensor in config
  2. - platform: mqtt
  3. name: "Kitchen Motion"
  4. state_topic: "Hassio/433/Honeywell/Honeywell_Door/Window_Sensor/699555"
  5. qos: 0
  6. value_template: '{% if (value_json.event is equalto 0) %} on {% elif (value_json.event is equalto 9) %} off {% endif %}'
  7.  
  8. ################ Motion Detection
  9. - alias: KitchenMotionDetectionON
  10. trigger:
  11. - platform: state
  12. entity_id: sensor.kitchen_motion
  13. from: 'off'
  14. to: 'on'
  15.  
  16. condition:
  17. - condition: state
  18. entity_id: switch.under_cabinet_lighting
  19. state: 'off'
  20. - condition: state
  21. entity_id: group.all_devices
  22. state: 'home'
  23. - condition: or
  24. conditions:
  25. - condition: time
  26. after: '21:30:00'
  27. - condition: template
  28. value_template: "{{ states('sensor.time') == (states.input_datetime.cabinetlightsoff.attributes.timestamp| int | timestamp_custom('%H:%M', False)) }}"
  29. - condition: time
  30. before: '06:40:00'
  31.  
  32. action:
  33. service: switch.turn_on
  34. entity_id: switch.under_cabinet_lighting
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement