I noticed very interesting problem and would like to find out why it happens.
I have a RF wall switch I control from HA via OMG v 0.9.1beta.
My automation sends 2 mqtt commands to OMG with a very small interval between them.
- Turn on the switch
home/OpenMQTTGateway/commands/MQTTto433 {"value":12001361}
- Turn off the switch
home/OpenMQTTGateway/commands/MQTTto433 {"value":12001360}
The wall switch turns on and remains on.
In mqtt log I have this
home/OpenMQTTGateway/commands/MQTTto433 {“value”:12001361}
home/OpenMQTTGateway/commands/MQTTto433 {“value”:12001360}
home/OpenMQTTGateway/433toMQTT {“value”:12001361}
home/OpenMQTTGateway/433toMQTT {“value”:12001360}
and in Serial Monitor
Hey I got a callback
11:57:34.324 → MQTTtoRF json
MQTTtoRF OK
11:57:35.193 → Pub json into:
11:57:35.193 → home/OpenMQTTGateway/433toMQTT
11:57:35.193 → {“value”:12001361}
11:57:35.193 → Hey I got a callback
11:57:35.193 → MQTTtoRF json
MQTTtoRF OK
11:57:36.104 → Pub json into:
11:57:36.104 → home/OpenMQTTGateway/433toMQTT
11:57:36.104 → {“value”:12001360}
11:57:36.104 → Hey I got a callback
11:57:36.104 → Store signal
11:57:36.104 → Json buf.
11:57:36.104 → Min ind:
11:57:36.104 → 0
11:57:36.104 → store code :
11:57:36.104 → 12001361/76872
11:57:36.104 → Col: val/timestamp
11:57:36.104 → 0:12001361/76872
11:57:36.104 → 1:13916622/64536
11:57:36.104 → 2:75/74694
11:57:36.104 → 3:75/74710
11:57:36.104 → Data JSON stored
11:57:36.104 → Hey I got a callback
11:57:36.208 → Store signal
11:57:36.208 → Json buf.
11:57:36.208 → Min ind:
11:57:36.208 → 0
11:57:36.208 → store code :
11:57:36.208 → 12001360/76892
11:57:36.208 → Col: val/timestamp
11:57:36.208 → 0:12001360/76892
11:57:36.208 → 1:13916622/64536
11:57:36.208 → 2:75/74694
11:57:36.208 → 3:75/74710
11:57:36.208 → Data JSON stored
I wonder why the switch turns on but then does not turn off?
And what is the right way to get it work properly?
Apparently I have the same problem as this person…
P.S. The only way to get a correct behaviour (i.e the switch is off at the end) is to add small (1-2 seconds) delay between these 2 commands (actually, it’s just adding for: '00:00:01
’ to trigger: platform: state
), in which case I get
in mqtt log
home/OpenMQTTGateway/commands/MQTTto433 {“value”:12001361}
home/OpenMQTTGateway/433toMQTT {“value”:12001361}
home/OpenMQTTGateway/commands/MQTTto433 {“value”:12001360}
home/OpenMQTTGateway/433toMQTT {“value”:12001360}
in Serial Monitor
Hey I got a callback
12:15:09.941 → MQTTtoRF json
MQTTtoRF OK
12:15:10.795 → Pub json into:
12:15:10.795 → home/OpenMQTTGateway/433toMQTT
12:15:10.829 → {“value”:12001361}
12:15:10.829 → Hey I got a callback
12:15:10.829 → Store signal
12:15:10.829 → Json buf.
12:15:10.829 → Min ind:
12:15:10.829 → 0
12:15:10.829 → store code :
12:15:10.829 → 12001361/1125296
12:15:10.829 → Col: val/timestamp
12:15:10.829 → 0:12001361/1125296
12:15:10.829 → 1:13916622/64536
12:15:10.829 → 2:75/74694
12:15:10.829 → 3:75/74710
12:15:10.896 → Data JSON stored
Hey I got a callback
12:15:13.328 → MQTTtoRF json
MQTTtoRF OK
12:15:14.253 → Pub json into:
12:15:14.253 → home/OpenMQTTGateway/433toMQTT
12:15:14.253 → {“value”:12001360}
12:15:14.253 → Hey I got a callback
12:15:14.253 → Store signal
12:15:14.253 → Json buf.
12:15:14.253 → Min ind:
12:15:14.253 → 0
12:15:14.253 → store code :
12:15:14.253 → 12001360/1128692
12:15:14.253 → Col: val/timestamp
12:15:14.253 → 0:12001360/1128692
12:15:14.253 → 1:13916622/64536
12:15:14.253 → 2:75/74694
12:15:14.253 → 3:75/74710
12:15:14.522 → Data JSON stored