Guest User

Untitled

a guest
Jul 24th, 2023
1,235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.22 KB | None | 0 0
  1. alias: "!Background - Kitchen - RGB Changer"
  2. description: ""
  3. trigger:
  4. - platform: state
  5. entity_id:
  6. - input_boolean.kitchen_rgb_toggle
  7. from: null
  8. to: null
  9. - platform: state
  10. entity_id:
  11. - input_boolean.toggle_kitchen_rgb_top
  12. from: null
  13. to: null
  14. - platform: state
  15. entity_id:
  16. - input_boolean.toggle_kitchen_rgb_bottom
  17. from: null
  18. to: null
  19. - platform: state
  20. entity_id:
  21. - input_number.kitchen_rgb_mode
  22. from: null
  23. to: null
  24. - platform: state
  25. entity_id:
  26. - input_text.kitchen_rgb_color_value
  27. from: null
  28. to: null
  29. condition: []
  30. action:
  31. - if:
  32. - condition: template
  33. value_template: "{{ states('input_number.kitchen_rgb_mode') | int == 3 }}"
  34. alias: IF Mode 3 = RGB
  35. enabled: true
  36. then:
  37. - if:
  38. - condition: state
  39. entity_id: input_boolean.toggle_kitchen_rgb_top
  40. state: "on"
  41. then:
  42. - service: light.turn_on
  43. data:
  44. rgb_color:
  45. - >-
  46. {{ states('input_text.kitchen_rgb_color_value').split(',')[0]
  47. | int }}
  48. - >-
  49. {{ states('input_text.kitchen_rgb_color_value').split(',')[1]
  50. | int }}
  51. - >-
  52. {{ states('input_text.kitchen_rgb_color_value').split(',')[2]
  53. | int }}
  54. transition: 0
  55. target:
  56. entity_id: light.kitchen_rgb_top_light
  57. - if:
  58. - condition: state
  59. entity_id: input_boolean.toggle_kitchen_rgb_bottom
  60. state: "on"
  61. then:
  62. - service: light.turn_on
  63. data:
  64. rgb_color:
  65. - >-
  66. {{ states('input_text.kitchen_rgb_color_value').split(',')[0]
  67. | int }}
  68. - >-
  69. {{ states('input_text.kitchen_rgb_color_value').split(',')[1]
  70. | int }}
  71. - >-
  72. {{ states('input_text.kitchen_rgb_color_value').split(',')[2]
  73. | int }}
  74. transition: 0
  75. target:
  76. entity_id: light.kitchen_rgb_bottom_light
  77. - if:
  78. - condition: and
  79. conditions:
  80. - condition: state
  81. entity_id: input_boolean.toggle_kitchen_rgb_top
  82. state: "off"
  83. - condition: state
  84. entity_id: input_boolean.toggle_kitchen_rgb_bottom
  85. state: "off"
  86. then:
  87. - service: light.turn_on
  88. data:
  89. transition: 3
  90. rgb_color:
  91. - >-
  92. {{ states('input_text.kitchen_rgb_color_value').split(',')[0]
  93. | int }}
  94. - >-
  95. {{ states('input_text.kitchen_rgb_color_value').split(',')[1]
  96. | int }}
  97. - >-
  98. {{ states('input_text.kitchen_rgb_color_value').split(',')[2]
  99. | int }}
  100. target:
  101. entity_id:
  102. - light.kitchen_rgb_bottom_light
  103. - light.kitchen_rgb_top_light
  104. mode: single
  105.  
Advertisement
Add Comment
Please, Sign In to add comment