MQTT Publishing issue with Shelly Gen 3 plug

Avatar
  • updated

Hello Guys,

I try to install a Shelly Gen3 power plug over MQTT, but encounter some issue while trying to send commands.

So far, I have been able to get the all the subscriptions setup properly and setting up all the parsers was easy as always. All data are being collected aas expected.
Now, looking to toggle, or set the plug on or off, nothing happens and I don't see any message going out:

Image 5612

Here the paylod, 

Image 5613

It seems to be correct according to the Shelly documentation

Image 5614

I've  tested all with MQTT Explorer, and sending the same paylod on the same Topic is triggering the switch. 

Any idea about what I could be doing wrong  here ? I spent quite some time on it without any result, any idea will be welcome !

Regards,

Avatar
VASSILIOS GRUNDNIG

Same problem here! I installed a Shelly Pro EM 50 which has an output that can be controlled. 

I also get all the subscriptions and I can publish through MQTT Explorer. Not a big issue for me because I didn't need the output and I can control it through Modbus TCP. 

I also believe it is a possible bug.

Avatar
Fabien Fuster

Thanks!

However the above payload is not working, without src. After some further digging, I found out that I have to add "src", therefore it should look like (ie) :

{
"id": 0,
"src": "bOS",
"method": "Switch.Set",
"params": {
"id": 0,
"on": false
}
}

Using MQTT Explorer and publishing from there, all is working fine, but publishing the same from bOS isn't. It looks like "Publish()" is not sending anything out... a possible bug ?

Avatar
Jürgen Jürgenson

I use "shellyplus1pm-someIDcode/rpc" as topic. Install MQTT explorer and you will see what the commands should looks like.

Avatar
Fabien Fuster
Quote from Jürgen Jürgenson

Try payload as ON:
{
"id": 0,
"method": "Switch.Set",
"params": {
"id": 0,
"on": true
}
}

OFF:
{
"id": 0,
"method": "Switch.Set",
"params": {
"id": 0,
"on": false
}
}

Toggle:
{
"id": 0,
"method": "Switch.Toggle",
"params": {
"id": 0
}
}

Toggle with bOS works also with this when linked with boolean: 
{"id":1, "src":"user_1", "method":"Switch.Set", "params":{"id":0,"on":%0[[true,false]]}}

Hi Jürgen,

Thanks for your feedback. Tried with the ON and OFF paylods, but there are not working. I might have a wrong Full Topic. Any idea how it should look like ?

Thanks,

Fabien

Avatar
Jürgen Jürgenson

Try payload as ON:
{
"id": 0,
"method": "Switch.Set",
"params": {
"id": 0,
"on": true
}
}

OFF:
{
"id": 0,
"method": "Switch.Set",
"params": {
"id": 0,
"on": false
}
}

Toggle:
{
"id": 0,
"method": "Switch.Toggle",
"params": {
"id": 0
}
}

Toggle with bOS works also with this when linked with boolean: 
{"id":1, "src":"user_1", "method":"Switch.Set", "params":{"id":0,"on":%0[[true,false]]}}