letscontrolit / ESPEasy

Easy MultiSensor device based on ESP8266/ESP32
http://www.espeasy.com
Other
3.25k stars 2.2k forks source link

Publish command in rules not work as expected with Serial Server (Ser2Net) plugin #514

Closed agsochi closed 6 years ago

agsochi commented 6 years ago

Hi! I use Serial Server (Ser2Net) plugin. esp Serial Server works - i see messages from serial port:

1389045 : EVENT: !RFLink#
1389052 : ACT : publish /test,
1389383 : EVENT: !RFLink#eeloq;ID=9ac2;SWITCH=01;CMD=ON;BAT=OK;
1389389 : ACT : publish /test,
1403244 : EVENT: !RFLink#Keeloq;ID=9ac2;SWITCH=02;CMD=ON;BAT=OK;
1403250 : ACT : publish /test,
1403909 : EVENT: !RFLink#
1403915 : ACT : publish /test,
1404207 : EVENT: !RFLink#eeloq;ID=9ac2;SWITCH=08;CMD=ON;BAT=OK;
1404213 : ACT : publish /test,

My rules (if i use 'on rflink do' - rule do not work):

on [rflink] do
publish /test,[rflink]
endon

In MQTT i see only:

/test (null)
/test (null)
/test (null)
/test (null)

If i use 'publish /test,test' - i see /test test - publish command works. Issue - no rflink value published.

Sorry for question, i didn't know where i can get help - How to send command back to 'Serial Server' from 'Rules'?

papperone commented 6 years ago

first of all this is a message more for the forum than for the GITHub as there's yet no evidence this is a bug, then I believe you are not using the correct syntax as square bracket shouldn't be used in the ON command as far as I remember....

agsochi commented 6 years ago

I try all cases with square bracket and without it. Without square bracket - no event at all.

Grovkillen commented 6 years ago

Shouldn't the rule be:

on rflink# do
publish /test,[rflink#]
endon
agsochi commented 6 years ago

on rflink# do publish /test,[rflink#] endon

No, this rule do not work too.

papperone commented 6 years ago

I think your event name includes the esclamation mark "!" as in all my events that's not there (maybe a "feature" of this plugin); as well some events looks like weird ending with a pound "#" without the second argument... I am convinced your issue is specific to the events generated by this plugin, have you tried to open this thread in the forum? GitHub shoudl be only for known bugs in the code, while this looks like more help to make it work!

psy0rz commented 6 years ago

please re-open if someone is sure this is a bug. thanks :)

agsochi commented 6 years ago

I try forum - but still no info how to pulish to mqtt.