Shelly PM1 and EM3

Hi

I cannot get Shelly PM1 with 3x ext. temperature sensors to work with the buildin Shelly drivers. It only shows an relay and an button.

The Shelly EM3 does not work with the buildin drivers. It only shows an relay and an button.

Both the above units works fine in shelly cloud app

regards
Per

I have been using the following driver for my Shelly 1. It is supposed to support multiple models, so might also work for you.

https://raw.githubusercontent.com/ShellyUSA/Hubitat-Drivers/master/Shelly-as-a-Switch.groovy

Let me know if it works, and welcome to the community!

Any issue please tag me as I am the driver developer for these devices

1 Like

Hi thanks
I got ext-sensors to work with theese changes on your Shelly Switch Relay Driver.
Now next is to get EM3 to work to show all 3 phases on your Shelly Switch Relay Driver.
The Shelly Switch Relay Driver is a very nice driver compared to the buildin drivers.

best regards
Per

attribute "NTPServer", "string"
attribute "ext1_temperature", "number" /************ added /
attribute "ext1_humidity", "number" /
*** added *********/
attribute "ext2_temperature", "number"
attribute "ext2_humidity", "number"
at

// Externel Sensors Shelly 1 and 1PM only
if (external_sensors) {
/************ changed below ********/
if (obs.ext_temperature != null) {
t_unit = obs.ext_sensors.temperature_unit
state.temperature_unit = t_unit
ext_switch = obs.ext_switch
/
*************** generates an exception **********************
if (obs.ext_switch['0'] != null) {
sendEvent(name: "ext_switch_state", value:obs.ext_switch['0'].input)

                if (external_contact_reversed == "No")
                {
                if (obs.ext_switch['0'].input == 0)
                    sendEvent(name:"contact", value: "open", isStateChange: false, descriptionText: "Contact was Opened")
                
                if (obs.ext_switch['0'].input == 1)
                    sendEvent(name:"contact", value: "closed", isStateChange: false, descriptionText: "Contact was Closed")
                }
              if (external_contact_reversed == "Yes")
                {
                if (obs.ext_switch['0'].input == 1)
                    sendEvent(name:"contact", value: "open", isStateChange: false, descriptionText: "Contact was Opened")
                
                if (obs.ext_switch['0'].input == 0)
                    sendEvent(name:"contact", value: "closed", isStateChange: false, descriptionText: "Contact was Closed")
                }
            }

/
/
*********** changed to ext1_temperature *********/
if (obs.ext_temperature['0'] != null) sendEvent(name: "ext1_temperature", unit: t_unit, value: obs.ext_temperature['0']."t${t_unit}")
if (obs.ext_humidity['0'] != null) sendEvent(name: "ext1_humidity", value: obs.ext_humidity['0'].hum)

            if (obs.ext_temperature['1'] != null) sendEvent(name: "ext2_temperature", unit: t_unit, value: obs.ext_temperature['1']."t${t_unit}")
            if (obs.ext_humidity['1'] != null) sendEvent(name: "ext2_humidity", value: obs.ext_humidity['1'].hum)

            if (obs.ext_temperature['2'] != null) sendEvent(name: "ext3_temperature", unit: t_unit, value: obs.ext_temperature['2']."t${t_unit}")
            if (obs.ext_humidity['2'] != null) sendEvent(name: "ext3_humidity", value: obs.ext_humidity['2'].hum)
        }
        else{
            logDebug "NO EXT SENSORS"
        }

I have no way to test any code for this in the US as we use single phase.

3-phase is quite common in the USA for commercial and light industrial. Maybe a friend has a shop or other commercial property?