Shelly PRO 2PM not recognized as device

For devices supporting the Auto Discovery feature. Like ZWaveJS2MQTT, Zigbee2MQTT.

Moderator: leecollings

Post Reply
jrachwol
Posts: 8
Joined: Monday 19 April 2021 17:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Shelly PRO 2PM not recognized as device

Post by jrachwol »

I installed the latest version of Shelly MQTT.
After Shelly MQTT hardware configuration, the Shelly PRO 2PM does not appear on device list.
On the hardware list there is no port number for Shelly MQTT.
"Shelly MQTT" is configured with 127.0.0.1:1883, the same as "MQTT Client Gateway with LAN interface".

What is possible to do with that?
Attachments
202201170914_01.png
202201170914_01.png (46.81 KiB) Viewed 1433 times
mk01
Posts: 5
Joined: Thursday 22 December 2022 5:46
Target OS: Linux
Domoticz version:
Contact:

Re: Shelly PRO 2PM not recognized as device

Post by mk01 »

jrachwol wrote: Tuesday 17 January 2023 1:49 What is possible to do with that?
your device is gen2 device. check this topic - 3,4 last messages.

viewtopic.php?p=297821#p297821

mk
Huib
Posts: 3
Joined: Monday 06 February 2023 9:55
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Shelly PRO 2PM not recognized as device

Post by Huib »

Hi, have you been able to solve the problem with the Shelly Pro 2PM shutter switch and Domoticz?

Thanks.
lwolf
Posts: 216
Joined: Saturday 10 November 2018 18:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Hungary
Contact:

Re: Shelly PRO 2PM not recognized as device

Post by lwolf »

Huib wrote: Monday 08 May 2023 15:46 Hi, have you been able to solve the problem with the Shelly Pro 2PM shutter switch and Domoticz?
https://github.com/enesbcs/shellyteacher4domo/issues/13
Xavier82
Posts: 178
Joined: Tuesday 07 June 2016 22:09
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Netherlands
Contact:

Re: Shelly PRO 2PM not recognized as device

Post by Xavier82 »

I got it fixed with this script code (which needs to be entered in ShellyPlus2PM script:

Code: Select all

let CONFIG = {
  shelly_id: null,
};

Shelly.call("Shelly.GetDeviceInfo", {}, function (result) {
  if (result && result.id) {
    CONFIG.shelly_id = result.id;
    MQTT.subscribe(
      buildMQTTStateCmdTopics("rpc"),
      DecodeDomoticzFaultyJSON
    );
  } else {
    console.log("Failed to get Shelly device info:", result);
  }
});

function buildMQTTStateCmdTopics(topic) {
  let _t = topic || "";
  return CONFIG.shelly_id + "/" + _t;
}

/**
 * @param {string} topic
 * @param {string} message
 */
function DecodeDomoticzFaultyJSON(topic, message) {
  try {
    let trimmedMessage = message.trim();
    if (trimmedMessage) {
      let req = JSON.parse(trimmedMessage);
      for (let r in req) {
        if (r.indexOf("GoToPosition") !== -1) {  // Check if "GoToPosition" is present in the key
          SetCoverPosition(req[r]);
          break;
        }
      }
    }
  } catch (error) {
    console.log("Error parsing JSON:", error);
  }
}

function SetCoverPosition(position) {
  Shelly.call("Cover.GoToPosition", {
    id: 0,
    pos: position,
  });
}
This works on ShellyPlus2PM firmware 1.0.0

Blind/Cover devices are being detected in Domoticz when using ShellyTeacher4Domo.
Keep in mind that you need to add the devices through Users \ set devices in Domoticz V2023.2 to be able to see them as device.
With this script also able to control cover with slider in Domoticz.
Devices are being updated based on MQTT.
ella5
Posts: 1
Joined: Saturday 28 October 2023 10:30
Target OS: Linux
Domoticz version:
Location: india
Contact:

Re: Shelly PRO 2PM not recognized as device

Post by ella5 »

How to fix the Shelly PRO 2PM not being recognized as a device in Domoticz using the ShellyPlus2PM script? I would be very happy if you could let me know, thanks
lwolf
Posts: 216
Joined: Saturday 10 November 2018 18:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Hungary
Contact:

Re: Shelly PRO 2PM not recognized as device

Post by lwolf »

ella5 wrote: Thursday 02 November 2023 10:00 How to fix the Shelly PRO 2PM not being recognized as a device in Domoticz using the ShellyPlus2PM script? I would be very happy if you could let me know, thanks
You have to use ShellyTeacher script.
https://github.com/enesbcs/shellyteacher4domo

There is a video about it:
https://www.youtube.com/watch?v=3PvYhFIsVN4

In case you also need ShellyPlus2PM position device, you need Domoticz 2023 beta 15601 or later and enable "MQTT Control" option at the Shelly device side.
https://github.com/enesbcs/shellyteache ... r-Position
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest