Hi, I'm using from many time MQTT import to get value from home assitant pushbutton: when the button goes to 1, rules in espeasy call a command PULSE,19,0,500 to command a relay
It was all working good
Then I upgrade to latest espeasy and now when button goes to 1, ESPEASY send two times the PULSE command.
here the RULES:
on LuciP9_a#luce_R=1.00 do
Pulse,5,0,500
endon
and here the LOG:
228203709: IMPT : [LuciP9_a#luce_R] : 1.00
228203710: EVENT: LuciP9_a#luce_R=1
228203725: ACT : Pulse,5,0,500
228204229: GPIO : port 5. Pulse set for 500 ms
228204237: EVENT: LuciP9_a#luce_R=1.00
228204246: ACT : Pulse,5,0,500
228204748: GPIO : port 5. Pulse set for 500 ms
Believe me: with older espeasy it works good
Thank you
MQTT import - problem
Moderators: grovkillen, Stuntteam, TD-er
Re: MQTT import - problem
It does seem to receive the event twice.
What I find a bit strange is that you try to match the rule with a floating point value (1.00) instead of an integer value (1)
So maybe the older ESPEasy build didn't match the 1.00 due to a rounding error?
Which version was the older build?
Can you use some tool like MQTT Explorer and let it subscribe to this same topic to see if you do see multiple messages.
I think it is only one, as I only see one "IMPT" message in your logs.
But then I wonder why there are multiple events with different eventvalues.
Do you have multiple MQTT import tasks active? Is it possible multiple tasks can subscribe to the same topic?
Oh and just as a tip, using longpulse (or longpulse_ms) will return immediately and thus not block any code execution on the ESP.
See: https://espeasy.readthedocs.io/en/lates ... ernal-gpio
N.B. In this use case, if you use longpulse (or the msec variant), it may hide this issue/bug, so it may no longer show this behavior.
What I find a bit strange is that you try to match the rule with a floating point value (1.00) instead of an integer value (1)
So maybe the older ESPEasy build didn't match the 1.00 due to a rounding error?
Which version was the older build?
Can you use some tool like MQTT Explorer and let it subscribe to this same topic to see if you do see multiple messages.
I think it is only one, as I only see one "IMPT" message in your logs.
But then I wonder why there are multiple events with different eventvalues.
Do you have multiple MQTT import tasks active? Is it possible multiple tasks can subscribe to the same topic?
Oh and just as a tip, using longpulse (or longpulse_ms) will return immediately and thus not block any code execution on the ESP.
See: https://espeasy.readthedocs.io/en/lates ... ernal-gpio
N.B. In this use case, if you use longpulse (or the msec variant), it may hide this issue/bug, so it may no longer show this behavior.
Re: MQTT import - problem
I think the "Generate events for accepted topics" has to be turned off, because it will now generate duplicate events. first with the incoming "1", and later with "1.00" for the Values event, as that has 2 decimals configured by default.
/Ton (PayPal.me)
Re: MQTT import - problem
thank you ATH, but
432333775: IMPT : [LuciP9_a#luce_L] : 1.00
without any effect on the rules
give back thisI think the "Generate events for accepted topics" has to be turned off, because it will now generate duplicate events. first with the incoming "1", and later with "1.00" for the Values event, as that has 2 decimals configured by default.
432333775: IMPT : [LuciP9_a#luce_L] : 1.00
without any effect on the rules
Code: Select all
on LuciP9_a#luce_L=1.00 do
Pulse,16,0,500
endon
Re: MQTT import - problem
now with the trick fron TD-er it works:
but I think sure it receive the event twice, without any reason....433073782: IMPT : [LuciP9_a#luce_L] : 1.00
433073784: EVENT: LuciP9_a#luce_L=1
433073799: ACT : longpulse_ms,16,0,500
433073802: TIMER: disable timer
433073803: GPIO : port 16. Pulse H:500 ms
433073812: EVENT: LuciP9_a#luce_L=1.00
433073819: ACT : longpulse_ms,16,0,500
433073822: TIMER: disable timer
433073822: GPIO : port 16. Pulse H:500 ms
Who is online
Users browsing this forum: No registered users and 9 guests