Hi everyone,
I am new to home assistant and am still taking my first steps.
I wanted to ask something:
I have a package file e.g. shelly_camera.yaml where I have configured all the shelly parameters.
###SHELLY TEST .10
switch:
- platform: mqtt
name: "Shelly Test ON/OFF"
state_topic: "shellies/shelly1pm-test/relay/0"
command_topic: "shellies/shelly1pm-test/relay/0/command"
availability_topic: "shellies/shelly1pm-test/online"
qos: 2
value_template: "{% if value == 'on' %} on {% else %} off {% endif %}"
payload_on: "on"
payload_off: "off"
payload_available: "true"
payload_not_available: "false"
optimistic: false
retain: false
I would like to create a variable for the id (shelly1pm-test) of the shelly so if I have to modify it I don’t have to change it everywhere.
EDIT:
I have tried like this but dont working:
variables:
nome_shelly: "shelly1pm-test"
...
state_topic: "shellies/{{nome_shelly}}/relay/0"