Skip to content

Shelly 2PM Cover Position

Alexander Nagy edited this page Oct 13, 2023 · 4 revisions

ShellyTeacher4Domoticz has multiple templates for Shelly2PM. When you are using your device in cover mode, the two switch devices will be unavailable and two roller devices has to be enabled in Domoticz. (which are disabled by default)

The first one is "Roller 0" which only able to use Open/Close/Stop commands.

The second one named as "Roller Pos (MqttControl)" which can be used to set position in case you are using Domoticz 2023 beta 15601 or later stable. And of course, you have to enable "MQTT Control" option at the Shelly side. And thats all.

The third one named as "Roller Pos (Obsolote)" which can be used to set position, but as Domoticz are unable to assemble a proper JSON MQTT reply, a Script has to be installed into the Shelly 2PM:

This is the fixed version for current stable Shelly firmware: https://github.com/enesbcs/shelly-script-examples/blob/main/shelly2p-domo-coverfix.js

And this is the try-catch version for >=1.0.0 Shelly firmware: https://github.com/enesbcs/shelly-script-examples/blob/main/shelly2p-domo-coverfix-v2.js

If you are not familiar how the Scripts are working on Shelly, please first consult with the manual: https://shelly-api-docs.shelly.cloud/gen2/Scripts/Tutorial/