Created
March 17, 2018 08:17
-
-
Save 1337hium/936e04dd14ea80316f9e6726bf00041b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- alias: HASwitchPlate1_Dimmers_Init | |
trigger: | |
- platform: mqtt | |
topic: 'homeassistant/binary_sensor/HASwitchPlate1/state' | |
payload: 'ON' | |
- platform: homeassistant | |
event: start | |
action: | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[4].b[4].txt' | |
payload: '"Buero"' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[4].b[5].txt' | |
payload: '"Stube"' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[4].b[6].txt' | |
payload: '"Kueche"' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[2].b[4].txt' | |
payload: '"Buero"' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[2].b[5].txt' | |
payload: '"Kueche"' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[2].b[6].txt' | |
payload: '"Stube"' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[2].b[7].txt' | |
payload: '"Schlafen"' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[6].b[4].txt' | |
payload: '"Stube"' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[6].b[5].txt' | |
payload: '"Buero"' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[6].b[6].txt' | |
payload: '"Drucker"' | |
- alias: HASwitchPlate1_p[4]b[7]_DimmerSliderUpdateHass | |
trigger: | |
- platform: mqtt | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/state/p[4].b[7].val' | |
action: | |
- service: light.turn_on | |
data_template: | |
entity_id: light.buero_gw | |
brightness: '{{ trigger.payload }}' | |
- alias: HASwitchPlate1_p[4]b[7]_DimmerSliderUpdateHASP | |
trigger: | |
- platform: state | |
entity_id: light.buero_gw | |
action: | |
- service: mqtt.publish | |
data_template: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[4].b[7].val' | |
payload_template: '{{states.light.buero_gw.attributes.brightness|default(0)|int}}' | |
- alias: HASwitchPlate1_p[4]b[8]_DimmerSliderUpdateHass | |
trigger: | |
- platform: mqtt | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/state/p[4].b[8].val' | |
action: | |
- service: light.turn_on | |
data_template: | |
entity_id: light.stube_alles | |
brightness: '{{ trigger.payload }}' | |
- alias: HASwitchPlate1_p[4]b[8]_DimmerSliderUpdateHASP | |
trigger: | |
- platform: state | |
entity_id: light.stube_alles | |
action: | |
- service: mqtt.publish | |
data_template: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[4].b[8].val' | |
payload_template: '{{states.light.stube_alles.attributes.brightness|default(0)|int}}' | |
- alias: HASwitchPlate1_p[4]b[9]_DimmerSliderUpdateHass | |
trigger: | |
- platform: mqtt | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/state/p[4].b[9].val' | |
action: | |
- service: light.turn_on | |
data_template: | |
entity_id: light.kueche | |
brightness: '{{ trigger.payload }}' | |
- alias: HASwitchPlate1_p[4]b[9]_DimmerSliderUpdateHASP | |
trigger: | |
- platform: state | |
entity_id: light.kueche | |
action: | |
- service: mqtt.publish | |
data_template: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[4].b[9].val' | |
payload_template: '{{states.light.kueche.attributes.brightness|default(0)|int}}' | |
- alias: HASwitchPlate1_p[6]b[4]_ss | |
trigger: | |
- platform: mqtt | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/state/p[6].b[4]' | |
payload: 'ON' | |
action: | |
- service: automation.toggle | |
entity_id: automation.bewegung_stube_2 | |
- service: automation.toggle | |
entity_id: automation.bewegung_stube | |
- alias: HASwitchPlate1_p[6]b[4]_ss | |
trigger: | |
- platform: mqtt | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/state/p[6].b[5]' | |
payload: 'ON' | |
action: | |
- service: automation.toggle | |
entity_id: automation.bewegung_buero | |
- service: automation.toggle | |
entity_id: automation.bewegung_buero_off | |
- alias: HASwitchPlate1_p[2]b[4]_ss | |
trigger: | |
- platform: mqtt | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/state/p[2].b[4]' | |
payload: 'ON' | |
action: | |
- service: light.toggle | |
entity_id: light.buero_gw | |
- alias: HASwitchPlate1_p[2]b[5]_ss | |
trigger: | |
- platform: mqtt | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/state/p[2].b[5]' | |
payload: 'ON' | |
action: | |
- service: light.toggle | |
entity_id: light.kueche | |
- alias: HASwitchPlate1_p[2]b[6]_ss | |
trigger: | |
- platform: mqtt | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/state/p[2].b[6]' | |
payload: 'ON' | |
action: | |
- service: light.toggle | |
entity_id: light.stube_alles | |
- alias: HASwitchPlate1_p[2]b[7]_ss | |
trigger: | |
- platform: mqtt | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/state/p[2].b[7]' | |
payload: 'ON' | |
action: | |
- service: light.toggle | |
entity_id: light.schlafzimmer | |
- alias: buerobg on | |
trigger: | |
- entity_id: light.buero_gw | |
platform: state | |
to: 'on' | |
action: | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[2].b[4].bco' | |
payload: '1024' | |
- alias: buerobg off | |
trigger: | |
- entity_id: light.buero_gw | |
platform: state | |
to: 'off' | |
action: | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[2].b[4].bco' | |
payload: '65535' | |
- alias: kuechebg on | |
trigger: | |
- entity_id: light.kueche | |
platform: state | |
to: 'on' | |
action: | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[2].b[5].bco' | |
payload: '1024' | |
- alias: buerobg off | |
trigger: | |
- entity_id: light.kueche | |
platform: state | |
to: 'off' | |
action: | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[2].b[5].bco' | |
payload: '65535' | |
- alias: bgon | |
trigger: | |
- entity_id: automation.bewegung_stube_2 | |
platform: state | |
to: 'on' | |
action: | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[6].b[4].bco' | |
payload: '1024' | |
- alias: buerobg off | |
trigger: | |
- entity_id: automation.bewegung_stube_2 | |
platform: state | |
to: 'off' | |
action: | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[6].b[4].bco' | |
payload: '63488' | |
- alias: bgon | |
trigger: | |
- entity_id: automation.bewegung_buero | |
platform: state | |
to: 'on' | |
action: | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[6].b[5].bco' | |
payload: '1024' | |
- alias: buerobg off | |
trigger: | |
- entity_id: automation.bewegung_buero | |
platform: state | |
to: 'off' | |
action: | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[6].b[5].bco' | |
payload: '63488' | |
- alias: bgon | |
trigger: | |
- entity_id: switch.edimax_drucker | |
platform: state | |
to: 'on' | |
action: | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[6].b[6].bco' | |
payload: '1024' | |
- alias: buerobg off | |
trigger: | |
- entity_id: switch.edimax_drucker | |
platform: state | |
to: 'off' | |
action: | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[6].b[6].bco' | |
payload: '63488' | |
- alias: stubeon | |
trigger: | |
- entity_id: light.stube_alles | |
platform: state | |
to: 'on' | |
action: | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[2].b[6].bco' | |
payload: '1024' | |
- alias: stubebg off | |
trigger: | |
- entity_id: light.stube_alles | |
platform: state | |
to: 'off' | |
action: | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[2].b[6].bco' | |
payload: '65535' | |
- alias: schlafenon | |
trigger: | |
- entity_id: light.schlafzimmer | |
platform: state | |
to: 'on' | |
action: | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[2].b[7].bco' | |
payload: '1024' | |
- alias: schlafenbg off | |
trigger: | |
- entity_id: light.schlafzimmer | |
platform: state | |
to: 'off' | |
action: | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[2].b[7].bco' | |
payload: '65535' | |
############################################################################## | |
# Automations for handling the 3 page select buttons at the bottom of each | |
# page on the panel. This example should be ready to use, simply run a | |
# Case Sensitive search/replace on "HASwitchPlate1" with your node name | |
############################################################################## | |
# Initialize device on connect | |
- alias: HASwitchPlate1_Connected | |
trigger: | |
- platform: mqtt | |
topic: 'homeassistant/binary_sensor/HASwitchPlate1/state' | |
payload: 'ON' | |
- platform: homeassistant | |
event: start | |
action: | |
- service: mqtt.publish | |
data_template: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/page' | |
# payload_template: '{{states.input_number.haswitchplate_active_page.state|int}}' | |
payload: '1' | |
############################################################################## | |
# select haswitchplate_pagebutton1_page in response to page button 1 | |
- alias: HASwitchPlate1_PageButton1_Action | |
trigger: | |
- platform: mqtt | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/state/+' | |
payload: 'ON' | |
condition: | |
condition: template | |
value_template: '{{ trigger.topic.split("/")[-1].split("].b[")[1].strip("]")|int == 1 }}' | |
action: | |
- service: mqtt.publish | |
data_template: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/page' | |
payload_template: "{{states.input_number.haswitchplate_active_page.state|int -1}}" | |
############################################################################## | |
# select haswitchplate_pagebutton2_page in response to page button 2 | |
- alias: HASwitchPlate1_PageButton2_Action | |
trigger: | |
- platform: mqtt | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/state/+' | |
payload: 'ON' | |
condition: | |
condition: template | |
value_template: '{{ trigger.topic.split("/")[-1].split("].b[")[1].strip("]")|int == 2 }}' | |
action: | |
- service: mqtt.publish | |
data_template: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/page' | |
# payload_template: "{{states.input_number.haswitchplate_pagebutton2_page.state|int}}" | |
payload_template: '1' | |
############################################################################## | |
# select haswitchplate_pagebutton3_page in response to page button 3 | |
- alias: HASwitchPlate1_PageButton3_Action | |
trigger: | |
- platform: mqtt | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/state/+' | |
payload: 'ON' | |
condition: | |
condition: template | |
value_template: '{{ trigger.topic.split("/")[-1].split("].b[")[1].strip("]")|int == 3 }}' | |
action: | |
- service: mqtt.publish | |
data_template: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/page' | |
payload_template: "{{states.input_number.haswitchplate_active_page.state|int +1}}" | |
############################################################################## | |
# Update haswitchplate_active_page when changed at the panel | |
- alias: HASwitchPlate1_Panel_Page_Changed | |
trigger: | |
- platform: mqtt | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/state/page' | |
action: | |
- service: automation.turn_off | |
entity_id: automation.haswitchplate_active_page_slider_changed | |
- service: input_number.set_value | |
data_template: | |
entity_id: input_number.haswitchplate_active_page | |
value: '{{ trigger.payload }}' | |
- service: automation.turn_on | |
entity_id: automation.haswitchplate_active_page_slider_changed | |
############################################################################## | |
# Change page at panel when haswitchplate_active_page updated | |
- alias: HASwitchPlate1_Active_Page_Slider_Changed | |
trigger: | |
platform: state | |
entity_id: input_number.haswitchplate_active_page | |
action: | |
service: mqtt.publish | |
data_template: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/page' | |
payload: '{{ states.input_number.haswitchplate_active_page.state | int }}' | |
############################################################################## | |
# Set page button text across all pages to the value selected in the interface | |
# set page button text on each page to haswitchplate_pagebutton1_label | |
- alias: HASwitchPlate1_PageButton1_Text | |
trigger: | |
- platform: state | |
entity_id: input_text.haswitchplate_pagebutton1_label | |
- platform: mqtt | |
topic: 'homeassistant/binary_sensor/HASwitchPlate1/state' | |
payload: 'ON' | |
- platform: homeassistant | |
event: start | |
action: | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[1].b[1].txt' | |
payload_template: '"{{states.input_text.haswitchplate_pagebutton1_label.state}}"' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[2].b[1].txt' | |
payload_template: '"{{states.input_text.haswitchplate_pagebutton1_label.state}}"' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[3].b[1].txt' | |
payload_template: '"{{states.input_text.haswitchplate_pagebutton1_label.state}}"' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[4].b[1].txt' | |
payload_template: '"{{states.input_text.haswitchplate_pagebutton1_label.state}}"' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[5].b[1].txt' | |
payload_template: '"{{states.input_text.haswitchplate_pagebutton1_label.state}}"' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[6].b[1].txt' | |
payload_template: '"{{states.input_text.haswitchplate_pagebutton1_label.state}}"' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[7].b[1].txt' | |
payload_template: '"{{states.input_text.haswitchplate_pagebutton1_label.state}}"' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[8].b[1].txt' | |
payload_template: '"{{states.input_text.haswitchplate_pagebutton1_label.state}}"' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[9].b[1].txt' | |
payload_template: '"{{states.input_text.haswitchplate_pagebutton1_label.state}}"' | |
# set page button text on each page to haswitchplate_pagebutton2_label | |
- alias: HASwitchPlate1_PageButton2_Text | |
trigger: | |
- platform: state | |
entity_id: input_text.haswitchplate_pagebutton2_label | |
- platform: mqtt | |
topic: 'homeassistant/binary_sensor/HASwitchPlate1/state' | |
payload: 'ON' | |
- platform: homeassistant | |
event: start | |
action: | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[1].b[2].txt' | |
payload_template: '"{{states.input_text.haswitchplate_pagebutton2_label.state}}"' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[2].b[2].txt' | |
payload_template: '"{{states.input_text.haswitchplate_pagebutton2_label.state}}"' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[3].b[2].txt' | |
payload_template: '"{{states.input_text.haswitchplate_pagebutton2_label.state}}"' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[4].b[2].txt' | |
payload_template: '"{{states.input_text.haswitchplate_pagebutton2_label.state}}"' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[5].b[2].txt' | |
payload_template: '"{{states.input_text.haswitchplate_pagebutton2_label.state}}"' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[6].b[2].txt' | |
payload_template: '"{{states.input_text.haswitchplate_pagebutton2_label.state}}"' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[7].b[2].txt' | |
payload_template: '"{{states.input_text.haswitchplate_pagebutton2_label.state}}"' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[8].b[2].txt' | |
payload_template: '"{{states.input_text.haswitchplate_pagebutton2_label.state}}"' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[9].b[2].txt' | |
payload_template: '"{{states.input_text.haswitchplate_pagebutton2_label.state}}"' | |
# set page button text on each page to haswitchplate_pagebutton3_label | |
- alias: HASwitchPlate1_PageButton3_Text | |
trigger: | |
- platform: state | |
entity_id: input_text.haswitchplate_pagebutton3_label | |
- platform: mqtt | |
topic: 'homeassistant/binary_sensor/HASwitchPlate1/state' | |
payload: 'ON' | |
- platform: homeassistant | |
event: start | |
action: | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[1].b[3].txt' | |
payload_template: '"{{states.input_text.haswitchplate_pagebutton3_label.state}}"' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[2].b[3].txt' | |
payload_template: '"{{states.input_text.haswitchplate_pagebutton3_label.state}}"' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[3].b[3].txt' | |
payload_template: '"{{states.input_text.haswitchplate_pagebutton3_label.state}}"' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[4].b[3].txt' | |
payload_template: '"{{states.input_text.haswitchplate_pagebutton3_label.state}}"' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[5].b[3].txt' | |
payload_template: '"{{states.input_text.haswitchplate_pagebutton3_label.state}}"' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[6].b[3].txt' | |
payload_template: '"{{states.input_text.haswitchplate_pagebutton3_label.state}}"' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[7].b[3].txt' | |
payload_template: '"{{states.input_text.haswitchplate_pagebutton3_label.state}}"' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[8].b[3].txt' | |
payload_template: '"{{states.input_text.haswitchplate_pagebutton3_label.state}}"' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[9].b[3].txt' | |
payload_template: '"{{states.input_text.haswitchplate_pagebutton3_label.state}}"' | |
############################################################################## | |
# Set page button colors across selected pages to show active page button | |
- alias: HASwitchPlate1_PageButton_Colors | |
trigger: | |
- platform: state | |
entity_id: input_number.haswitchplate_pagebutton1_page | |
- platform: state | |
entity_id: input_number.haswitchplate_pagebutton2_page | |
- platform: state | |
entity_id: input_number.haswitchplate_pagebutton3_page | |
- platform: state | |
entity_id: input_number.haswitchplate_active_page | |
- platform: mqtt | |
topic: 'homeassistant/binary_sensor/HASwitchPlate1/state' | |
payload: 'ON' | |
- platform: homeassistant | |
event: start | |
action: | |
- service: mqtt.publish | |
data_template: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[{{states.input_number.haswitchplate_active_page.state|int}}].b[1].bco' | |
payload_template: >- | |
{% if states.input_number.haswitchplate_active_page.state|int == states.input_number.haswitchplate_pagebutton1_page.state|int -%} | |
65535 | |
{%- else -%} | |
25388 | |
{%- endif %} | |
- service: mqtt.publish | |
data_template: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[{{states.input_number.haswitchplate_active_page.state|int}}].b[1].pco' | |
payload_template: >- | |
{% if states.input_number.haswitchplate_active_page.state|int == states.input_number.haswitchplate_pagebutton1_page.state|int -%} | |
0 | |
{%- else -%} | |
65535 | |
{%- endif %} | |
- service: mqtt.publish | |
data_template: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[{{states.input_number.haswitchplate_active_page.state|int}}].b[2].bco' | |
payload_template: >- | |
{% if states.input_number.haswitchplate_active_page.state|int == states.input_number.haswitchplate_pagebutton2_page.state|int -%} | |
65535 | |
{%- else -%} | |
25388 | |
{%- endif %} | |
- service: mqtt.publish | |
data_template: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[{{states.input_number.haswitchplate_active_page.state|int}}].b[2].pco' | |
payload_template: >- | |
{% if states.input_number.haswitchplate_active_page.state|int == states.input_number.haswitchplate_pagebutton2_page.state|int -%} | |
0 | |
{%- else -%} | |
65535 | |
{%- endif %} | |
- service: mqtt.publish | |
data_template: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[{{states.input_number.haswitchplate_active_page.state|int}}].b[3].bco' | |
payload_template: >- | |
{% if states.input_number.haswitchplate_active_page.state|int == states.input_number.haswitchplate_pagebutton3_page.state|int -%} | |
65535 | |
{%- else -%} | |
25388 | |
{%- endif %} | |
- service: mqtt.publish | |
data_template: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[{{states.input_number.haswitchplate_active_page.state|int}}].b[3].pco' | |
payload_template: >- | |
{% if states.input_number.haswitchplate_active_page.state|int == states.input_number.haswitchplate_pagebutton3_page.state|int -%} | |
0 | |
{%- else -%} | |
65535 | |
{%- endif %} | |
- alias: HASwitchPlate_Clock | |
trigger: | |
platform: time | |
# Matches every minute | |
seconds: 00 | |
condition: | |
- condition: state | |
entity_id: 'binary_sensor.haswitchplate1' | |
state: 'on' | |
action: | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[1].b[4].txt' | |
payload_template: "\"{{now().strftime('%H:%M')}}\"" | |
retain: true | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[1].b[5].txt' | |
payload_template: "\"{{now().strftime('%A')}}\\r{{now().strftime('%B %-d')}}\"" | |
retain: true | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[1].b[6].txt' | |
payload_template: "\"Aussen {{states.sensor.temperature_158d0001217329.state}} C\"" | |
retain: true | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[1].b[7].txt' | |
payload_template: "\" {{states.sensor.pws_weather.state}} \"" | |
retain: true | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[3].b[4].txt' | |
payload_template: "\"AQ {{states.sensor.airquality.state}} PM2.5 \"" | |
retain: true | |
- alias: HASwitchPlate_Clock_Init | |
trigger: | |
- platform: mqtt | |
topic: 'homeassistant/binary_sensor/HASwitchPlate1/state' | |
payload: 'ON' | |
- platform: homeassistant | |
event: start | |
action: | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[1].b[4].font' | |
payload: '3' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[1].b[5].font' | |
payload: '1' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[1].b[6].font' | |
payload: '1' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[1].b[7].font' | |
payload: '1' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[3].b[4].font' | |
payload: '1' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[3].b[5].font' | |
payload: '1' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[3].b[7].font' | |
payload: '1' | |
- alias: buerobw on | |
trigger: | |
- entity_id: binary_sensor.motion_sensor_158d00014dc1db | |
platform: state | |
to: 'on' | |
action: | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[3].b[5].bco' | |
payload: '63488' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[3].b[5].txt' | |
payload_template: "\"Bew. Buero {{states.binary_sensor.motion_sensor_158d00014dc1db.state}}\"" | |
retain: true | |
- alias: buerobw off | |
trigger: | |
- entity_id: binary_sensor.motion_sensor_158d00014dc1db | |
platform: state | |
to: 'off' | |
action: | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[3].b[5].bco' | |
payload: '1024' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[3].b[5].txt' | |
payload_template: "\"Bew. Buero {{states.binary_sensor.motion_sensor_158d00014dc1db.state}}\"" | |
retain: true | |
- alias: aussen on | |
trigger: | |
- entity_id: binary_sensor.motion_sensor_158d000112de28 | |
platform: state | |
to: 'on' | |
action: | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[3].b[7].bco' | |
payload: '63488' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[3].b[7].txt' | |
payload_template: "\"Bew. Aussen {{states.binary_sensor.motion_sensor_158d000112de28.state}}\"" | |
retain: true | |
- alias: aussen off | |
trigger: | |
- entity_id: binary_sensor.motion_sensor_158d000112de28 | |
platform: state | |
to: 'off' | |
action: | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[3].b[7].bco' | |
payload: '1024' | |
- service: mqtt.publish | |
data: | |
topic: 'homeassistant/haswitchplate/HASwitchPlate1/command/p[3].b[7].txt' | |
payload_template: "\"Bew. Aussen {{states.binary_sensor.motion_sensor_158d000112de28.state}}\"" | |
retain: true | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment