Button & MQTT status

525 views
Skip to first unread message

Mist of time

unread,
Jan 16, 2020, 3:20:24 AM1/16/20
to Routix

Hi,

 

I am using MQTT Dash over MQTT broker and data comes from Tasmota

 

If I set an on/off button and there for Topic I add    cmnd/tasmota/LED1    this in MQTT dash works great and LED on ESP could toggle on/off

and in Tasmota log I see this action in a way as:

 

stat/tasmota/RESULT = {"LED1":"ON"}

stat/tasmota/LED1 = ON


or


stat/tasmota/RESULT = {"LED1":"OFF"}

stat/tasmota/LED1 = OFF


 

Still if I change same LED on some other MQTT client led stat changes and I also got that in Tasmota console log however

with this in MQTT dash remain unchanged status of that LED

 

So how to define this button as I could press it will toggle state and if someone from other client change LED state that would be also shown in MQTT dash ?

 

Thank you!

 

 


m_elias

unread,
Jan 16, 2020, 5:05:58 PM1/16/20
to Routix
Use stat/tasmota/LED1 instead of cmnd/tasmota/LED1 to monitor the LED state.

Mist of time

unread,
Jan 17, 2020, 3:29:28 AM1/17/20
to Routix


On Thursday, January 16, 2020 at 11:05:58 PM UTC+1, m_elias wrote:
Use stat/tasmota/LED1 instead of cmnd/tasmota/LED1 to monitor the LED state.

Well ok but that means both can't be used on same button ? :(

So basically I had to add one another text button to see real state of that LED1 output pin 
and even that prevous toggle button shows as LED output is OFF new text button will show real status from device LED output which could be also ON
I just test this and this really works. Still this is a bit weird and confusing.

Button should toggle output and also show this action & also later checking if state of that output was changed by other client and also show that change.

m_elias

unread,
Jan 17, 2020, 3:32:15 AM1/17/20
to Routix
You can use a different subscribe topic than then publish topic.

m_elias

unread,
Jan 17, 2020, 3:33:18 AM1/17/20
to Routix
Publish to cmnd, and subscribe to stat

Łukasz Kaszczyszyn

unread,
Sep 20, 2021, 12:12:24 PM9/20/21
to Routix
Hi,
I have a similar problem with Tasmota switch. When I'm connecting to a broker (entering my dashboard) and the switch is on - the status of the Button is Off.
I've tried publishing to cmnd/mySwitch/POWER and subscribing to stat/mySwitch/RESULT but it doesn't work.

Can anyone give me the correct combination? I will be grateful.
Reply all
Reply to author
Forward
0 new messages