Correct Message for MQTTtoPilight?


#1

Hi everyone,

I’m struggeling with the correct MQTT message to switch on or off an elro switch.

If I press the remote I get the following message on my MQTT server:

home/OpenMQTTGatewayESP32/PilighttoMQTT {"message":"{\"systemcode\":18,\"unitcode\":2,\"state\":\"on\"}","protocol":"elro_800_switch","length":"","repeats":102,"status":2}

Now I’m tring to send the following message:

mosquitto_pub -h [mqtt-server-ip] -p 1883 -t home/OpenMQTTGatewayESP32/commands/MQTTtoPilight -m '{"message":"{\"systemcode\":18,\"unitcode\":2,\"state\":\"on\"}","protocol":"elro_800_switch","length":"","repeats":102,"status":2}'

But in the serial monitor I only get this:

Hey I got a callback 
MQTTtoPilight json data analysis
MQTTtoPilight msg & protocol ok
pilight(3): elro_800_switch: insufficient number of arguments
MQTTtoPilight raw KO
ESPiLight Error: 
invalid pulse train message

Which is the right syntax for the MQTT-Message?

My setup:
ESP32 + RXB6 + KXD10036
OpenMQTTGateway v0.9beta (BT & Pilight activated)
Home Automation: Pimatic on Ubuntu VM


#2

Hello,

Thanks to put your hands on the new pilight gateway !
Maybe @steadramon could help you with your error ?


#3

I tried it with the hint from puuu on Github PR and changed the MQTT-Message to this:

mosquitto_pub -h [mqtt-server-ip] -p 1883 -t home/OpenMQTTGatewayESP32/commands/MQTTtoPilight -m ''{"message":"{\"systemcode\":18,\"unitcode\":2,\"on\":1}","protocol":"elro_800_switch","length":"","repeats":102,"status":2}'

Now I can turn the switch on and off. :sunglasses:

Only strange thing which remains is that it I get still the pulse train error:

home/OpenMQTTGatewayESP32/PilighttoMQTT invalid pulse train message

#4

Hello,

After some tests here is two examples of commands that worked for me:
ON
mosquitto_pub -t “home/OpenMQTTGateway_ESP8266/commands/MQTTtoPilight” -m ‘{“message”:"{“systemcode”:12,“unitcode”:22,“on”:1}",“protocol”:“elro_400_switch”}’
OFF
mosquitto_pub -t “home/OpenMQTTGateway_ESP8266/commands/MQTTtoPilight” -m ‘{“message”:"{“systemcode”:12,“unitcode”:22,“off”:1}",“protocol”:“elro_400_switch”}’

Please note that the state parameter is replaced by on or off with a value equal to 1