Page 1 of 7

Is it possible to add Shelly 2PM GEN 3 to Domoticz?

Posted: Saturday 29 March 2025 12:15
by Daro1003
Is it possible to add Shelly 2PM GEN 3 to Domoticz?

According to this manual it is not possible to add: https://www.youtube.com/watch?v=3PvYhFIsVN4
Does anyone know a way?

Or can someone suggest how to control the blinds using another controller so that it would control %% blinds in domoticz

Re: Is it possible to add Shelly 2.5 GEN 3 to Domoticz?

Posted: Saturday 29 March 2025 16:19
by FireWizard
Hi @Daro1003,
Is it possible to add Shelly 2.5 GEN 3 to Domoticz?
Does anyone know a way?

Or can someone suggest how to control the blinds using another controller so that it would control %% blinds in domoticz
Of course.

Shelly (any device) ==> MQTT ==> Node-Red ==> MQTT ==> Domoticz (or Node-Red ==> Http ==> Domoticz).

Regards

Re: Is it possible to add Shelly 2.5 GEN 3 to Domoticz?

Posted: Saturday 29 March 2025 17:31
by Daro1003
Can you help build flows from shelly to NodeRed and to domoticz?

Re: Is it possible to add Shelly 2.5 GEN 3 to Domoticz?

Posted: Saturday 29 March 2025 20:37
by FireWizard
Sure, we can try.

Have you NR installed and working?
And the Mosquitto MQTT server?

If you can test the flow, I think I can build one

Regards

Re: Is it possible to add Shelly 2.5 GEN 3 to Domoticz?

Posted: Saturday 29 March 2025 23:09
by Daro1003
NodeRed installed and working.

Mosquitto MQTT server is also working.

NodeRed to Domoticz flows from you are also working.

Re: Is it possible to add Shelly 2.5 GEN 3 to Domoticz?

Posted: Sunday 30 March 2025 11:05
by FireWizard
Hi @Daro1003,

Are you sure your product is a Shelly 2.5 Gen 3 and not a Shelly 2 Gen 3, as I cannot find the product in the Shelly list?

Regards

Re: Is it possible to add Shelly 2.5 GEN 3 to Domoticz?

Posted: Sunday 30 March 2025 12:28
by Daro1003
You are right this product is shelly 2PM GEN 3.
I've already changed the description because I misspelled the designation.

Re: Is it possible to add Shelly 2PM GEN 3 to Domoticz?

Posted: Sunday 30 March 2025 16:49
by FireWizard
Ok Nice,

I will come back with a first flow, probably tomorrow.

Regards

Re: Is it possible to add Shelly 2PM GEN 3 to Domoticz?

Posted: Sunday 30 March 2025 19:13
by Daro1003
great, I'm waiting.

I installed additional nodes related to shelly but GEN 3 is missing.

Is it possible to control the roller blinds by percentage in Domoticz?

Re: Is it possible to add Shelly 2PM GEN 3 to Domoticz?

Posted: Sunday 30 March 2025 21:19
by FireWizard
Hi @Daro1003,

You can use these nodes and Gen 3 exists as well.
What do you think of shelly gen 2+?
These nodes can be used or the default MQTT nodes.

What do you prefer?
Is it possible to control the roller blinds by percentage in Domoticz?
I think so. It is specific for roller blinds?

Regards

Re: Is it possible to add Shelly 2PM GEN 3 to Domoticz?

Posted: Sunday 30 March 2025 21:22
by Daro1003
Where can I find a shelly GEN 3 node?

I don't have a shelly GEN 2, I bought a newer shelly GEN 3 model because I read online that the GEN 2 models also have a similar problem with temperature as the shelly 2.5.

I currently use percentage control of the blinds with the shelly 2.5 controller because the blinds are set at different times of the day in different positions.

Re: Is it possible to add Shelly 2PM GEN 3 to Domoticz?

Posted: Sunday 30 March 2025 21:34
by FireWizard
Hello @Daro1003,

I did not say Gen 2, but I said Gen 2+.

This node is used for everything higher or equal than Gen 2.
Gen 3 and Gen 4 use the same protocol as Gen 2 and so the same node is used

Regards

Re: Is it possible to add Shelly 2PM GEN 3 to Domoticz?

Posted: Monday 31 March 2025 21:42
by FireWizard
Hello @Daro1003,

Currently I'm looking to a possible Node RED flow for your Shelly 2PM gen 3 device.

As I do not have such a device and you should maintain a possible flow in the future, you have to make a decision on how we make it.

1. As you said, that you want to control blinds, you need to use the device in "Cover" mode.
2. Do you want to use the default MQTT node or do you prefer one of the Node-RED contrib node.
If you prefer the contrib node can you configure shelly gen 2+ node and try, if you get a connection.
Double click on the node and insert the hostname or IP address of the Shelly device and select the correct Device Type.
Connect Insert node to the input and a Debug node to the output.

Screenshot_Shelly2PM-1.png
Screenshot_Shelly2PM-1.png (10.5 KiB) Viewed 2248 times

Check, that the Shelly node shows connected and check the debug node, if you push the Inject node.

If you prefer the default MQTT node, I like to know your MQTT configuration of the Shelly device (without credentials)

What type of switches you want to use in Domotiocz (Selector switch? Dimmer?)
And what type of sensor you like to show?

Regards

Re: Is it possible to add Shelly 2PM GEN 3 to Domoticz?

Posted: Tuesday 01 April 2025 16:50
by FireWizard
Hello @daro1003,

I see, that you have installed several Shelly nodes.

If you decide not to use MQTT but the contrib Shelly node (https://flows.nodered.org/node/node-red-contrib-shelly), you can leave this node in your palette.

You have also installed https://flows.nodered.org/node/@zebraja ... shelly-3em.
I recommend to remove this one, as it may cause a conflict with the other one and the other one also supports the Shelly 3EM and you do not need support for it now.

You have also installed https://flows.nodered.org/node/node-red ... helly-mqtt. Also that one is not needed.
If you decide to go for MQTT, then we can use the default MQTT nodes. So remove it.

Also another Shelly Pro 3EM node has been installed. Remove that one as well. It is not needed, may cause conflicts and is already supported by the first one.

I looked a little bit to your device and its possibilities.
I found an example, which support the first set of nodes.

See:
https://raw.githubusercontent.com/windk ... rplus.json

Can you import this one and test with your device?

I like to know if this example works.

Regards

Re: Is it possible to add Shelly 2PM GEN 3 to Domoticz?

Posted: Tuesday 01 April 2025 19:54
by Daro1003
I have removed the nodes you indicated.
Which ones should I remove? The ones in the image remain.

How can I import this https://raw.githubusercontent.com/windk ... rplus.json
import it? How do I do that??

Re: Is it possible to add Shelly 2PM GEN 3 to Domoticz?

Posted: Tuesday 01 April 2025 20:16
by Daro1003
With the settings as in the attached image I managed to get a connection with my shelly.

As for the type of connection I have no idea which one to choose I rely on you.

Re: Is it possible to add Shelly 2PM GEN 3 to Domoticz?

Posted: Tuesday 01 April 2025 22:41
by FireWizard
Good evening @Daro1003,
With the settings as in the attached image I managed to get a connection with my shelly.
Nice, that means everything is online.
As for the type of connection I have no idea which one to choose I rely on you.
Okay then we go for this node, configured as Shelly 2PM GEN3 (Relay S3SW-002P16EU), as we know that this node works.
I have removed the nodes you indicated.
Which ones should I remove? The ones in the image remain.
That is okay.
How can I import this https://raw.githubusercontent.com/windk ... rplus.json
import it? How do I do that??
1, Go to the link as indicated
2. Select everything (CTRL A).
3. Copy (CTRL C or right mouse button and "Copy") and the code is saved to the clipboard.
4. Go to the "Hamburger" menu in Node-RED and select "Import".
5. The window "Import nodes" will open.
6. Paste the contents of the clipboard (CTRL V or right mouse button and "Paste") and Import the flow.

Test it, if this works for you.

And
What type of switches you want to use in Domotiocz (Selector switch? Dimmer?)
And what type of sensor you like to show?
Can you also answer these questions?

Regards

Re: Is it possible to add Shelly 2PM GEN 3 to Domoticz?

Posted: Wednesday 02 April 2025 1:25
by kimot
I think, this Shelly suports scripting.
So why all this mqtt and node red?
Switching on and off works by direct call from Domoticz like all older ones.
And Shelly can send measured values ​​directly to Domoticz using a script running on it.

For example here is a part of my code for sending amount of energy in the last minute on my PlusPlugS.

Code: Select all

Shelly.addStatusHandler(function (event, user_data) {
  print(JSON.stringify(event));
  
   if (typeof event.delta.aenergy !== "undefined") {
    if (startMonitor) {
      print(eAccumulator_prev);
      minute_energy = event.delta.aenergy.by_minute[0];
      eAccumulator = event.delta.aenergy.total;
      // power = event.delta.apower;
      total = event.energy
      power = event.apower;
      print(eAccumulator);
      eDiff = eAccumulator - eAccumulator_prev;
      print(eDiff);
      print(minute_energy);
      minute_energy = Math.round(minute_energy);
      print(minute_energy);
       url = "http://192.168.1.2:8080/json.htm?type=command&param=udevice&idx=152&nvalue=0&svalue="+minute_energy;
      print(url);
      print(eAccumulator);  
      Shelly.call(
  "HTTP.GET", {
    "url": url,
  },

Re: Is it possible to add Shelly 2PM GEN 3 to Domoticz?

Posted: Wednesday 02 April 2025 15:00
by FireWizard
Hell #kimot,

You wrote:
I think, this Shelly supports scripting.
You are right. All Gen 2, Gen 3 and Gen 4 support scripting.
Shelly offers even a training course to learn the script language.

See: https://shelly.guide/scripting/ and https://github.com/ShellyUSA/Scripts
Course: https://shelly.academy/trainings/13/she ... pring-2025
So why all this mqtt and node red?
At the end it is all to the user to decide, which route he/she wish to follow in order to reach his/her goal

This user has already a MQTT broker and also Node-RED up and running.
I supported him in another project in the past with MQTT and Node-RED.

If you have it up and running and you are familiar with it, it is probably easier than scripting.
It is just JSON and that is also a scripting language.and the same as your script.
And Shelly can send measured values ​​directly to Domoticz using a script running on it.
For example here is a part of my code for sending amount of energy in the last minute on my PlusPlugS.
Thank you, although I probably will not use it, but others may benefit from it.

Regards

Re: Is it possible to add Shelly 2PM GEN 3 to Domoticz?

Posted: Monday 07 April 2025 7:38
by Daro1003
Hello colleagues.

Due to work, I have little time to work at home, but we continue working.

I managed to import the code from the link and I got a working flow. If I click on open or close in NodeRed, it clicks the relay in shelly. So communication with NodeRed works with shelly. Now we need to pass it to Domoticz.

In Domoticz, I would like a switch type with a slider and a precent indicator as in the picture. I also use this type in Dashticz. It controls the blinds using the blinds setting in a given position thanks to the switch with %