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

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

User avatar
FireWizard
Posts: 1905
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

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

Post by FireWizard »

hello @Daro1003,

A general remark.

Before you test something and show/send a picture/screenshot, press the "Deploy" button.
That will remove (and save your flow) the blue dot in the right upper corner of your node.

Then I know for sure, that, what I see, is really the output of that flow.
Question: Should the MQTT window in schelly be configured?
Your MQTT configuration is correct.

I use the same, but as MQTT prefix, I did set shellies.
So my Shelly 1 Plus looks like shellies/shellyplus1-a8032ab806c8
In this way, I have all my shellies grouped together.
Maybe something to consider?

Do you use a username and password for your MQTT broker?
If not, remove Username (admin) and the Password
Dane.png (49.68 KiB)
This picture is correct, as it represents the data we are sending to Domoticz.
So okay.
Dane2.png (100.39 KiB)
Is this the data you are talking about??
No.

I think you sent me the output, when you pushed "Open", "Close" and "Stop".

This was not, what I asked and remember, that we do not use STOP.

Please show me the output, when you press "Get Status".

I expect something similar as the picture below:

Screenshot_Status_PM1Pluspng.png
Screenshot_Status_PM1Pluspng.png (27.26 KiB) Viewed 1524 times

Open the important (for you) topics, such as input and switch by pushing the arrows in front of it.
I have noticed a strange behavior of Shelly PM2GEN3

If I go to the Shelly page 192.168.0.49, Node-Red disconnects from Shelly - I have to restart to reconnect Shelly - Node Red.

But not every time.
It might be that your browser and the Node-RED node do not work together,

I will look to it, but I do not see the same, if I have opened my web browser and the Shelly node.
Something to use Google and try to find a possible cause, but no idea so far.

Perhaps we have to move to MQTT instead of those nodes. I will look to that as well.

Have a nice Sunday and Regards
Daro1003
Posts: 193
Joined: Monday 14 November 2022 12:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Poland
Contact:

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

Post by Daro1003 »

I think I did as you wrote:
clikstatu.png
clikstatu.png (63.9 KiB) Viewed 1506 times
status1.png
status1.png (26.59 KiB) Viewed 1506 times
status2.png
status2.png (21.65 KiB) Viewed 1506 times
Something must be wrong with my PM2 GEN 3 shelly that I am testing - it disconnects from the network. After some time it disconnects from NodeRed but I cannot enter the shelly options via www IP only after restarting the power supply it returns to the connection. Strange new piece.

Are these shells really that unreliable?
Last edited by Daro1003 on Sunday 13 April 2025 15:36, edited 1 time in total.
Daro1003
Posts: 193
Joined: Monday 14 November 2022 12:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Poland
Contact:

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

Post by Daro1003 »

By the way, I am still thinking about buying a shelly PRO 2PM for testing, it is a controller for a TH rail for a switchboard. And I have all the cables in the switchboard for the roller shutters.
Zrzut ekranu 2025-04-13 153210.png
Zrzut ekranu 2025-04-13 153210.png (71.65 KiB) Viewed 1502 times
Will I be able to count on your help with this controller?

Shelly PRO 2PM has the option of connecting to a LAN network by cable, so it may be possible to bypass the Wi-Fi problem. It may also be better quality and more stable.
User avatar
FireWizard
Posts: 1905
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

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

Post by FireWizard »

hello @Daro1003,
I think I did as you wrote:
Yes, that is what I mean. Thanks for that.
Something must be wrong with my PM2 GEN 3 Shelly that I am testing - it disconnects from the network. After some time it disconnects from Node-Red but I cannot enter the Shelly options via WWW IP only after restarting the power supply it returns to the connection. Strange new piece.

Are these shells really that unreliable?
Don´t give up too fast.

Disable that Shelly Node and afterwards connect with the web browser..
See if it stays connected.
Just a question. Is the IP address a static address or does the Shelly gets it from DHCP?

It happens more often, that the Shellies loose connection. I will look for a possible cause.

Perhaps we can abandon the Shelly nodes and go to MQTT.

Can you test the following flow.

Code: Select all

[
    {
        "id": "f8729e7286752011",
        "type": "mqtt out",
        "z": "f55ebfe97fab5883",
        "name": "",
        "topic": "",
        "qos": "",
        "retain": "",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "7aff5cd755ba2941",
        "x": 450,
        "y": 720,
        "wires": []
    },
    {
        "id": "abae62ee6eae17d3",
        "type": "mqtt in",
        "z": "f55ebfe97fab5883",
        "name": "from Shelly",
        "topic": "shellies/shellyplus1-a8032ab806c8/status",
        "qos": "1",
        "datatype": "auto-detect",
        "broker": "7aff5cd755ba2941",
        "nl": false,
        "rap": true,
        "rh": 0,
        "inputs": 0,
        "x": 270,
        "y": 780,
        "wires": [
            [
                "fbda5117328652af"
            ]
        ]
    },
    {
        "id": "aaa8d3415ea1ef72",
        "type": "inject",
        "z": "f55ebfe97fab5883",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "shellies/shellyplus1-a8032ab806c8/command",
        "payload": "status_update",
        "payloadType": "str",
        "x": 270,
        "y": 720,
        "wires": [
            [
                "f8729e7286752011"
            ]
        ]
    },
    {
        "id": "fbda5117328652af",
        "type": "debug",
        "z": "f55ebfe97fab5883",
        "name": "debug 18",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 460,
        "y": 780,
        "wires": []
    },
    {
        "id": "7aff5cd755ba2941",
        "type": "mqtt-broker",
        "name": "Jonas_MQTT_Server",
        "broker": "mqtt.jonasnet.nl",
        "port": "1883",
        "clientid": "",
        "autoConnect": true,
        "usetls": false,
        "protocolVersion": "4",
        "keepalive": "60",
        "cleansession": true,
        "autoUnsubscribe": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closeQos": "0",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "0",
        "willPayload": "",
        "willMsg": {},
        "userProps": "",
        "sessionExpiry": ""
    }
]
Do the following.

1. Configure your own MQTT server, as you did before.
2. Insert your Client ID in the topic(shelly2pmg3-34cdb0774d4c in the topics of the MQTT nodes.

The MQTT output node should contain:

Code: Select all

shelly2pmg3-34cdb0774d4c/command
The MQTT input node should contain as topic:

Code: Select all

shelly2pmg3-34cdb0774d4c/status
The result shall be exactly the same as the Staus Request from the Node.

If this works, we will continue with MQTT.
Are these shells really that unreliable?
I do not have problems, although some need to be reset-ted sometimes.
By the way, I am still thinking about buying a Shelly PRO 2PM for testing, it is a controller for a TH rail for a switchboard. And I have all the cables in the switchboard for the roller shutters
Will I be able to count on your help with this controller?.
Yes, no problem
Shelly PRO 2PM has the option of connecting to a LAN network by cable, so it may be possible to bypass the Wi-Fi problem. It may also be better quality and more stable.
maybe, but let us test the MQTT first.

Regards
Daro1003
Posts: 193
Joined: Monday 14 November 2022 12:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Poland
Contact:

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

Post by Daro1003 »

We still don't understand how to configure it.
Zrzut ekranu 2025-04-13 212900.png
Zrzut ekranu 2025-04-13 212900.png (18.92 KiB) Viewed 1455 times
Do I set the IP address of domoticz in the mqtt node?

Do I set the address of shelly in the from Shelly node?

Shelly has a static address of 192.168.0.49
Domoticz on raspberry also has a static address of 192.168.0.40

Topic:
comand1.png
comand1.png (27.84 KiB) Viewed 1455 times
Topic2.png
Topic2.png (39.35 KiB) Viewed 1455 times
Is it supposed to be like this??
Daro1003
Posts: 193
Joined: Monday 14 November 2022 12:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Poland
Contact:

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

Post by Daro1003 »

So I did as above but I don't know what to set in the shell node so I did as I thought if I write something wrong I will correct it.

Results:
Test1.png
Test1.png (60.02 KiB) Viewed 1452 times
Test 2.png
Test 2.png (20.19 KiB) Viewed 1452 times
Daro1003
Posts: 193
Joined: Monday 14 November 2022 12:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Poland
Contact:

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

Post by Daro1003 »

Now I think I did it correctly:
Test 3.png
Test 3.png (74.54 KiB) Viewed 1451 times
User avatar
FireWizard
Posts: 1905
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

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

Post by FireWizard »

Hello @Daro1003,
We still don't understand how to configure it.
Sometimes the pictures cause confusion, but let's see.
Zrzut ekranu 2025-04-13 212900.png
Zrzut ekranu 2025-04-13 212900.png (18.92 KiB) Viewed 47 times

Do I set the IP address of domoticz in the mqtt node?
NO, You have to configure all Node-RED MQTT nodes, as you did before.
But it seems that MQTT (Mosquitto) and Domoticz is running on the same hardware.
In that case, both have the same IP address
But they us different ports.
Do I set the address of shelly in the from Shelly node?
NO
Shelly has a static address of 192.168.0.49.
OKAY

Domoticz on raspberry also has a static address of 192.168.0.40

OKAY, and this is the same as Mosquitto?

I think that I have seen enough and will look to control the Shelly.

Now, the unstable WiFi.

Can you check, if your WiFi router(s) are using a fixed WiFi Channel?
Often routers change the channel (frequency) if other equipment comes online.
I have read some issues, especially with Shelly Plus devices.

Regards
Daro1003
Posts: 193
Joined: Monday 14 November 2022 12:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Poland
Contact:

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

Post by Daro1003 »

1. Domoticz and MQTT (Mosquitto) and NodeRed all on one Raspberry 3B+ machine with address 192.168.0.40

2. Shelly PM2 GEN3 static IP address 192.168.0.49

3. 3. WiFi from the ASUS RT-AC66U B1 router set to AP mode. Currently working on it are 20 pieces of Sonoff4ch, 13 pieces of shelly 2.5 and other ESP8266 devices, generally about 60 devices and there are no problems with any - there never were.
RUTER.png
RUTER.png (137.31 KiB) Viewed 1393 times
Ruter2.png
Ruter2.png (58.5 KiB) Viewed 1393 times
User avatar
FireWizard
Posts: 1905
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

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

Post by FireWizard »

Hello @Daro1003,

Thanks for all the information.

But first your WiFi router.

I found this:

https://community.home-assistant.io/t/s ... 756?page=2.

Read the post from Jan 2023 and so on.

Read also: https://wolfgang-ziegler.com/blog/shell ... navailable

I suggest, that we continue with MQTT, instead of the Shelly nodes.
You may want to archive the flow, that has been created so far.

I created something similar with MQTT as the example with the Shelly nodes.

Can you test that.

Again, configure in both MQTT nodes your own configuration.
I already inserted your Shelly ID in the topics

Code: Select all

[
    {
        "id": "20f05619c314f2de",
        "type": "mqtt out",
        "z": "f55ebfe97fab5883",
        "name": "Shelly Command",
        "topic": "",
        "qos": "1",
        "retain": "false",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "7aff5cd755ba2941",
        "x": 550,
        "y": 1280,
        "wires": []
    },
    {
        "id": "6ff6a2f5bedf6c35",
        "type": "mqtt in",
        "z": "f55ebfe97fab5883",
        "name": "Cover Status Input",
        "topic": "shelly2pmg3-34cdb0774d4c/status/cover:0",
        "qos": "1",
        "datatype": "auto-detect",
        "broker": "7aff5cd755ba2941",
        "nl": false,
        "rap": true,
        "rh": 0,
        "inputs": 0,
        "x": 270,
        "y": 1460,
        "wires": [
            [
                "0598d34c5f7cd895"
            ]
        ]
    },
    {
        "id": "b60329f4a926a2cb",
        "type": "inject",
        "z": "f55ebfe97fab5883",
        "name": "",
        "props": [
            {
                "p": "topic",
                "vt": "str"
            },
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "shelly2pmg3-34cdb0774d4c/command/cover:0",
        "payload": "status_update",
        "payloadType": "str",
        "x": 290,
        "y": 1160,
        "wires": [
            [
                "20f05619c314f2de"
            ]
        ]
    },
    {
        "id": "0598d34c5f7cd895",
        "type": "debug",
        "z": "f55ebfe97fab5883",
        "name": "debug 23",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 520,
        "y": 1460,
        "wires": []
    },
    {
        "id": "3b6495daa208516e",
        "type": "inject",
        "z": "f55ebfe97fab5883",
        "name": "",
        "props": [
            {
                "p": "topic",
                "vt": "str"
            },
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "shelly2pmg3-34cdb0774d4c/command/cover:0",
        "payload": "open",
        "payloadType": "str",
        "x": 310,
        "y": 1220,
        "wires": [
            [
                "20f05619c314f2de"
            ]
        ]
    },
    {
        "id": "4a71b705b512fe13",
        "type": "inject",
        "z": "f55ebfe97fab5883",
        "name": "",
        "props": [
            {
                "p": "topic",
                "vt": "str"
            },
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "shelly2pmg3-34cdb0774d4c/command/cover:0",
        "payload": "close",
        "payloadType": "str",
        "x": 310,
        "y": 1280,
        "wires": [
            [
                "20f05619c314f2de"
            ]
        ]
    },
    {
        "id": "d8dc06bd92e8102b",
        "type": "inject",
        "z": "f55ebfe97fab5883",
        "name": "",
        "props": [
            {
                "p": "topic",
                "vt": "str"
            },
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "shelly2pmg3-34cdb0774d4c/command/cover:0",
        "payload": "stop",
        "payloadType": "str",
        "x": 310,
        "y": 1340,
        "wires": [
            [
                "20f05619c314f2de"
            ]
        ]
    },
    {
        "id": "78c0699f03083777",
        "type": "inject",
        "z": "f55ebfe97fab5883",
        "name": "",
        "props": [
            {
                "p": "topic",
                "vt": "str"
            },
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "shelly2pmg3-34cdb0774d4c/command/cover:0",
        "payload": "pos,50",
        "payloadType": "str",
        "x": 290,
        "y": 1400,
        "wires": [
            [
                "20f05619c314f2de"
            ]
        ]
    },
    {
        "id": "7aff5cd755ba2941",
        "type": "mqtt-broker",
        "name": "Jonas_MQTT_Server",
        "broker": "mqtt.jonasnet.nl",
        "port": "1883",
        "clientid": "",
        "autoConnect": true,
        "usetls": false,
        "protocolVersion": "4",
        "keepalive": "60",
        "cleansession": true,
        "autoUnsubscribe": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closeQos": "0",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "0",
        "willPayload": "",
        "willMsg": {},
        "userProps": "",
        "sessionExpiry": ""
    }
]

Let me know, if this works for your Shelly.
If so, I will connect the Virtual switch in Domoticz to this flow and also create the virtual sensors in Domoticz.

Regards
Daro1003
Posts: 193
Joined: Monday 14 November 2022 12:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Poland
Contact:

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

Post by Daro1003 »

The shutter works if I click on nodes in NodeRed.
It doesn't work from the button in Domoticz.
DziałaIdealnie.png
DziałaIdealnie.png (59.58 KiB) Viewed 1341 times
User avatar
FireWizard
Posts: 1905
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

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

Post by FireWizard »

Hello @Daro1003
The shutter works if I click on nodes in NodeRed.
That's nice and is what I hoped for.
It doesn't work from the button in Domoticz.
I know and that why I said:
Let me know, if this works for your Shelly.
If so, I will connect the Virtual switch in Domoticz to this flow and also create the virtual sensors in Domoticz.
In a next post, I will present a flow with the connection to Domoticz.

Regards
Daro1003
Posts: 193
Joined: Monday 14 November 2022 12:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Poland
Contact:

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

Post by Daro1003 »

That's great.

I set channel no. 3 on the router - time will tell if the problem returns.
User avatar
FireWizard
Posts: 1905
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

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

Post by FireWizard »

Hello @Daro1003

In fact this post is off topic, as it has nothing to do with Domoticz.

You said:
I set channel no. 3 on the router - time will tell if the problem returns.
This is not the best channel.
If possible and if your wireless router allows you to do so, choose another channel.

The 2.4 GHz band has 12 channels (in Europe) with a frequency distance of 5Mhz each.
This band has only 3 non-overlapping channels, channel 1, 6 and 11.
See:

Screenshot_2020-11-09-11-48-50.png
Screenshot_2020-11-09-11-48-50.png (129.18 KiB) Viewed 1201 times

I would recommend to install an app, like WiFi analyzer on your phone or tablet.
In Google Play store, you can find multiple and look, which of the channel 1, 6 or 11 has no or very little disturbance of other users in your neighborhood.
In an occupied area, use a channel width of 20 MHz and not 40 MHz.

That is the best channel.

Regards

P.S. A Shelly flow, will follow.
User avatar
FireWizard
Posts: 1905
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

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

Post by FireWizard »

Hello @Daro1003,

I have considered, what would be the best approach in creating a flow for the Shelly blinds control.

It is important that you have a simple setup and that it also gives you easy software maintenance.

a few things, we have discovered, so far.

In Domoticz , with the theme, you use (Machinon), the Blinds Percentage and STOP button does not work.
With the default theme, it works. but it does not look so nice, as the slider is too long.

So we will use in Domoticz a Swith of type Blinds Percentage.
In order to avoid interference with the default Shelly web browser, we will not take the contrib nodes in Node-RED, but we will take the default MQTT nodes.

We can not avoid, that you have to configure a few things.

1. For each MQTT node (both MQTT Input and MQTT Output), you have to insert your own configuration.
As your Domoticz and your Mosquitto runs on the same hardware, it is the same IP address 192.168.0.40.

2. As their exist an exclusive relationship between the (virtual) Domoticz switch of type "Blinds Percentage) and you Shelly Device, we have to configure that as well. I made the choice to do that in one specific node and not that all those things are scattered over different nodes in the flow.

For this purpose a contrib node exist, but I decided to do it with the default installed nodes.

In this case an "Inject and a Change node.

Screenshot_Inject Change.png
Screenshot_Inject Change.png (7.79 KiB) Viewed 1200 times

The "Inject"node functions as a trigger only and will store the so called flow variable, after the start of the node.

It is configured as follows:

Screenshot_Change_Config.png
Screenshot_Change_Config.png (19.83 KiB) Viewed 1200 times
The first value you have to insert the characters IDX follo0wd by your Domotiocz idx number.

(I think I did it already for you, but the next switch, you have to do it yourself.

The second value is the Shelly client ID, as shown in your post April 12 2025, 21:40h.

The other 2 streams represent the communication between Domoticz and the Shelly.
The other, the communication between the Shelly and Domoticz, if you use e.g. a physical switch or the web browser.

See the 3 flows below and copy each of the in the same Node RED tab.
All the other stuff you may delete or archive.

Flow 1.

Code: Select all

[
    {
        "id": "6d6b37aa224c0267",
        "type": "change",
        "z": "f55ebfe97fab5883",
        "name": "Set Domoticz IDX ",
        "rules": [
            {
                "t": "set",
                "p": "IDX1060",
                "pt": "flow",
                "to": "shelly2pmg3-34cdb0774d4c",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 510,
        "y": 1640,
        "wires": [
            []
        ]
    },
    {
        "id": "72d05de408241efe",
        "type": "inject",
        "z": "f55ebfe97fab5883",
        "name": "Inject Domoticz IDX",
        "props": [],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "",
        "x": 260,
        "y": 1640,
        "wires": [
            [
                "6d6b37aa224c0267"
            ]
        ]
    }
]

Flow 2:

Code: Select all

[
    {
        "id": "5f6a604495a17c3b",
        "type": "mqtt in",
        "z": "f55ebfe97fab5883",
        "name": "Domoticz Out",
        "topic": "domoticz/out",
        "qos": "2",
        "datatype": "auto-detect",
        "broker": "38b35487299a036d",
        "nl": false,
        "rap": true,
        "rh": 0,
        "inputs": 0,
        "x": 270,
        "y": 1560,
        "wires": [
            [
                "f066f8205567a5a7"
            ]
        ]
    },
    {
        "id": "f066f8205567a5a7",
        "type": "switch",
        "z": "f55ebfe97fab5883",
        "name": "Filter Switch Type",
        "property": "payload.switchType",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "Blinds Percentage",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 510,
        "y": 1560,
        "wires": [
            [
                "3940013d84a6f7bf",
                "b9a4f7de1b6e13a5"
            ]
        ]
    },
    {
        "id": "3940013d84a6f7bf",
        "type": "function",
        "z": "f55ebfe97fab5883",
        "name": "Blinds + Percentage ",
        "func": "// Function Blinds and Percentage\n\nmsg.topic = flow.get (\"IDX\" + msg.payload.idx) + \"/command/cover:0\";\nmsg.idx = msg.payload.idx;\n\n//Closed\nif (msg.payload.nvalue === 0) { msg.payload = \"close\" };\n\n//Open\nif (msg.payload.nvalue === 1) { msg.payload = \"open\" };\n\n//Percentage\nif (msg.payload.nvalue === 2) { msg.payload = \"pos,\" + msg.payload.svalue1 };\n\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 760,
        "y": 1560,
        "wires": [
            [
                "1ada67753bbe5e55",
                "3fdc4c4fc5c91b17"
            ]
        ]
    },
    {
        "id": "1ada67753bbe5e55",
        "type": "debug",
        "z": "f55ebfe97fab5883",
        "name": "debug 27",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 980,
        "y": 1520,
        "wires": []
    },
    {
        "id": "3fdc4c4fc5c91b17",
        "type": "mqtt out",
        "z": "f55ebfe97fab5883",
        "name": "Shelly Cover Command Out",
        "topic": "",
        "qos": "1",
        "retain": "false",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "7aff5cd755ba2941",
        "x": 1040,
        "y": 1560,
        "wires": []
    },
    {
        "id": "b9a4f7de1b6e13a5",
        "type": "debug",
        "z": "f55ebfe97fab5883",
        "name": "debug 33",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 720,
        "y": 1500,
        "wires": []
    },
    {
        "id": "38b35487299a036d",
        "type": "mqtt-broker",
        "name": "Raspberry Pi 1",
        "broker": "192.168.10.51",
        "port": "1883",
        "clientid": "",
        "autoConnect": true,
        "usetls": false,
        "protocolVersion": "4",
        "keepalive": "60",
        "cleansession": true,
        "autoUnsubscribe": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closeQos": "0",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "0",
        "willPayload": "",
        "willMsg": {},
        "userProps": "",
        "sessionExpiry": ""
    },
    {
        "id": "7aff5cd755ba2941",
        "type": "mqtt-broker",
        "name": "Jonas_MQTT_Server",
        "broker": "mqtt.jonasnet.nl",
        "port": "1883",
        "clientid": "",
        "autoConnect": true,
        "usetls": false,
        "protocolVersion": "4",
        "keepalive": "60",
        "cleansession": true,
        "autoUnsubscribe": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closeQos": "0",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "0",
        "willPayload": "",
        "willMsg": {},
        "userProps": "",
        "sessionExpiry": ""
    }
]

Flow 3:

Code: Select all

[
    {
        "id": "8120bc819f267c24",
        "type": "function",
        "z": "f55ebfe97fab5883",
        "name": "function 2",
        "func": "let clientId = msg.topic. split (\"/\")[0];\n\nfor (let i = 0; i < flow.keys().length; i++) {\n\n    if (clientId === flow.get(flow.keys()[i])) {\n\n        let idx = parseInt(flow.keys()[i].substring(3));\n\n        if (msg.payload.state === \"open\") {\n            msg.payload = { \"command\": \"udevice\", \"idx\": idx, \"nvalue\": 0, \"svalue\": \"0\" }\n        }\n\n        if (msg.payload.state === \"closed\") {\n            msg.payload = { \"command\": \"udevice\", \"idx\": idx, \"nvalue\": 1, \"svalue\": \"100\" }\n        }\n\n        if (msg.payload.state === \"open\") {\n            msg.payload = { \"command\": \"udevice\", \"idx\": idx, \"nvalue\": 2, \"svalue\": msg.payload.current_pos }\n        }\n        return msg\n    }\n}\n",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 480,
        "y": 1720,
        "wires": [
            [
                "d08834ebc025e49b",
                "dfa807b92c4aaf81"
            ]
        ]
    },
    {
        "id": "d08834ebc025e49b",
        "type": "debug",
        "z": "f55ebfe97fab5883",
        "name": "debug 24",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 660,
        "y": 1780,
        "wires": []
    },
    {
        "id": "4cc1cb087ca69da3",
        "type": "inject",
        "z": "f55ebfe97fab5883",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "shelly2pmg3-34cdb0774d4c/status/cover:0",
        "payload": "{\"id\":0,\"source\":\"limit_switch\",\"state\":\"open\",\"apower\":0,\"voltage\":239.7,\"current\":0,\"pf\":0,\"freq\":50,\"aenergy\":{\"total\":40.057},\"temperature\":{\"tC\":47,\"tF\":116.7},\"pos_control\":true,\"last_direction\":\"open\",\"current_pos\":100}",
        "payloadType": "json",
        "x": 310,
        "y": 1780,
        "wires": [
            [
                "f73459d8a1dec0e1",
                "8120bc819f267c24"
            ]
        ]
    },
    {
        "id": "f73459d8a1dec0e1",
        "type": "debug",
        "z": "f55ebfe97fab5883",
        "name": "debug 30",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 480,
        "y": 1780,
        "wires": []
    },
    {
        "id": "dfa807b92c4aaf81",
        "type": "mqtt out",
        "z": "f55ebfe97fab5883",
        "name": "Domoticz In",
        "topic": "domoticz/in",
        "qos": "1",
        "retain": "false",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "38b35487299a036d",
        "x": 670,
        "y": 1720,
        "wires": []
    },
    {
        "id": "68787371e069472f",
        "type": "mqtt in",
        "z": "f55ebfe97fab5883",
        "name": "Shelly Cover Status In",
        "topic": "shelly2pmg3-34cdb0774d4c/status/cover:0",
        "qos": "1",
        "datatype": "auto-detect",
        "broker": "7aff5cd755ba2941",
        "nl": false,
        "rap": true,
        "rh": 0,
        "inputs": 0,
        "x": 260,
        "y": 1720,
        "wires": [
            [
                "8120bc819f267c24",
                "f73459d8a1dec0e1"
            ]
        ]
    },
    {
        "id": "38b35487299a036d",
        "type": "mqtt-broker",
        "name": "Raspberry Pi 1",
        "broker": "192.168.10.51",
        "port": "1883",
        "clientid": "",
        "autoConnect": true,
        "usetls": false,
        "protocolVersion": "4",
        "keepalive": "60",
        "cleansession": true,
        "autoUnsubscribe": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closeQos": "0",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "0",
        "willPayload": "",
        "willMsg": {},
        "userProps": "",
        "sessionExpiry": ""
    },
    {
        "id": "7aff5cd755ba2941",
        "type": "mqtt-broker",
        "name": "Jonas_MQTT_Server",
        "broker": "mqtt.jonasnet.nl",
        "port": "1883",
        "clientid": "",
        "autoConnect": true,
        "usetls": false,
        "protocolVersion": "4",
        "keepalive": "60",
        "cleansession": true,
        "autoUnsubscribe": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closeQos": "0",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "0",
        "willPayload": "",
        "willMsg": {},
        "userProps": "",
        "sessionExpiry": ""
    }
]
Try it and let me know.

Regards

The
Daro1003
Posts: 193
Joined: Monday 14 November 2022 12:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Poland
Contact:

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

Post by Daro1003 »

In Domoticz , with the theme, you use (Machinon), the Blinds Percentage and STOP button does not work.
With the default theme, it works. but it does not look so nice, as the slider is too long.
It's not a theme issue for me because I've tested it in other themes and it's the same.
StopMotyw3.png
StopMotyw3.png (38.7 KiB) Viewed 1195 times
StopMotyw2.png
StopMotyw2.png (121.92 KiB) Viewed 1195 times
StopMotyw1.png
StopMotyw1.png (38.39 KiB) Viewed 1195 times
If the stop works for me in Dashticz and in domoticz, then the long slider doesn't bother me as long as the STOP and SLIDER work, but neither of them work for me.
So we will use in Domoticz a Swith of type Blinds Percentage.
Ok ok, if only it could be run this way it would be a success.

I will try to configure it, if I don't know something I will write another post.
Daro1003
Posts: 193
Joined: Monday 14 November 2022 12:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Poland
Contact:

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

Post by Daro1003 »

Hey Hey

I have configured Domoticz MQTT nodes and the connection is green.

The problem is with Shelly as you can see there is no connection:
brak połączenia.png
brak połączenia.png (49.2 KiB) Viewed 1153 times
I thought it might be a missing shelly ID so I put this in the missing place:
brak ID.png
brak ID.png (22.63 KiB) Viewed 1153 times
brakTopic.png
brakTopic.png (17.11 KiB) Viewed 1153 times
But unfortunately I don't know what it should be like so that I could insert it.
Daro1003
Posts: 193
Joined: Monday 14 November 2022 12:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Poland
Contact:

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

Post by Daro1003 »

If I set Domoticz IP 192.168.40 in these shelly nodes I have a connection.
IPDomoticz.png
IPDomoticz.png (47.6 KiB) Viewed 1151 times
1. In Domoticz, up and down work, but be careful, in reverse order

2. Status bar does not work.

It looks like something is still wrong.
User avatar
FireWizard
Posts: 1905
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

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

Post by FireWizard »

Hello @Daro1003,

Regarding your post of 19 Apr 2025, 19:23

You did all kinds of things, that I not asked you to do so and that were wrong.

I said in my previous post:
1. For each MQTT node (both MQTT Input and MQTT Output), you have to insert your own configuration.
As your Domoticz and your Mosquitto runs on the same hardware, it is the same IP address 192.168.0.40.
For now and in the future, you use the same MQTT configuration for all MQTT nodes, both MQTT input as MQTT output.

So lets forget that post!

Your post of 19 Apr 2025, 19:49
If I set Domoticz IP 192.168.40 in these shelly nodes I have a connection.
That is exactly, what I mean.and I hope, you have cleaned up the nodes, so they are similar to the nodes, I sent you.
1. In Domoticz, up and down work, but be careful, in reverse order
Okay, up and down works, but in reverse order.
You can correct that by opening in Domoticz the configuration of your switch, by clicking "Edit".

The following window will open:

Screenshot_Blinds-Reverse.png
Screenshot_Blinds-Reverse.png (179.66 KiB) Viewed 1028 times

Tick one of the indicated check boxes and test again.
2. Status bar does not work.
What do you mean with "Status Bar"?

Is that the top bar of the Switch widget.
If so, show us a picture of what is wrong.

Or do you mean the slider?

In that case, test it as shown in in your post of 15 Apr 2025, 12:50.
Press "pos,50" and report back.

Let me know.

Regards
Daro1003
Posts: 193
Joined: Monday 14 November 2022 12:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Poland
Contact:

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

Post by Daro1003 »

So in the shelly nodes I remove the address you entered - 192.168.0.49 and give the RBPI address 192.168.0.40, i.e. I change the address that is already in the imported node.
Poprawka.png
Poprawka.png (88.39 KiB) Viewed 990 times
After this change the connection is green.
1. If I click the local switch and lower the blinds, for example, halfway, the slider does not change its place in doomoticz.
2. Changing these settings in Domoticz does not help.

If I set it this way:
zaznaczenie.png
zaznaczenie.png (17.58 KiB) Viewed 990 times
Works very poorly, the readings on the slider and the % indicator are unrealistic.
Only the open and close buttons work properly, while the slider and % indicator do not work properly and do not indicate the correct position.
I can't explain it better, I click on the slider to 15%, the roller blind is sometimes set 15% from the top and sometimes 15% from the bottom, very strange behavior.

P.S
In a typical shelly node, this works correctly.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest