Hi all!
I would ask you for some help with automation. I’m quite new to HA and not a programmer of any kind. I managed to get automation working based on input select for operating mode for my heating.
I would like to configure automation and input select in my native language, so instead of this:
input_select:
central_heating_operation_mode_4:
name: Operating Mode HC OK4
options:
- "auto"
- "off"
- "on"
- "low"
I would like to use this:
input_select:
central_heating_operation_mode_4:
name: Operating Mode HC OK4
options:
- "Auto"
- "Izključeno"
- "Vključeno"
- "Znižano"
For achieveing this I have to change (and use a template) this automation:
- id: ebusd2
alias: Nastavi ogrevanje OK4
initial_state: true
trigger:
- platform: state
entity_id: input_select.central_heating_operation_mode_4
action:
service: mqtt.publish
data:
topic: ebusd/mc.4/OperatingMode/set
# retain: true
payload: "{{ states.input_select.central_heating_operation_mode_4.state }}"
I’m struggling with this automation, but it’s not working:
- id: ebusd2
alias: Nastavi ogrevanje OK4
initial_state: true
trigger:
- platform: state
entity_id: input_select.central_heating_operation_mode_4
action:
- service: automation.turn_off
entity_id: automation.get_central_heating_operation_mode_4
- service: mqtt.publish
data:
topic: ebusd/mc.4/OperatingMode/set
payload:
"{% set opmode = {'Auto': 'auto', 'Vključeno': 'on', 'Izključeno':
'off', 'low': 'Znižano', } %} {{ opmode.get('trigger.payload','auto') }}"
- delay: 00:00:05
- service: automation.turn_on
entity_id: automation.get_central_heating_operation_mode_4
It’s not working…anyone have any clues what is wrong or how to properly use templates. I have been studying also the example in HA docs, but couldn’t get it working.
Thank you for your help in advance!