Hi all,
I’m trying to build a MQTT-publishing array of buttons using an ESP8266 NodeMCU running Tasmota. I have four physical buttons wired, and configured as Switches, and they all publish a MQTT “stat/”. However, I can’t figure out how to make them publish a command that identifies which button was pressed. Not sure if rules will help. Anyone done anything like this?
vzorglub
(Vincent Regaud)
February 18, 2019, 7:29am
2
What do they each publish?
They all publish the same commands:
13:27:26 MQT: cmnd/tasmota/test/POWER = ON
13:27:26 MQT: stat/tasmota/test/RESULT = {"Command":"Unknown"}
13:27:35 MQT: cmnd/tasmota/test/POWER = ON
13:27:35 MQT: stat/tasmota/test/RESULT = {"Command":"Unknown"}
13:27:44 MQT: cmnd/tasmota/test/POWER = ON
13:27:44 MQT: stat/tasmota/test/RESULT = {"Command":"Unknown"}
13:27:45 MQT: cmnd/tasmota/test/POWER = ON
13:27:45 MQT: stat/tasmota/test/RESULT = {"Command":"Unknown"}
13:27:47 MQT: cmnd/tasmota/test/POWER = ON
13:27:47 MQT: stat/tasmota/test/RESULT = {"Command":"Unknown"}
I think the way to do it is connect switches to non-existent relays but that seems so ungraceful. I’ll give it a shot later today.
vzorglub
(Vincent Regaud)
February 19, 2019, 9:35am
4
You need to read in depth the tasmota command wiki.
It should be possible to get each switch to send a different message
vzorglub
(Vincent Regaud)
February 19, 2019, 9:37am
5
13:27:26 MQT: cmnd/tasmota/test/POWER = ON
13:27:26 MQT: stat/tasmota/test/RESULT = {"Command":"Unknown"}
This means that you ESP doesn’t recognise the POWER ON command
Each switch should be accessible under a different command, for example:
cmnd/tasmota/test/POWER1 ON
cmnd/tasmota/test/POWER2 ON
cmnd/tasmota/test/POWER3 ON
But that will depend on your tasmotta setup
mpampinos
(charalampos varytimos)
February 19, 2019, 10:18am
6
you must also pass virtual relay
Switch1 --Relay1 = cmnd/tasmota/test/POWER1 =
Switch2 --Relay2 = cmnd/tasmota/test/POWER2
Switch3 --Relay3 = cmnd/tasmota/test/POWER3 …
Thanks guys. Seems like having the virtual relay is the only way to do it. Seems a little kludgy, but, hey… isn’t much of this stuff?