Recently installed HA on a Raspberry Pi.
Now taking little baby steps into automation.
I installed MQTT and I managed to get a Sonoff switch on the Homepage which I can switch off and on.
Nice! But now I want more.
How can I toggle the switch off or on automatic.
Letâs say OFF at 22:00
To my understanding, I have to edit the YAML file
I found a Automation tab in Configuration but I canât get it to work.
So, edit the YAML file.
I came up with this:
switch SonoffBasic1:
- platform: mqtt
name: "Sonoff Switch01"
icon: mdi:power-plug
state_topic: "stat/NiRiSonoffBasic1/POWER"
command_topic: "cmnd/NiRiSonoffBasic1/POWER"
availability_topic: "tele/NiRiSonoffBasic1/LWT"
qos: 1
payload_on: "ON"
payload_off: "OFF"
payload_available: "Online"
payload_not_available: "Offline"
retain: true
automation:
-alias: Switch off
trigger:
- at: '22:00:00'
platform: time
entity_id: switch.sonoff_switch01
action:
service: switch.turn_off
entity_id: switch.sonoff_switch01
But (ofcourse) it is not working, otherwise I wouldnât be here
Can somebody push me in the right direction?