Im trying to add a new automation consisting of a toggle for an mqtt command. I need to set the toggle to send ‘1’ or ‘0’ depending the position of the switch.
I realized I have a bit of a mess of my toggles, most likely redundant. This is what my dashboard looks like:
I sorta understand that things can be done via the configuration.yaml, which was how I set up my kompressor and solenoid toggle switches. But when I was setting those up I think I created the booleans by mistake (on the left). Here is my configuration.yaml:
# Example configuration.yaml entry
input_boolean:
notify_home:
name: Publish MQTT msg
icon: mdi:car
power_kompressor:
name: Kompressor
icon: mdi:car
power_solenoid:
name: Solenoid
icon: mdi:car
# MQTT Switches RPi2 - RPi3
switch:
- platform: mqtt
name: kompressor
command_topic: "test_channel"
payload_on: "komp-on"
payload_off: "komp-off"
- platform: mqtt
name: solenoid
command_topic: "test_channel"
payload_on: "sole-on"
payload_off: "sole-off"
Honestly I think the booleans I created by mistake and are not needed. I just use the toggle switches to controle my kompressor and solenoid.
Then they came up with automations.yaml which I believe moved some code automatically into that file because I know I didnt set those up manually in code as I did with the configuration.yaml.
If im not mistaken, the other way to create automations is through the configuration menu option, thru the UI. But I get errors when trying to create it:
What I want is to add my new automation the proper way (automation.yaml or UI) and tidy up whatever else I should in the case of something being redundant. The UI option confuses me because I think I need to create the device first and then the toggle and finally the automation:
Help.