Files
zorruno-homeassistant/packages/pool_controls.yaml
2024-05-27 22:20:04 +12:00

41 lines
1.0 KiB
YAML

sensor:
- platform: integration
unique_id: pool_pump_power_total
name: "Pool pump power total"
source: sensor.tasmo_athplug_5853_3_poolpump_energy_power
unit_prefix: k
#round: 2
input_select:
pool_light_colour_select:
icon: mdi:swimming-pool
name: Pool Light Colour
initial: "Off"
options:
- "Off"
- "Dk Blue"
- "Red"
- "Green"
- "Lt Blue"
- "Disco"
- "9"
- "10"
- "11"
- "12"
- "13"
automation:
- id: set_the_pool_light_colour
alias: Set the Pool Light Colour
trigger:
entity_id: input_select.pool_light_colour_select
platform: state
action:
service: mqtt.publish
data:
topic: viewroad-commands/poolcontrols/poollightcolour
payload: '{% set mapping = { "Off":"0", "Dk Blue":"1",
"Red":"2", "Green":"3", "4":"4" ,"Lt Blue":"5", "6":"6", "7":"7", "Disco":"8", "9":"9", "10":"10", "11":"11", "12":"12", "13":"13" } %} {% set dta = trigger.to_state.state %}
{{ mapping[dta] }}
'