Edge Shelly drivers for Gen1 and Gen2 Devices

This is change icon:

Originally there was a door sensor, I did not like it, I changed the icon with a switch.

After I read that maybe making it appear a contact sensor, is something wanted specifically to use with alexa automations. Sorry if so, I do not use it, I hadn’t thought about it.

In the original community-created virtual (Groovy) switch/sensor from bjPierron, The “off“ and “closed“ were considered the resting states so those were equivalent (like a sensor on a door) so on equalled open.

This may have been because one of the original very popular use cases with a physical sensor was door opens, Alexa plays chimes. So you turn the switch on in order to set the sensor to open. So that may be what people are used to.

I think you only need to consider how the capabilities are presented. ‘On’ and ‘Open’ are considered the active states of switches and contacts.

1 Like

Interesting perspectives about the relationship of switch and contact. Here was my logic:

These are relay devices. When a relay is turned ‘on’ or ‘energized’ its contact closes and power output is ‘on’. When a relay is turned ‘off’ or ‘de-energized’, its contact opens and power output is ‘off’.

Now I know some relays can be programmed or configured to behave differently, but this is the conventional operation. So to me, it’s counter-intuitive to equate ‘on’ to an ‘open’ contact, even though that may be the way SmartThings defined their capability presentation.

Maybe the net of all this is that I should add a configurable device setting to flip the relationship between switch and contact.

1 Like

I’ve pushed out a driver update. Look for this version to confirm you have the right one:

2022-01-27T07:26:48.952405

I’m still battling with communication problems with my 2.5. It doesn’t like to always respond, so I’m still trying to address that to make sure it’s going to be dependable. I may need to get Shelly tech support to help me on that one.

I was able to do some limited testing in 2.5 roller mode, but since I don’t have a real roller shade I haven’t been able to exercise everything, so am looking forward to feedback to see if that is working better now. (@dusanhauko, @lemonade30us )

The Door/Window device has some bug fixes. (@Hafo)

As I mentioned earlier, this update also includes support for the Dimmer 1/2 device.

Looking forward to any feedback and I always welcome log files :slight_smile:

1 Like

I was wondering, how can you manage shelly devices tied to the cloud and other edges at the same time. I ask this because having both a Shelly 3em and a Shelly Air I think that difficultly, they will be implemented with edge and therefore I will have to share with edge and cloud.
The edge devices I can insert them one by one at will thanks to this fantastic project, but those in the cloud if I’m not mistaken are all added to each synchronization. Will I have to keep duplicates of the same device?

@TAustin thank you for your work!
Everything can be seen in the applications - the error is only in the logs.
door window sensor - error on close:

2022-01-27T08:51:14.985646268+00:00 DEBUG Shelly Device Driver V1 Accepted connection from 192.168.1.221:25305
2022-01-27T08:51:14.989344643+00:00 PRINT Shelly Device Driver V1 Firstline: GET /2680eae5-147e-4164-854b-55543e1b647e/contact/close HTTP/1.1
2022-01-27T08:51:14.992724143+00:00 PRINT Shelly Device Driver V1 Headerline: Host: 192.168.1.161:54195
2022-01-27T08:51:14.996093893+00:00 PRINT Shelly Device Driver V1 Headerline: Content-Length: 0
2022-01-27T08:51:14.999493310+00:00 DEBUG Shelly Device Driver V1 content-length 0
2022-01-27T08:51:15.002530477+00:00 PRINT Shelly Device Driver V1 Headerline: User-Agent: Shelly/20211109-125737/v1.11.7-g682a0db (SHDW-2)
2022-01-27T08:51:15.005994477+00:00 PRINT Shelly Device Driver V1 Received JSON: 0
2022-01-27T08:51:15.018440560+00:00 INFO Shelly Device Driver V1 Message for Shelly Contact 3: endpoint=/2680eae5-147e-4164-854b-55543e1b647e/contact/close
2022-01-27T08:51:15.022263393+00:00 INFO Shelly Device Driver V1 <Device: 2680eae5-147e-4164-854b-55543e1b647e (Shelly Contact 3)> emitting event: {“component_id”:“main”,“state”:{“value”:“closed”},“attribute_id”:“contact”,“capability_id”:“contactSensor”}
2022-01-27T08:51:15.033793060+00:00 ERROR Shelly Device Driver V1 Door/Window: Unexpected action: close
2022-01-27T08:51:15.158235643+00:00 DEBUG Shelly Device Driver V1 Accepted connection from 192.168.1.221:8870
2022-01-27T08:51:15.161611935+00:00 PRINT Shelly Device Driver V1 Firstline: GET /2680eae5-147e-4164-854b-55543e1b647e/contact/report?state=close&lux=217&temp=19.90&vibration=0&id=shellydw2-E8DB84D32483 HTTP/1.1
2022-01-27T08:51:15.164917060+00:00 PRINT Shelly Device Driver V1 Headerline: Host: 192.168.1.161:54195
2022-01-27T08:51:15.169221393+00:00 PRINT Shelly Device Driver V1 Headerline: Content-Length: 0
2022-01-27T08:51:15.172552060+00:00 DEBUG Shelly Device Driver V1 content-length 0
2022-01-27T08:51:15.175543977+00:00 PRINT Shelly Device Driver V1 Headerline: User-Agent: Shelly/20211109-125737/v1.11.7-g682a0db (SHDW-2)
2022-01-27T08:51:15.185749810+00:00 PRINT Shelly Device Driver V1 Received JSON: 0
2022-01-27T08:51:15.201716393+00:00 INFO Shelly Device Driver V1 Message for Shelly Contact 3: endpoint=/2680eae5-147e-4164-854b-55543e1b647e/contact/report?state=close&lux=217&temp=19.90&vibration=0&id=shellydw2-E8DB84D32483
2022-01-27T08:51:15.209473352+00:00 INFO Shelly Device Driver V1 <Device: 2680eae5-147e-4164-854b-55543e1b647e (Shelly Contact 3)> emitting event: {“component_id”:“main”,“state”:{“value”:“closed”},“attribute_id”:“contact”,“capability_id”:“contactSensor”}
2022-01-27T08:51:15.224243102+00:00 INFO Shelly Device Driver V1 <Device: 2680eae5-147e-4164-854b-55543e1b647e (Shelly Contact 3)> emitting event: {“component_id”:“main”,“state”:{“value”:“inactive”},“attribute_id”:“acceleration”,“capability_id”:“accelerationSensor”}
2022-01-27T08:51:15.239130977+00:00 INFO Shelly Device Driver V1 <Device: 2680eae5-147e-4164-854b-55543e1b647e (Shelly Contact 3)> emitting event: {“component_id”:“main”,“state”:{“unit”:“C”,“value”:19.9},“attribute_id”:“temperature”,“capability_id”:“temperatureMeasurement”}
2022-01-27T08:51:15.258187810+00:00 INFO Shelly Device Driver V1 <Device: 2680eae5-147e-4164-854b-55543e1b647e (Shelly Contact 3)> emitting event: {“component_id”:“main”,“state”:{“value”:217},“attribute_id”:“illuminance”,“capability_id”:“illuminanceMeasurement”}

1 Like

Hello,
With your driver my test Shelly 2.5 works flawlesly.
Though i would like different layout order in Smartthings.

I’d like:

  • MAIN (% slider, 3 buttons (close, open, pause)
  • Power meter relay1
  • Power meter relay2
  • refresh button
  • at the bottom: Temp … signal strenght…
    Is this possible ?

This is now:

I’l try Dimmer2 also (own 2 of them) :slight_smile:

1 Like

Thank-you! That one ERROR message is erroneous and will be removed with the next update.

Hello - I had mentioned earlier that I have not finalized the presentation for any of these devices yet, so yes, I will be re-ordering the elements on the 2.5 device details screen. I’ll see if I can match your suggestion.

1 Like

When you refer to cloud are you talking Shelly’s own cloud or are you referring to Groovy/DTH versions of Shelly devices? What would be your need to have both?

As you said, right now, with my driver, you can add these Shelly devices individually, however when I add the auto-discovery code, they will be automatically found on your LAN and added to SmartThings when you do an Add device / Scan for nearby devices. The one exception may be battery-powered devices which I don’t think can keep advertising themselves on the network in order to preserve battery life. So I will probably end up keeping the Shelly device creator device approach for those.

So ultimately, if you have another cloud-based driver that is also scanning for Shelly devices, then I suppose you could end up with duplicate devices. It’s a good question, and we will have to figure this out together!

2 Likes

Thank you!! I don’t have any other edge or DH drives looking for Shellys in my network, I was talking about shelly’s native, cloud-based integration. When I add this integration, all devices are found and added. If I delete one, then he returns, because he finds it and adds it. I would gladly do without shelly cloud integration, but my shelly 3em is shelly Air they need that to work, unless you create an edge drive for them but I don’t think it’s worth it.
I don’t think many users have 3em shelly and even less shelly Air

Edit: shelly Air work with Shelly1PM device selected.

Only problem for me is shelly 3em, if I solve it, I can Leaving the cloud

Someone else has asked for the 3eM, so it is on my to-do list! I am not finding any info on Shelly “Air”; can you point me to which product that is please?

1 Like

It’s a WiFi air cleaner.

https://shelly.cloud/knowledge-base/devices/shelly-air/

1 Like

Thanks; unfortunately it is not even listed as a product supported in the HTTP API documentation, so it may only have control via Shelly’s own cloud. I’ll keep looking…

Limited production. They distributed some to the initial backers but after that it was sold for commercial use.

2 Likes

Can you try to reach your Shelly Air via a browser? Just type in its IP address and see if you get a web page coming up. Then if that works, try these endpoints:

192.168.1.xxx/status

192.168.1.xxx/settings/actions

Yes work. :+1:

Log: 192.168.1.xxx/status
{“wifi_sta”:{“connected”:true,“ssid”:“Campyhome”,“ip”:“192.168.1.21”,“rssi”:-68},“cloud”:{“enabled”:true,“connected”:true},“mqtt”:{“connected”:false},“time”:“00:07”,“unixtime”:1643324836,“serial”:2727,“has_update”:false,“mac”:“68C63AFAF5A4”,“cfg_changed_cnt”:2,“actions_stats”:{“skipped”:0},“relays”:[{“ison”:false,“has_timer”:false,“timer_started”:0,“timer_duration”:0,“timer_remaining”:0,“overpower”:false,“source”:“http”}],“meters”:[{“power”:0.00,“overpower”:0.00,“is_valid”:true,“timestamp”:1643328436,“counters”:[0.000, 0.000, 0.000],“total”:11289}],“inputs”:[{“input”:0,“event”:"",“event_cnt”:0}],“temperature”:34.37,“overtemperature”:false,“tmp”:{“tC”:34.37,“tF”:93.86, “is_valid”:true},“total_work_time”:7085491,“ext_sensors”:{“temperature_unit”:“C”},“ext_temperature”:{“0”:{“hwID”:“28fef43a2c1901ba”,“tC”:18.38,“tF”:65.08}},“ext_humidity”:{},“update”:{“status”:“idle”,“has_update”:false,“new_version”:“20211109-130841/v1.11.7-g682a0db”,“old_version”:“20211109-130841/v1.11.7-g682a0db”},“ram_total”:50744,“ram_free”:38028,“fs_size”:233681,“fs_free”:144576,“uptime”:121391}

Log 192.168.1.xxx/settings/actions
{“actions”:{“btn_on_url”:[{“index”:0,“urls”:,“enabled”:false}],“btn_off_url”:[{“index”:0,“urls”:,“enabled”:false}],“longpush_url”:[{“index”:0,“urls”:,“enabled”:false}],“shortpush_url”:[{“index”:0,“urls”:,“enabled”:false}],“out_on_url”:[{“index”:0,“urls”:[“http://192.168.1.2:37801/a5a37203-7284-4f0b-a2c1-7d1e19e4011b/relay/0/on"],“enabled”:true}],“out_off_url”:[{“index”:0,“urls”:[“http://192.168.1.2:37801/a5a37203-7284-4f0b-a2c1-7d1e19e4011b/relay/0/off”],"enabled”:true}]}}

2 Likes

Great! That means we have hope. Looks like you have something running on your LAN at 192.168.1.2 that is getting updates from this device already.

From what I can see it supports the following:

  • on/off
  • power meter
  • temperature
2 Likes