Node-red-contrib-shelly for 2 PM in cover mode

Hi there,
I can't find the syntax of the message to control the position of the roller/cover using node-red-contrib-shelly (Shelly Gen 2) and the Shelly Plus 2PM.

From reading the doc linked below, I think something like below

{"id":123, "src":"mytopic", "method":"Cover.GoToPosition", "pos": 20}

Many Thanks,
It works!
On the same Shelly Plus 2PM I can't have the MQTT notification of the relay's status change.
At the moment I'm subscribing my clients to these topics:

  • shellies / CucinaLuci / relay / 0

  • shellies / CucinaLuci / relay / 1

Where CucinaLuci is both MQTT_Prefix and Client_ID in the configuration page of the module, see the following picture.

Shelli 2pm mqtt

No user and password are requested from my MQTT broker.

With a Shelly 2.5 it works while with the 2PM it doesn't.

From the documentation, the topic format of the two modules looks the same.

If I'm not on the right way, please suggest me the MQTT_Prefix or Client_ID and the topics for the subscriber.

Many thanks again.

RTM
from the links i supplied

Step 6: Receive notifications over MQTT

Now, let's see the communication over MQTT in action. For this to happen, subscribe to the MQTT topic <shelly-id>/events/rpc, where you must replace shelly-id with your device's ID. For example, shellypro4pm-f008d1d8b8b8/events/rpc:

Spaces are not allowed in MQTT topics!

  • shellies/CucinaLuci/relay/0
  • shellies/CucinaLuci/relay/1

Sorry, it's copy and paste effect. No spaces in the original topic.
Seems as E1cid sayed, the topic is CucinaLuci/events/rpc and the payload is json. So it's different from 2.5.

:+1:
Works! Now a little trouble with the payload. After the json conversion I have the following payload but I don't know how to manage the field: switch:0

I need the field output so I tried with:
var Switch0 = msg.payload.params.switch[0].output;
var Switch0 = msg.payload.params.switch.0.output;
ad a lot of other random :scream: combination of ", ', ....
but it's wrong... never managed : in the payload fields

let Switch0 = msg.payload.params["switch:0"].output;
The property name has non spec characters in, so you have to use [ ] notation.

p.s. There is a copy path button in the sidebar debug panel. Hover mouse to right of object name.

Perfect!
Many thanks! Finally works.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.