Advertisement
Guest User

Untitled

a guest
Jan 19th, 2020
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. Моя автоматизация на датчик движения
  2. ####################################################
  3. # Свет по датчикам движения #
  4. ####################################################
  5.  
  6. # Включение света в коридоре по датчику движения
  7. - alias: hall_light_pir_on
  8. trigger:
  9. platform: state
  10. entity_id: binary_sensor.motion_sensor_158d00018745b5
  11. to: 'on'
  12. action:
  13. service: homeassistant.turn_on
  14. entity_id: light.hall_light
  15.  
  16. # Выключение света в коридоре по датчику движения
  17. - alias: hall_light_pir_off
  18. trigger:
  19. platform: state
  20. entity_id: binary_sensor.motion_sensor_158d00018745b5
  21. to: 'off'
  22. for:
  23. seconds: 1
  24. action:
  25. service: homeassistant.turn_off
  26. entity_id: light.hall_light
  27.  
  28.  
  29. ################################## Ваш пример:
  30. # Одиночный включает ваше реле:
  31. - alias: 123
  32. trigger:
  33. platform: state
  34. entity_id: sensor.0x00158d00033e88ca_click
  35. to: 'single'
  36. action:
  37. service: homeassistant.turn_on
  38. entity_id: switch.sonoff_basic_relay
  39.  
  40. # Двойной выключает ваше реле:
  41. - alias: 456
  42. trigger:
  43. platform: state
  44. entity_id: sensor.0x00158d00033e88ca_click
  45. to: 'double'
  46. action:
  47. service: homeassistant.turn_off
  48. entity_id: switch.sonoff_basic_relay
  49.  
  50. # Или Двойной переключает ваше реле:
  51. - alias: 789
  52. trigger:
  53. platform: state
  54. entity_id: sensor.0x00158d00033e88ca_click
  55. to: 'double'
  56. action:
  57. service: homeassistant.toggle
  58. entity_id: switch.sonoff_basic_relay
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement