Hello, I am getting strange values being sent from this controller sketch from @gadu (many thanks again) and this node sketch from @pgo
It almost works.. i am going via mosquitto install on the same raspberry as openhab, and it does turn on and off the relay while sending temp values from the same node. The problem i am having is that it is not reliable, it doesn't always turn on and off, and i have found that the following is being sent from the mqtt gateway sketch:
0;0;3;0;9;send: 0-0-21-21 s=0,c=1,t=0,pt=0,l=5,st=ok:19.7r
0;0;3;0;9;read: 21-21-0 s=1,c=1,t=0,pt=7,l=5:5.4
publish: MyMQTT/21/1/V_TEMP 5.4
0;0;3;0;9;send: 0-0-21-21 s=1,c=1,t=0,pt=0,l=5,st=fail:5.47r
0;0;3;0;9;send: 0-0-24-24 s=2,c=1,t=2,pt=0,l=4,st=ok:147r
0;0;3;0;9;send: 0-0-24-24 s=2,c=1,t=2,pt=0,l=4,st=ok:047r
0;0;3;0;9;send: 0-0-24-24 s=2,c=1,t=2,pt=0,l=4,st=ok:147r
0;0;3;0;9;send: 0-0-24-24 s=2,c=1,t=2,pt=0,l=4,st=ok:047r
0;0;3;0;9;send: 0-0-24-24 s=2,c=1,t=2,pt=0,l=4,st=ok:147r
0;0;3;0;9;send: 0-0-24-24 s=2,c=1,t=2,pt=0,l=4,st=ok:047r
0;0;3;0;9;send: 0-0-24-24 s=2,c=1,t=2,pt=0,l=4,st=ok:147r
0;0;3;0;9;send: 0-0-24-24 s=2,c=1,t=2,pt=0,l=4,st=ok:047r
0;0;3;0;9;send: 0-0-24-24 s=2,c=1,t=2,pt=0,l=4,st=ok:147r
0;0;3;0;9;send: 0-0-24-24 s=2,c=1,t=2,pt=0,l=4,st=ok:047r
0;0;3;0;9;send: 0-0-24-24 s=2,c=1,t=2,pt=0,l=4,st=ok:147r
0;0;3;0;9;send: 0-0-24-24 s=2,c=1,t=2,pt=0,l=4,st=ok:047r
0;0;3;0;9;send: 0-0-24-24 s=2,c=1,t=2,pt=0,l=4,st=ok:147r
0;0;3;0;9;send: 0-0-24-24 s=2,c=1,t=2,pt=0,l=4,st=ok:047r
0;0;3;0;9;send: 0-0-24-24 s=2,c=1,t=2,pt=0,l=4,st=ok:147r
0;0;3;0;9;send: 0-0-24-24 s=2,c=1,t=2,pt=0,l=4,st=ok:047r
0;0;3;0;9;read: 21-21-0 s=0,c=1,t=0,pt=7,l=5:19.8
publish: MyMQTT/21/0/V_TEMP 19.8
0;0;3;0;9;send: 0-0-21-21 s=0,c=1,t=0,pt=0,l=5,st=ok:19.8r
0;0;3;0;9;send: 0-0-24-24 s=2,c=1,t=2,pt=0,l=4,st=ok:1.8r
0;0;3;0;9;send: 0-0-24-24 s=2,c=1,t=2,pt=0,l=4,st=ok:0.8r
0;0;3;0;9;read: 21-21-0 s=1,c=1,t=0,pt=7,l=5:5.6
publish: MyMQTT/21/1/V_TEMP 5.6
0;0;3;0;9;send: 0-0-21-21 s=1,c=1,t=0,pt=0,l=5,st=fail:5.68r
0;0;3;0;9;read: 21-21-0 s=1,c=1,t=0,pt=7,l=5:5.5
so.. node 21 is just sending temp values, node 24 is the mixed temp/relay..
As you may notice the 1 and zero code for the relay is getting mixed with the last received temp values, which seems to be ok if the last temp read is more than 10degrees resulting in a 1.xx value sent or a 0.xx value sent, which is accepted as a 1 or 0, but when it receives a value below 10 then it converts it to something like 047 or 147 which doesn't trigger the relay correctly! Please any help or guidance to understand where the 1 or 0 message is coming from?
I imagine its what is being sent from the gateway sketch that is mixing the payload, but i cannot see how to reformulate what is sent to send only a 1 or 0 when sending to the relay...... ??
MyMQTT/24/0/V_TEMP 23.9
MyMQTT/21/1/V_TEMP 5.1
MyMQTT/24/2/V_LIGHT 1
MyMQTT/24/2/V_LIGHT 0
MyMQTT/24/2/V_LIGHT 1
=Sample of mqtt messages showing 24 node with v_temp and V_light on node 24 and v_temp on node 21