Edge Shelly device support discussion

I was able to do some testing today and think I may have found the cause of the issue. So hold off on doing anything more until I get you the updated driver, which I should have for you soon…

1 Like

OK, I have a driver update for you to try: Version 2023-01-21T03:40:52.181961653

The corrects a problem I found in the input component logic which should solve the issue you were having with the I4. In fact it would have affected any device with an input component.

If this has everything working OK for you, I’d like to get the Plus 2PM supported added. I’m glad you have that one, since I’m going to need some help. It has a bit more complex configuration since it can be set up either in switch profile or ‘cover’ profile mode (for curtains, blinds, garage doors, etc.). Let me know what mode you use yours. Also, if you could please do this from a browser, substituting the IP address of your Plus 2PM:

http://<ip address>/rpc/Shelly.GetDeviceInfo

And DM me the results, I would appreciate it. I will need to issue this command to get the profile it is configured to use. Thanks!

1 Like

Hi @TAustin,

I forced the driver update to the new one: Version 2023-01-21T03:40:52.181961653

Right away both I4 are working normal. I will keep an eye and test. If one of them start having problems I will do what you propose before and give you that info.

About Plus 2PM I just have one on the switch profile. All my blinds are the old GEN1 2.5.

But if you want that I change the profile, to get some data from it, I will do it no problem.

I already sent you DM with JSON data retrieved from (http:///rpc/Shelly.GetDeviceInfo).

Thank you.

1 Like

Hi again, thanks for your reply and sorry if mine comes much later. What I wanted to do is precisely what you suggested: to use the input state (driven by the button connected to the SW port on the shelly) of my Shellys 2.5pm as generic button in ST that I could then in turn as a trigger for the automations. In other words I wanted to use the SW port as I would with those on a Shelly i3/i4. If that could be added to your driver would be great! In this way I could manage everything from within ST.

My other ideas were more of workarounds: use either your edgebridge or MQTT to make a virtual switch that would listen to the button presses on the Shelly. I had a very basic python code running an http server that I would then trigger via the Shelly’s built-in Action I/O option. While this “works” I think there are too many unnecessaries hops involved.

Hi
I managed to delete the device creator, and now I can’t enrol again as SmartThings thinks I have already enrolled, neither can I remove the driver as it’s in use, how can I start again?
Thanks


![Screenshot 2023-02-01 at 08.57.41|690x290]

Hi - Do you have any other devices that got created with the driver? If so, you won’t be able to remove the driver until they are deleted. Check both the room your hub device is in and also the No room assigned room. You can also try using my API Browser+ app whch would allow you to see pretty quickly if you have other devices for that driver.

You don’t have to re-enroll your hub with a channel; you typically only do that once unless you explicitly unenrolled from it.

You didn’t say WHY you were having to delete and restart everything - was there a problem you were having?

Hi

I fixed it, i have two Smartthngs hub’s in two locations, it was the second loaction which had devices with your tool, i had to delete those and then i could re enable in both locations, thanks

Brett

1 Like

Hi again! I am still working out some complex automations (changing the behavior of the physical buttons attached to the shellys depending the time of the day) and while looking around I immediately noticed that your Shelly driver inject a callback function/url into the devices for the turn on/off action (I imagine to promptly update the status). This is similar to what happens with the node-red/shelly integration so I’m not surprised about that, the news is (at least to me) instead that you can talk with an edge driver directly without needing the edgebride.

So in a broader view, wouldn’t be advantageous to develop a virtual devices driver that just listen to http requests? In this way we could use the button attached to a Shelly as a separate button in ST and use it to trigger various automations.

Hi there. I think using MQTT would be a better way to go than HTTP. The problem with trying to use HTTP that way with Edge drivers is that you can’t know what the driver’s port number is going to be since it is assigned randomly every time the driver restarts.

I do still intend to add the input fields to the 2.5 similar to the i3/i4. I’m sorry I haven’t gotten that done yet, but I’ll try to focus on it over the coming week.

1 Like

SHELLY GEN2 DRIVER UPDATE

I’ve been doing quite a bit of work on the GEN2 driver and it now supports the following devices:

  • Plus 1
  • Plus 1PM switch and cover profiles
  • Plus 2PM
  • Plus I4
  • Plug US
  • Pro 1, 1PM
  • Pro 2
  • Pro 2PM switch and cover profiles
  • Pro 4PM

Note that there as been very limited testing on the cover profile (window shade) for the 1PM and 2PM, so if there is anyone out there that has that device running in cover mode, it would be great to have it thoroughly exercised.

I’ve also been working on device discovery to (1) switch over to use the new built-in mDNS scan capability in Edge, (2) handle multi-profile device discovery, and (3) make sure that multiple devices are found and created without problems. A huge debt of gratitude goes out to @dcnilas11 for helping me dial in the optimum discovery parameters.

UPDATE: I should mention that although there is a Creator device created when you first run an Add device/Scan for nearby devices, you should not use it to manually create your devices. Instead, do a second Add device / Scan for nearby devices and your Shelly Gen2 devices will then be automatically discovered and created. The creator device is for temporary testing and will be removed in my next update. You’ll also notice an IP address field in the individual Shelly device Settings; you can ignore it.


Driver Version: 2023-02-05T01:01:08.462055227 is available on my test channel.

2 Likes

@TAustin Thanks for these Edge Drivers!

I have a new Shelly Door/Window 2 that no longer updates its Status in SmartThings (even though it quickly responds on the Shelly Cloud & App).

Here’s what I did and it was working great for a day/two:

  1. Reserved an IP on Router AND made IP Static in Shelly Interface
  2. Installed Shelly Device Driver v1.7 (2023-01-18T17…)
  3. Created a Door/Window 2
  4. Edited Settings to Fahrenheit and the corresponding IP address above

Then I had to shut down my Samsung SmartThings v2 Hub and Access Point to move to another room. Upon powering back up, the Door/Window 2 is no longer responsive to any events.

The Door/Window 2 is within 15 feet of the SmartThings Hub & Access Point.

Things I’ve Tried (without success):

  • Battery Pull (note battery is at 95%)
  • Changing the Door/Window 2 IP address in the Device Card, waited a minute, then changed back to correct IP.
  • Deleting the Door/Window 2 Device Card and creating from scratch.
  • Push Pin (front cover) to Wake Up

Of note, I have a Shelly Plus 1 installed on the same Hub and it’s very responsive in SmartThings.

Also of note, I can press “Refresh” in the Device Card after moving the magnet to Close or Open and it will sometimes indicate the correct status.

Any suggestions to get this working again?

Hi John - I have moved support for Shelly Gen1 battery-powered devices to a separate driver (“Shelly Gen1 MQTT V1” available on the same channel) that requires MQTT. It was found that the battery-powered devices like the door/window could not be reliably supported through an HTTP interface because those devices sleep and don’t stay active on the network. There is one exception to this, which is the Shelly Motion Sensor, which does stay active on the network and works fine with the regular Gen1 Edge driver.

Any time you try to send these battery-powered devices a command - whether it’s for controlling, discovering, or setting up, it will likely not respond. You may have had it working for a time, but as soon as you have to restart the driver or change IP addresses like you did, getting it to start working again may be a challenge.

Temporarily, you could probably get things going again by doing this:

  • Go into the SmartThings device Settings screen and temporarily change the configured IP address to something else (unused) and save
  • Force the device awake - either by pressing its wake button or taking out and replacing the battery.
  • Immediately - before the device goes back to sleep - change the SmartThings device Setting IP address back to the correct one and save it. This should cause the driver to re-establish contact with the device and tell it where to reach the driver when it has state changes.

This will only continue to work until the driver restarts for whatever reason (hub reboot, etc.). Then you would have to repeat this procedure.

The more permanent solution is to set up an MQTT broker and use my Shelly MQTT driver. You need to enable MQTT for the Shelly device through the Shelly app.

1 Like

Good Morning @TAustin,

Thank you for the informative overview… it really helps in choosing various devices going forward!

I performed the steps you suggested to get it back on line and it worked perfectly!

1 Like

I have Shelly Plus 1 Switch (non UL) working well as a Toggle Button within the Shelly Cloud App (icon going gray when pressed for 2 seconds, then turning back to color)

In SmartThings, it’s working, however the status of the Icon (gray or color) and the On/Off indication does not seem to adhere to the Toggle-After setting.

When I click the Power Button, it turns the Icon Color to Gray and the Status to Off, but it does not “Toggle” back to Colored/On.

Should I be setting it up differently in SmartThings ?

Am I using the right driver for this device ?

image

image

image

I don’t think it’s anything you are doing wrong necessarily. My assumption in the driver was that the device would send an update back after it performed the toggle, but maybe that is not happening.

EDIT: Sometimes the dashboard is slow to update; did you try monitoring the switch state within the Controls screen to see if it got toggled?

Would it be possible for you to get a CLI log of this sequence so we can see what is/isn’t happening?

1 Like

Hi @TAustin,

Thanks for the reply.

I’ve definitely watched the Controls with the Device Card open for minutes at a time. It only turns On or Off, it doesn’t “toggle” back automatically.

I ran a CLI Log and toggled it 3 times while it was logging.

Let me know if this is what you were looking for and if it helps.

Thanks again,

John


Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\Users\John> smartthings edge:drivers:logcat --hub-address=192.168.1.11
──────────────────────────────────────────────────────────────────────────

Driver Id Name

──────────────────────────────────────────────────────────────────────────
1 e8a0ea41-b91f-41ac-bf5c-1fe8542bb747 Aeotec Door Window Sensor 7
2 722a5d81-75e0-48de-9895-6ce5a70a2b8a Aeotec Door Window Sensor 7 Pro
3 8f390da7-c66d-4245-9ba9-e431f95c78ec Shelly Device Driver V1.7
4 f3258c1d-b6e9-424d-8b3f-b1e8fe51c4ca Shelly Gen2 Device Driver V1.2
5 0fd9a9a4-8863-4a83-97a7-5a288ff0f5a6 Virtual Devices V2
──────────────────────────────────────────────────────────────────────────
6 6e9a0bbc-9e0d-48f4-adc2-b631c4ab0b0f Z-Wave Siren
7 ea748a00-7990-4c87-8275-e15d45d9b40c Z-Wave Siren Mc
──────────────────────────────────────────────────────────────────────────
? Select a driver. 4
connecting… connected
2023-02-07T01:04:23.344379826+00:00 TRACE Shelly Gen2 Device Driver V1.2 Received event with handler capability
2023-02-07T01:04:23.353652148+00:00 INFO Shelly Gen2 Device Driver V1.2 <Device: 078df96a-66f3-4767-8888-b132930c21d6 (Gate 1 Open/Close)> received command: {“args”:{},“capability”:“switch”,“command”:“on”,“component”:“main”,“positional_args”:{}}
2023-02-07T01:04:23.360567353+00:00 TRACE Shelly Gen2 Device Driver V1.2 Found CapabilityCommandDispatcher handler in thisDriver
2023-02-07T01:04:23.361312591+00:00 INFO Shelly Gen2 Device Driver V1.2 main switch turned on
2023-02-07T01:04:23.361969800+00:00 INFO Shelly Gen2 Device Driver V1.2 <Device: 078df96a-66f3-4767-8888-b132930c21d6 (Gate 1 Open/Close)> emitting event: {“attribute_id”:“switch”,“capability_id”:“switch”,“component_id”:“main”,“state”:{“value”:“on”}}
2023-02-07T01:04:23.364958545+00:00 DEBUG Shelly Gen2 Device Driver V1.2 Sending message: {“id”:50,“method”:“Switch.Set”,“src”:“EdgeDriver”,“jsonrpc”:“2.0”,“params”:{“id”:0,“on”:true,“toggle_after”:2}}
2023-02-07T01:04:23.393148256+00:00 DEBUG Shelly Gen2 Device Driver V1.2 Gate 1 Open/Close device thread event handled
2023-02-07T01:04:24.040443249+00:00 DEBUG Shelly Gen2 Device Driver V1.2 WS Receive TEXT frame payload: {“id”:50,“src”:“shellyplus1-a8032abd018c”,“dst”:“EdgeDriver”,“result”:{“was_on”:false}}
2023-02-07T01:04:24.044864539+00:00 WARN Shelly Gen2 Device Driver V1.2 No matching device found for Shelly ID shellyplus1-a8032abd018c
2023-02-07T01:04:24.076619962+00:00 DEBUG Shelly Gen2 Device Driver V1.2 WS Receive TEXT frame payload: {“src”:“shellyplus1-a8032abd018c”,“dst”:“EdgeDriver”,“method”:“NotifyStatus”,“params”:{“ts”:1675731864.86,“switch:0”:{“id”:0,“output”:true,“source”:“WS_in”,“timer_duration”:2.00,“timer_started_at”:1675731864.86}}}
2023-02-07T01:04:24.080909254+00:00 WARN Shelly Gen2 Device Driver V1.2 No matching device found for Shelly ID shellyplus1-a8032abd018c
2023-02-07T01:04:26.080840795+00:00 DEBUG Shelly Gen2 Device Driver V1.2 WS Receive TEXT frame payload: {“src”:“shellyplus1-a8032abd018c”,“dst”:“EdgeDriver”,“method”:“NotifyStatus”,“params”:{“ts”:1675731866.86,“switch:0”:{“id”:0,“output”:false,“source”:“timer”,“timer_duration”:null,“timer_started_at”:null}}}
2023-02-07T01:04:26.085349587+00:00 WARN Shelly Gen2 Device Driver V1.2 No matching device found for Shelly ID shellyplus1-a8032abd018c
2023-02-07T01:04:55.005769767+00:00 TRACE Shelly Gen2 Device Driver V1.2 Received event with handler capability
2023-02-07T01:04:55.013139226+00:00 INFO Shelly Gen2 Device Driver V1.2 <Device: 078df96a-66f3-4767-8888-b132930c21d6 (Gate 1 Open/Close)> received command: {“args”:{},“capability”:“switch”,“command”:“off”,“component”:“main”,“positional_args”:{}}
2023-02-07T01:04:55.021202267+00:00 TRACE Shelly Gen2 Device Driver V1.2 Found CapabilityCommandDispatcher handler in thisDriver
2023-02-07T01:04:55.021820559+00:00 INFO Shelly Gen2 Device Driver V1.2 main switch turned off
2023-02-07T01:04:55.022649226+00:00 INFO Shelly Gen2 Device Driver V1.2 <Device: 078df96a-66f3-4767-8888-b132930c21d6 (Gate 1 Open/Close)> emitting event: {“attribute_id”:“switch”,“capability_id”:“switch”,“component_id”:“main”,“state”:{“value”:“off”}}
2023-02-07T01:04:55.026386892+00:00 DEBUG Shelly Gen2 Device Driver V1.2 Sending message: {“id”:51,“method”:“Switch.Set”,“src”:“EdgeDriver”,“jsonrpc”:“2.0”,“params”:{“id”:0,“on”:false,“toggle_after”:2}}
2023-02-07T01:04:55.031328434+00:00 DEBUG Shelly Gen2 Device Driver V1.2 Gate 1 Open/Close device thread event handled
2023-02-07T01:04:55.054367226+00:00 DEBUG Shelly Gen2 Device Driver V1.2 WS Receive TEXT frame payload: {“id”:51,“src”:“shellyplus1-a8032abd018c”,“dst”:“EdgeDriver”,“result”:{“was_on”:false}}
2023-02-07T01:04:55.059230642+00:00 WARN Shelly Gen2 Device Driver V1.2 No matching device found for Shelly ID shellyplus1-a8032abd018c
2023-02-07T01:04:55.079382059+00:00 DEBUG Shelly Gen2 Device Driver V1.2 WS Receive TEXT frame payload: {“src”:“shellyplus1-a8032abd018c”,“dst”:“EdgeDriver”,“method”:“NotifyStatus”,“params”:{“ts”:1675731895.87,“switch:0”:{“id”:0,“timer_duration”:2.00,“timer_started_at”:1675731895.87}}}
2023-02-07T01:04:55.083685559+00:00 WARN Shelly Gen2 Device Driver V1.2 No matching device found for Shelly ID shellyplus1-a8032abd018c
2023-02-07T01:04:57.087554852+00:00 DEBUG Shelly Gen2 Device Driver V1.2 WS Receive TEXT frame payload: {“src”:“shellyplus1-a8032abd018c”,“dst”:“EdgeDriver”,“method”:“NotifyStatus”,“params”:{“ts”:1675731897.87,“switch:0”:{“id”:0,“output”:true,“source”:“timer”,“timer_duration”:1.00,“timer_started_at”:1675731897.87}}}
2023-02-07T01:04:57.092100143+00:00 WARN Shelly Gen2 Device Driver V1.2 No matching device found for Shelly ID shellyplus1-a8032abd018c
2023-02-07T01:04:58.077539310+00:00 DEBUG Shelly Gen2 Device Driver V1.2 WS Receive TEXT frame payload: {“src”:“shellyplus1-a8032abd018c”,“dst”:“EdgeDriver”,“method”:“NotifyStatus”,“params”:{“ts”:1675731898.87,“switch:0”:{“id”:0,“output”:false,“source”:“timer”,“timer_duration”:null,“timer_started_at”:null}}}
2023-02-07T01:04:58.081930060+00:00 WARN Shelly Gen2 Device Driver V1.2 No matching device found for Shelly ID shellyplus1-a8032abd018c
2023-02-07T01:08:25.293515281+00:00 TRACE Shelly Gen2 Device Driver V1.2 Received event with handler capability
2023-02-07T01:08:25.309917618+00:00 INFO Shelly Gen2 Device Driver V1.2 <Device: 078df96a-66f3-4767-8888-b132930c21d6 (Gate 1 Open/Close)> received command: {“args”:{},“capability”:“switch”,“command”:“on”,“component”:“main”,“positional_args”:{}}
2023-02-07T01:08:25.310857648+00:00 TRACE Shelly Gen2 Device Driver V1.2 Found CapabilityCommandDispatcher handler in thisDriver
2023-02-07T01:08:25.311691231+00:00 INFO Shelly Gen2 Device Driver V1.2 main switch turned on
2023-02-07T01:08:25.312397627+00:00 INFO Shelly Gen2 Device Driver V1.2 <Device: 078df96a-66f3-4767-8888-b132930c21d6 (Gate 1 Open/Close)> emitting event: {“attribute_id”:“switch”,“capability_id”:“switch”,“component_id”:“main”,“state”:{“value”:“on”}}
2023-02-07T01:08:25.315777520+00:00 DEBUG Shelly Gen2 Device Driver V1.2 Sending message: {“id”:52,“method”:“Switch.Set”,“src”:“EdgeDriver”,“jsonrpc”:“2.0”,“params”:{“id”:0,“on”:true,“toggle_after”:2}}
2023-02-07T01:08:25.317965051+00:00 DEBUG Shelly Gen2 Device Driver V1.2 Gate 1 Open/Close device thread event handled
2023-02-07T01:08:25.339722999+00:00 DEBUG Shelly Gen2 Device Driver V1.2 WS Receive TEXT frame payload: {“id”:52,“src”:“shellyplus1-a8032abd018c”,“dst”:“EdgeDriver”,“result”:{“was_on”:false}}
2023-02-07T01:08:25.343780511+00:00 WARN Shelly Gen2 Device Driver V1.2 No matching device found for Shelly ID shellyplus1-a8032abd018c
2023-02-07T01:08:25.369769011+00:00 DEBUG Shelly Gen2 Device Driver V1.2 WS Receive TEXT frame payload: {“src”:“shellyplus1-a8032abd018c”,“dst”:“EdgeDriver”,“method”:“NotifyStatus”,“params”:{“ts”:1675732106.17,“switch:0”:{“id”:0,“output”:true,“source”:“WS_in”,“timer_duration”:2.00,“timer_started_at”:1675732106.17}}}
2023-02-07T01:08:25.374211413+00:00 WARN Shelly Gen2 Device Driver V1.2 No matching device found for Shelly ID shellyplus1-a8032abd018c
2023-02-07T01:08:27.368648405+00:00 DEBUG Shelly Gen2 Device Driver V1.2 WS Receive TEXT frame payload: {“src”:“shellyplus1-a8032abd018c”,“dst”:“EdgeDriver”,“method”:“NotifyStatus”,“params”:{“ts”:1675732108.17,“switch:0”:{“id”:0,“output”:false,“source”:“timer”,“timer_duration”:null,“timer_started_at”:null}}}
2023-02-07T01:08:27.373149611+00:00 WARN Shelly Gen2 Device Driver V1.2 No matching device found for Shelly ID shellyplus1-a8032abd018c
2023-02-07T01:09:43.030944538+00:00 DEBUG Shelly Gen2 Device Driver V1.2 WS Receive TEXT frame payload: {“src”:“shellyplus1-a8032abd018c”,“dst”:“EdgeDriver”,“method”:“NotifyStatus”,“params”:{“ts”:1675732183.84,“cloud”:{“connected”:false}}}
2023-02-07T01:09:43.036190622+00:00 WARN Shelly Gen2 Device Driver V1.2 No matching device found for Shelly ID shellyplus1-a8032abd018c
2023-02-07T01:09:44.754260206+00:00 DEBUG Shelly Gen2 Device Driver V1.2 WS Receive TEXT frame payload: {“src”:“shellyplus1-a8032abd018c”,“dst”:“EdgeDriver”,“method”:“NotifyStatus”,“params”:{“ts”:1675732185.53,“cloud”:{“connected”:true}}}
2023-02-07T01:09:44.758701872+00:00 WARN Shelly Gen2 Device Driver V1.2 No matching device found for Shelly ID shellyplus1-a8032abd018c
2023-02-07T01:10:24.740255225+00:00 DEBUG Shelly Gen2 Device Driver V1.2 WS Receive TEXT frame payload: {“src”:“shellyplus1-a8032abd018c”,“dst”:“EdgeDriver”,“method”:“NotifyStatus”,“params”:{“ts”:1675732225.55,“cloud”:{“connected”:false}}}
2023-02-07T01:10:24.744808433+00:00 WARN Shelly Gen2 Device Driver V1.2 No matching device found for Shelly ID shellyplus1-a8032abd018c

Hi Todd, after a long time I got around to testing other SHELLY devices. I came across one anomaly with SHELLY 1 PM, this device also measures consumption, I compared the total consumption data displayed by the SHELLY app and what smarthings shows and there is a big difference of 1000wh. You don’t know what the problem could be? I compared other things like temperature, humidity, voltage in both apps and they are completely accurate. only total consumption. shely calculates it based on the performance and how much time was consumed, I assume that smarthings should only read from SHELLY the calculated final value, am I wrong?


Interesting finding. I don’t know why they would be different. What is received from the device is in units of watt-minutes and that is converted to watt-hours by the driver by dividing by 60 and then what you see displayed on the control panel is kW-hours so then divided by 1000.

I’ll try it with my 2.5 and see if I see a similar misalignment.

UPDATE: I’m running a small heater on a Shelly Plug device and I’ve already noticed that the SmartThings device shows a total power consumption value, but the graph in the app isn’t even registering anything yet. Is it possible what you are seeing is a lag in the data being tracked and reported via the cloud vs. the realtime data being reported by the device?

well thank you,

I’ve only had it running for two days, I’ll keep an eye on whether it keeps growing differently or if the difference fluctuates randomly. it’s really weird. Maybe Shelly, when it interprets the total consumption, updates it in the total sum with a delay after the end of the day, or today’s consumption can be displayed exactly tomorrow. I will try to write down the value in SmartThings in the evening when there is no more consumption and then compare it with Shelly by lunchtime tomorrow

1 Like

the problem is clarified, it is as you wrote. in the app shell, the total balance is loaded with a delay, there is no “hourly statistics”, that is, only after whole days is the total consumption calculated, when you look at it during the day, the values ​​are different compared to smarthings, where the current values ​​are already interpreted. it cannot be fully tracked because when there is a lot of consumption, smarthing records it, but Shelly does not add it to the total balance yet. just turn off the subscription and wait 24 hours and compare how the consumption remained after turning off the cloud in smarthing and how it is then shown in the app shells.
thanks Todd for the tip.


1 Like