70 lines
1.8 KiB
YAML
70 lines
1.8 KiB
YAML
input_select:
|
|
master_bedroom_fan_set:
|
|
name: Master Bedroom Fan Speed
|
|
initial: "Off"
|
|
options:
|
|
- "Off"
|
|
- "Low"
|
|
- "Medium"
|
|
- "High"
|
|
bedroom_2_fan_set:
|
|
name: Bedroom 2 Fan Speed
|
|
initial: "Off"
|
|
options:
|
|
- "Off"
|
|
- "Low"
|
|
- "Medium"
|
|
- "High"
|
|
bedroom_3_fan_set:
|
|
name: Bedroom 3 Fan Speed
|
|
initial: "Off"
|
|
options:
|
|
- "Off"
|
|
- "Low"
|
|
- "Medium"
|
|
- "High"
|
|
|
|
automation:
|
|
- id: set_the_master_bedroom_fan
|
|
initial_state: true
|
|
alias: Set the Master Bedroom Fan
|
|
trigger:
|
|
entity_id: input_select.master_bedroom_fan_set
|
|
platform: state
|
|
action:
|
|
service: mqtt.publish
|
|
data:
|
|
topic: cmnd/tasmo-ifan02-3793-bedrm1-1/FanSpeed
|
|
payload: '{% set mapping = { "Off":"0", "Low":"1",
|
|
"Medium":"2", "High":"3" } %} {% set dta = trigger.to_state.state %}
|
|
{{ mapping[dta] }}
|
|
'
|
|
- id: set_bedroom_2_fan
|
|
initial_state: true
|
|
alias: Set Bedroom 2 Fan Speed
|
|
trigger:
|
|
entity_id: input_select.bedroom_2_fan_set
|
|
platform: state
|
|
action:
|
|
service: mqtt.publish
|
|
data:
|
|
topic: cmnd/tasmo-ifan02-7042-bedrm2/FanSpeed
|
|
payload: '{% set mapping = { "Off":"0", "Low":"1",
|
|
"Medium":"2", "High":"3" } %} {% set dta = trigger.to_state.state %}
|
|
{{ mapping[dta] }}
|
|
'
|
|
- id: set_bedroom_3_fan
|
|
initial_state: true
|
|
alias: Set Bedroom 3 Fan Speed
|
|
trigger:
|
|
entity_id: input_select.bedroom_3_fan_set
|
|
platform: state
|
|
action:
|
|
service: mqtt.publish
|
|
data:
|
|
topic: cmnd/tasmo-ifan02-3497-bedrm3/FanSpeed
|
|
payload: '{% set mapping = { "Off":"0", "Low":"1",
|
|
"Medium":"2", "High":"3" } %} {% set dta = trigger.to_state.state %}
|
|
{{ mapping[dta] }}
|
|
'
|