Files

hasp_plate01_p5_sliders.yaml
############################################################################## # Automations to configure slider controls on page 5 # Currently this page is not used in the demo automations ############################################################################## # Automations to set colors on HASP Page 5 # # Here we've swapped selected/unselected as these buttons will always be # unselected (unless actively being pressed), and sliders do not have a # selected/unselected state. automation: - alias: hasp_plate01_p5_ColorConfig_selectedforegroundcolor trigger: - platform: state entity_id: 'binary_sensor.plate01_connected' to: 'on' - platform: homeassistant event: start - platform: state entity_id: input_number.hasp_plate01_selectedforegroundcolor action: - service: mqtt.publish data: topic: 'hasp/plate01/command/json' payload_template: >- [{%- for i in range(4,7) -%}"p[5].b[{{i}}].pco={{ states('input_number.hasp_plate01_selectedforegroundcolor')|int }}"{% if not loop.last %},{% endif %}{%- endfor -%}] - alias: hasp_plate01_p5_ColorConfig_selectedbackgroundcolor trigger: - platform: state entity_id: 'binary_sensor.plate01_connected' to: 'on' - platform: homeassistant event: start - platform: state entity_id: input_number.hasp_plate01_selectedbackgroundcolor action: - service: mqtt.publish data: topic: 'hasp/plate01/command/json' payload_template: >- [{%- for i in range(4,7) -%}"p[5].b[{{i}}].bco={{ states('input_number.hasp_plate01_selectedbackgroundcolor')|int }}"{% if not loop.last %},{% endif %}{%- endfor -%}] - alias: hasp_plate01_p5_ColorConfig_unselectedforegroundcolor trigger: - platform: state entity_id: 'binary_sensor.plate01_connected' to: 'on' - platform: homeassistant event: start - platform: state entity_id: input_number.hasp_plate01_unselectedforegroundcolor action: - service: mqtt.publish data: topic: 'hasp/plate01/command/json' payload_template: >- [{%- for i in range(4,7) -%}"p[5].b[{{i}}].pco2={{ states('input_number.hasp_plate01_unselectedforegroundcolor')|int }}",{%- endfor -%} {%- for i in range(7,10) -%}"p[5].b[{{i}}].pco={{ states('input_number.hasp_plate01_unselectedforegroundcolor')|int }}"{% if not loop.last %},{% endif %}{%- endfor -%}] - alias: hasp_plate01_p5_ColorConfig_unselectedbackgroundcolor trigger: - platform: state entity_id: 'binary_sensor.plate01_connected' to: 'on' - platform: homeassistant event: start - platform: state entity_id: input_number.hasp_plate01_unselectedbackgroundcolor action: - service: mqtt.publish data: topic: 'hasp/plate01/command/json' payload_template: >- [{%- for i in range(4,7) -%}"p[5].b[{{i}}].bco2={{ states('input_number.hasp_plate01_unselectedbackgroundcolor')|int }}",{%- endfor -%} {%- for i in range(7,10) -%}"p[5].b[{{i}}].bco={{ states('input_number.hasp_plate01_unselectedbackgroundcolor')|int }}"{% if not loop.last %},{% endif %}{%- endfor -%}]
Report a bug