# First automation: set Home Assistant sensor value from MQTT messages, so we
# update if someone changes the values on web interface
- id: '1565774399160'
alias: WLANThermo update channels min/max from MQTT
trigger:
- entity_id: sensor.wlanthermo
platform: state
condition: []
action:
- data_template:
entity_id: input_number.wlanthermo_channel_1_min
value: '{{ state_attr(''sensor.wlanthermo'', ''channel'').0.min }}'
service: input_number.set_value
- data_template:
entity_id: input_number.wlanthermo_channel_1_max
value: '{{ state_attr(''sensor.wlanthermo'', ''channel'').0.max }}'
service: input_number.set_value
- data_template:
entity_id: input_number.wlanthermo_channel_2_min
value: '{{ state_attr(''sensor.wlanthermo'', ''channel'').1.min }}'
service: input_number.set_value
- data_template:
entity_id: input_number.wlanthermo_channel_2_max
value: '{{ state_attr(''sensor.wlanthermo'', ''channel'').1.max }}'
service: input_number.set_value
- data_template:
entity_id: input_number.wlanthermo_channel_3_min
value: '{{ state_attr(''sensor.wlanthermo'', ''channel'').2.min }}'
service: input_number.set_value
- data_template:
entity_id: input_number.wlanthermo_channel_3_max
value: '{{ state_attr(''sensor.wlanthermo'', ''channel'').2.max }}'
service: input_number.set_value
- data_template:
entity_id: input_number.wlanthermo_channel_4_min
value: '{{ state_attr(''sensor.wlanthermo'', ''channel'').3.min }}'
service: input_number.set_value
- data_template:
entity_id: input_number.wlanthermo_channel_4_max
value: '{{ state_attr(''sensor.wlanthermo'', ''channel'').3.max }}'
service: input_number.set_value
- data_template:
entity_id: input_number.wlanthermo_channel_5_min
value: '{{ state_attr(''sensor.wlanthermo'', ''channel'').4.min }}'
service: input_number.set_value
- data_template:
entity_id: input_number.wlanthermo_channel_5_max
value: '{{ state_attr(''sensor.wlanthermo'', ''channel'').4.max }}'
service: input_number.set_value
- data_template:
entity_id: input_number.wlanthermo_channel_6_min
value: '{{ state_attr(''sensor.wlanthermo'', ''channel'').5.min }}'
service: input_number.set_value
- data_template:
entity_id: input_number.wlanthermo_channel_6_max
value: '{{ state_attr(''sensor.wlanthermo'', ''channel'').5.max }}'
service: input_number.set_value
- data_template:
entity_id: input_number.wlanthermo_pitmaster_temp
value: '{{ state_attr(''sensor.wlanthermo'', ''pitmaster'').pm.0.set }}'
service: input_number.set_value
- data_template:
entity_id: input_select.wlanthermo_pitmaster_mode
option: '{{ state_attr(''sensor.wlanthermo'', ''pitmaster'').pm.0.typ | replace(''off'',''Aus'') | replace(''auto'',''Automatisch'') }}'
service: input_select.select_option
- data_template:
entity_id: input_select.wlanthermo_pitmaster_channel
option: '{{ state_attr(''sensor.wlanthermo'', ''pitmaster'').pm.0.channel }}'
service: input_select.select_option
- data_template:
entity_id: input_select.wlanthermo_channel_1_alarm
option: '{{ state_attr(''sensor.wlanthermo'', ''channel'').0.alarm | replace(''0'',''Aus'') | replace(''1'',''An'') }}'
service: input_select.select_option
- data_template:
entity_id: input_select.wlanthermo_channel_2_alarm
option: '{{ state_attr(''sensor.wlanthermo'', ''channel'').1.alarm | replace(''0'',''Aus'') | replace(''1'',''An'') }}'
service: input_select.select_option
- data_template:
entity_id: input_select.wlanthermo_channel_3_alarm
option: '{{ state_attr(''sensor.wlanthermo'', ''channel'').2.alarm | replace(''0'',''Aus'') | replace(''1'',''An'') }}'
service: input_select.select_option
- data_template:
entity_id: input_select.wlanthermo_channel_4_alarm
option: '{{ state_attr(''sensor.wlanthermo'', ''channel'').3.alarm | replace(''0'',''Aus'') | replace(''1'',''An'') }}'
service: input_select.select_option
- data_template:
entity_id: input_select.wlanthermo_channel_5_alarm
option: '{{ state_attr(''sensor.wlanthermo'', ''channel'').4.alarm | replace(''0'',''Aus'') | replace(''1'',''An'') }}'
service: input_select.select_option
- data_template:
entity_id: input_select.wlanthermo_channel_6_alarm
option: '{{ state_attr(''sensor.wlanthermo'', ''channel'').5.alarm | replace(''0'',''Aus'') | replace(''1'',''An'') }}'
service: input_select.select_option
- id: '1565867288673'
alias: WLANThermo set channel 1 min
trigger:
- entity_id: input_number.wlanthermo_channel_1_min
platform: state
condition: []
action:
- service: mqtt.publish
data_template:
topic: WLanThermo/WlanThermo/set/channels
retain: true
payload: '{{ ''{"number":1,"min":''+states(''input_number.wlanthermo_channel_1_min'')+''}''
}}'
- id: '1565867288674'
alias: WLANThermo set channel 1 max
trigger:
- entity_id: input_number.wlanthermo_channel_1_max
platform: state
condition: []
action:
- service: mqtt.publish
data_template:
topic: WLanThermo/WlanThermo/set/channels
retain: true
payload: '{{ ''{"number":1,"max":''+states(''input_number.wlanthermo_channel_1_max'')+''}''
}}'
- id: '1565867288675'
alias: WLANThermo set channel 2 min
trigger:
- entity_id: input_number.wlanthermo_channel_2_min
platform: state
condition: []
action:
- service: mqtt.publish
data_template:
topic: WLanThermo/WlanThermo/set/channels
retain: true
payload: '{{ ''{"number":2,"min":''+states(''input_number.wlanthermo_channel_2_min'')+''}''
}}'
- id: '1565867288676'
alias: WLANThermo set channel 2 max
trigger:
- entity_id: input_number.wlanthermo_channel_2_max
platform: state
condition: []
action:
- service: mqtt.publish
data_template:
topic: WLanThermo/WlanThermo/set/channels
retain: true
payload: '{{ ''{"number":2,"max":''+states(''input_number.wlanthermo_channel_2_max'')+''}''
}}'
- id: '1565867288677'
alias: WLANThermo set channel 3 min
trigger:
- entity_id: input_number.wlanthermo_channel_3_min
platform: state
condition: []
action:
- service: mqtt.publish
data_template:
topic: WLanThermo/WlanThermo/set/channels
retain: true
payload: '{{ ''{"number":3,"min":''+states(''input_number.wlanthermo_channel_3_min'')+''}''
}}'
- id: '1565867288678'
alias: WLANThermo set channel 3 max
trigger:
- entity_id: input_number.wlanthermo_channel_3_max
platform: state
condition: []
action:
- service: mqtt.publish
data_template:
topic: WLanThermo/WlanThermo/set/channels
retain: true
payload: '{{ ''{"number":3,"max":''+states(''input_number.wlanthermo_channel_3_max'')+''}''
}}'
- id: '1565867288679'
alias: WLANThermo set channel 4 min
trigger:
- entity_id: input_number.wlanthermo_channel_4_min
platform: state
condition: []
action:
- service: mqtt.publish
data_template:
topic: WLanThermo/WlanThermo/set/channels
retain: true
payload: '{{ ''{"number":4,"min":''+states(''input_number.wlanthermo_channel_4_min'')+''}''
}}'
- id: '1565867288680'
alias: WLANThermo set channel 4 max
trigger:
- entity_id: input_number.wlanthermo_channel_4_max
platform: state
condition: []
action:
- service: mqtt.publish
data_template:
topic: WLanThermo/WlanThermo/set/channels
retain: true
payload: '{{ ''{"number":4,"max":''+states(''input_number.wlanthermo_channel_4_max'')+''}''
}}'
- id: '1565867288681'
alias: WLANThermo set channel 5 min
trigger:
- entity_id: input_number.wlanthermo_channel_5_min
platform: state
condition: []
action:
- service: mqtt.publish
data_template:
topic: WLanThermo/WlanThermo/set/channels
retain: true
payload: '{{ ''{"number":5,"min":''+states(''input_number.wlanthermo_channel_5_min'')+''}''
}}'
- id: '1565867288682'
alias: WLANThermo set channel 5 max
trigger:
- entity_id: input_number.wlanthermo_channel_5_max
platform: state
condition: []
action:
- service: mqtt.publish
data_template:
topic: WLanThermo/WlanThermo/set/channels
retain: true
payload: '{{ ''{"number":5,"max":''+states(''input_number.wlanthermo_channel_5_max'')+''}''
}}'
- id: '1565867288683'
alias: WLANThermo set channel 6 min
trigger:
- entity_id: input_number.wlanthermo_channel_6_min
platform: state
condition: []
action:
- service: mqtt.publish
data_template:
topic: WLanThermo/WlanThermo/set/channels
retain: true
payload: '{{ ''{"number":6,"min":''+states(''input_number.wlanthermo_channel_6_min'')+''}''
}}'
- id: '1565867288684'
alias: WLANThermo set channel 6 max
trigger:
- entity_id: input_number.wlanthermo_channel_6_max
platform: state
condition: []
action:
- service: mqtt.publish
data_template:
topic: WLanThermo/WlanThermo/set/channels
retain: true
payload: '{{ ''{"number":6,"max":''+states(''input_number.wlanthermo_channel_6_max'')+''}''
}}'
- id: '1565867288685'
alias: WLANThermo set pitmaster temp
trigger:
- entity_id: input_number.wlanthermo_pitmaster_temp
platform: state
condition: []
action:
- service: mqtt.publish
data_template:
topic: WLanThermo/WlanThermo/set/pitmaster
retain: true
payload: '{{ ''[{"id":0,"channel":''+states(''input_select.wlanthermo_pitmaster_channel'')+'',"pid":2,"value":0,"set":''+states(''input_number.wlanthermo_pitmaster_temp'')+'',"typ":''+states(''input_select.wlanthermo_pitmaster_mode'') | replace(''Aus'',''off'') | replace(''Automatisch'',''auto'')+''}]''}}'
- id: '1565867288686'
alias: WLANThermo set pitmaster channel
trigger:
- entity_id: input_select.wlanthermo_pitmaster_channel
platform: state
condition: []
action:
- service: mqtt.publish
data_template:
topic: WLanThermo/WlanThermo/set/pitmaster
retain: true
payload: '{{ ''[{"id":0,"channel":''+states(''input_select.wlanthermo_pitmaster_channel'')+'',"pid":2,"value":0,"set":''+states(''input_number.wlanthermo_pitmaster_temp'')+'',"typ":''+states(''input_select.wlanthermo_pitmaster_mode'') | replace(''Aus'',''off'') | replace(''Automatisch'',''auto'')+''}]''}}'
- id: '1565867288687'
alias: WLANThermo set pitmaster mode
trigger:
- entity_id: input_select.wlanthermo_pitmaster_mode
platform: state
condition: []
action:
- service: mqtt.publish
data_template:
topic: WLanThermo/WlanThermo/set/pitmaster
retain: true
payload: '{{ ''[{"id":0,"channel":''+states(''input_select.wlanthermo_pitmaster_channel'')+'',"pid":2,"value":0,"set":''+states(''input_number.wlanthermo_pitmaster_temp'')+'',"typ":''+states(''input_select.wlanthermo_pitmaster_mode'') | replace(''Aus'',''off'') | replace(''Automatisch'',''auto'')+''}]''}}'
- id: '1565867288688'
alias: WLANThermo set channel 1 alarm
trigger:
- entity_id: input_select.wlanthermo_channel_1_alarm
platform: state
condition: []
action:
- service: mqtt.publish
data_template:
topic: WLanThermo/WlanThermo/set/channels
retain: true
payload: '{{ ''{"number":1,"alarm":''+states(''input_select.wlanthermo_channel_1_alarm'') | replace(''Aus'',''0'') | replace(''An'',''1'')+''}''}}'
- id: '1565867288689'
alias: WLANThermo set channel 2 alarm
trigger:
- entity_id: input_select.wlanthermo_channel_2_alarm
platform: state
condition: []
action:
- service: mqtt.publish
data_template:
topic: WLanThermo/WlanThermo/set/channels
retain: true
payload: '{{ ''{"number":2,"alarm":''+states(''input_select.wlanthermo_channel_2_alarm'') | replace(''Aus'',''0'') | replace(''An'',''1'')+''}''}}'
- id: '1565867288690'
alias: WLANThermo set channel 3 alarm
trigger:
- entity_id: input_select.wlanthermo_channel_3_alarm
platform: state
condition: []
action:
- service: mqtt.publish
data_template:
topic: WLanThermo/WlanThermo/set/channels
retain: true
payload: '{{ ''{"number":3,"alarm":''+states(''input_select.wlanthermo_channel_3_alarm'') | replace(''Aus'',''0'') | replace(''An'',''1'')+''}''}}'
- id: '1565867288691'
alias: WLANThermo set channel 4 alarm
trigger:
- entity_id: input_select.wlanthermo_channel_4_alarm
platform: state
condition: []
action:
- service: mqtt.publish
data_template:
topic: WLanThermo/WlanThermo/set/channels
retain: true
payload: '{{ ''{"number":4,"alarm":''+states(''input_select.wlanthermo_channel_4_alarm'') | replace(''Aus'',''0'') | replace(''An'',''1'')+''}''}}'
- id: '1565867288692'
alias: WLANThermo set channel 5 alarm
trigger:
- entity_id: input_select.wlanthermo_channel_5_alarm
platform: state
condition: []
action:
- service: mqtt.publish
data_template:
topic: WLanThermo/WlanThermo/set/channels
retain: true
payload: '{{ ''{"number":5,"alarm":''+states(''input_select.wlanthermo_channel_5_alarm'') | replace(''Aus'',''0'') | replace(''An'',''1'')+''}''}}'
- id: '1565867288693'
alias: WLANThermo set channel 6 alarm
trigger:
- entity_id: input_select.wlanthermo_channel_6_alarm
platform: state
condition: []
action:
- service: mqtt.publish
data_template:
topic: WLanThermo/WlanThermo/set/channels
retain: true
payload: '{{ ''{"number":6,"alarm":''+states(''input_select.wlanthermo_channel_6_alarm'') | replace(''Aus'',''0'') | replace(''An'',''1'')+''}''}}'