Guest User

Untitled

a guest
Apr 30th, 2024
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.71 KB | None | 0 0
  1. this is my musroom chip entity code:
  2.  
  3.  
  4. type: template
  5. entity: input_select.front_door_lock_status_helper
  6. icon: >-
  7. {{ 'mdi:lock' if is_state('input_select.front_door_lock_status_helper',
  8. 'Locked') else 'mdi:lock-open-outline' }}
  9. content: |-
  10. {% if is_state('input_select.front_door_lock_status_helper', 'Pending') %}
  11. Pending
  12. {% elif is_state('input_select.front_door_lock_status_helper', 'Locked') %}
  13. Locked
  14. {% else %}
  15. Unlocked
  16. {% endif %}
  17. icon_color: >
  18. {{ 'green' if is_state('input_select.front_door_lock_status_helper', 'Locked')
  19. else 'red' }}
  20. tap_action:
  21. action: call-service
  22. service: automation.trigger
  23. target:
  24. entity_id: automation.lock_front_door_toggle_locking_state
  25. data:
  26. skip_condition: true
  27.  
  28.  
  29. the automation:
  30. alias: Lock - Front Door - Toggle Locking State
  31. description: Lock service only allows on or off, this allows the toggle
  32. trigger: []
  33. condition: []
  34. action:
  35. - service: input_select.select_option
  36. target:
  37. entity_id:
  38. - input_select.front_door_lock_status_helper
  39. data:
  40. option: Pending
  41. - if:
  42. - condition: state
  43. entity_id: lock.schlage_front_door_lock
  44. state: unlocked
  45. then:
  46. - service: lock.lock
  47. target:
  48. device_id: c7beec1bea8c836a7338e68a8f29e002
  49. data: {}
  50. - wait_for_trigger:
  51. - platform: device
  52. device_id: c7beec1bea8c836a7338e68a8f29e002
  53. domain: lock
  54. entity_id: 0c5ed60dd8777fecf9f20a6951c382cf
  55. type: locked
  56. timeout:
  57. hours: 0
  58. minutes: 0
  59. seconds: 35
  60. milliseconds: 0
  61. - service: input_select.select_option
  62. target:
  63. entity_id:
  64. - input_select.front_door_lock_status_helper
  65. data:
  66. option: Locked
  67. else:
  68. - if:
  69. - condition: state
  70. entity_id: lock.schlage_front_door_lock
  71. state: locked
  72. then:
  73. - service: lock.unlock
  74. target:
  75. device_id:
  76. - c7beec1bea8c836a7338e68a8f29e002
  77. data: {}
  78. - wait_for_trigger:
  79. - platform: device
  80. device_id: c7beec1bea8c836a7338e68a8f29e002
  81. domain: lock
  82. entity_id: 0c5ed60dd8777fecf9f20a6951c382cf
  83. type: unlocked
  84. timeout:
  85. hours: 0
  86. minutes: 0
  87. seconds: 35
  88. milliseconds: 0
  89. - service: input_select.select_option
  90. target:
  91. entity_id:
  92. - input_select.front_door_lock_status_helper
  93. data:
  94. option: Unlocked
  95. mode: single
  96.  
Advertisement
Add Comment
Please, Sign In to add comment