Hello
it is probably the easiest. but can not get it … esp8266 switch button with tasmota flashed. how can I get it the esp with a button to turn off another sonoff tasmota ??? Whole just for you
and can I install 2 buttons and run at the same time ??? how would the Yaml.file look like???
Config.yaml file:
- platform: mqtt
name: “Wohnzimmer” <<<<<<<<<<<<<this is the sonoff what I want to control remotely
command_topic: “cmnd/sonoff4/power”
state_topic: “stat/sonoff4/POWER”
qos: 1
payload_on: “ON”
payload_off: “OFF”
retain: true
platform: mqtt
name: “Wohnzimmer-Schalter” <<<<<<<<<<<< this is the ESP8266-01 with button
command_topic: “cmnd/sonoff5/power”
state_topic: “stat/sonoff5/POWER”
qos: 1
payload_on: “ON”
payload_off: “OFF”
retain: true
Hello,
You need to add a few lines to make your switch setup complete:
- platform: mqtt
name: "Wohnzimmer-Schalter" <<<<<<<<<<<< this is the ESP8266-01 with button
command_topic: "cmnd/sonoff5/power"
availability_topic: "tele/sonoff5/LWT" # add this line
state_topic: "stat/sonoff5/POWER"
qos: 1
payload_on: "ON"
payload_off: "OFF"
payload_available: "Online" # add this line
payload_not_available: "Offline" #add this line
retain: true
Make sure that you are using correct " characters! I’m not sure if using “ will work
After restarting Home Assistant you will have at least 2 new entities :
switch.wohnzimmer
switch.wohnzimmer_schalter
You need to create an automation, with switch.wohnzimmer_schalter as “trigger” (auslöser), which calls a service “switch.toggle” on entity “switch.wohnzimmer”
You need to play a bit around so that it fits your needs.
You can have more than 1 trigger per automation. So yes, you can install more then 1 button to control another device.
Thank you for your prompt reply
Part 1 of 1 config.yaml I did quickly
but looks like you have a better version?! My looks like this…
I can not trigger like you maybe another solution for that ??
Thank you. finally finished.
had sonoff<<esp problems because I had to press 2 times on the button until the light went on.
Now I have it on generic and can serve both buttons. just how can I write this now on the yaml.file so that the second button works ??
i would like to 2 or 3 switches on an esp8266-01.
1 is finished Wohnzimmer
Now I try to integrate 2 and 3. how would that look this time ??
how would the Yaml.file look like???
Tasmota is set to generic and swiches (to see on the picture above ;-))
Config.Yaml file
switch:
platform: mqtt
name: “Schlafzimmer” <<<<<< Want this to third switch (switch.3)
command_topic: “cmnd/sonoff/power”
state_topic: “stat/sonoff/POWER”
qos: 1
payload_on: “ON”
payload_off: “OFF”
retain: true
platform: mqtt
name: “Django” <<<<<< Want this to second switch (switch.2)
command_topic: “cmnd/sonoff3/power”
state_topic: “stat/sonoff3/POWER”
qos: 1
payload_on: “ON”
payload_off: “OFF”
retain: true
Home Assistant will create a separate entity for every entry “- platform: mqtt” in the switch: section in configuration.yaml.
So you’ll end up with a few entities like “switch.django” or “switch.schlafzimmer” which you can use as triggers in your automations.
An Automation can have more then 1 trigger, and an entity can be used in more then 1 automation.