openLuup: Shelly Bridge plugin
-
@archers said in openLuup: Shelly Bridge plugin:
I assume that wifi is not the best technology for battery powered devices.
No, not really. That’s what Zwave and Zigbee were supposed to be about. But I have to say that in terms of all the HA technology I’ve had (X10 / Zwave / Zigbee) it all pales into insignificance compared to Shellies and WiFi – especially in terms of setup and the fact that you don’t need a controller at all.
-
therealdbreplied to ArcherS on May 3, 2021, 10:08 AM last edited by therealdb May 3, 2021, 6:09 AM
@archers said in openLuup: Shelly Bridge plugin:
I think I will keep it attached to USB power. I have power available where the button is located and this gives more or less instant actions. I also noticed that if it is not on USB in some cases it does not connect as it should when going out of sleep when you push the button.
yep, I've them inside my cars, so USB powered. It will takes about 3-4 seconds at boot for them to jon the WiFi network and send an MQTT message. My use case is not normal and I'll probably swap them with nodemcu devices in the future, but overall for 10 eur battery included I'm very satisfied.
I'll install Shellies into my sister-in-law house this year, because they really want home control and not home automation, and Shelly is the least overkill solution to this problem. No hub required for very basic automation is not bad, for "normal" users.
-
-
@akbooer said in openLuup: MQTT server:
I don't have any HT devices,
...but I do now, and I've just updated the Shelly plugin to support individual temperature and humidity child devices for each H&T, and also a battery level for the parent device.
A bit disappointed with the quality of the H&T case, it seems inferior to the excellent Button 1 – but it's so small and innocuous that perhaps it doesn't matter. Aside from that, it's a fine little device (although I've not checked the calibration accuracy, I see that they do include a user-definable offset for both H & T readings.) If the battery lasts as well as they say, that'l be fine.
-
-
@akbooer today I added a Shelly Dimmer2 replacing a really old Fibaro dimmer that died. The Shelly dimmer seems like a nice device so far.
It is added into OpenLuup as it should:
The following variables are mapped:
announce:
{"id":"shellydimmer2-nnn","model":"SHDM-2","mac":"nnn","ip":"192.168.1.nn","new_fw":false,"fw_ver":"20210226-115010/v1.9.6-dimmer2@1873d25e"}
light/0/status:
{"ison":true,"source":"http","has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"mode":"white","brightness":80}
However no child devices are created for the dimmer. Could this be added to the Shelly bridge?
(I am running OpenLuup v 21.8.16.)
-
Yes, I don't believe that I've implemented the dimmer... I certainly haven't got one!
I'll take a look – thanks for the excellent configuration information!
-
This is going to be hard without having a dimmer. You're not in the UK, are you? I didn't really want to buy one (£22 UK price) because I have absolutely no need of one.
Any chance that anyone has got a spare one they can send me?
-
@akbooer I have a virtual server just to test my own integration. I think it’s a safer investment for you to validate any device you don’t have access to. The doc is pretty good and it’s not complex to replicate both http and mqtt messages in a fake implementation.
-
OK, so we’ll have to do this in an iterative way, with me making a few mistakes.
-
@akbooer top notch service as always! Hopefully you will get good use of it also.
So far I am happy with mine. The dimmer supports all kind of switches. I use it with a spring loaded wall switch in "one button mode", i.e. as a push button with push-and-hold for dimming.As a side note I am still on 1.9.x on my Shellies since I did not get mqtt to work with the new firmware. On the EU Shelly support site it is very easy to set up an ota-url for flashing older versions on a device.
-
I missed your post, somehow. As you see, I’ve gone for the hardware rather than a virtual solution, but I certainly won’t be doing that for all new Shellies!
Any details to share on how you’ve done this?
-
@akbooer I just wrote a super simple http server replying the same way Shelly devices are doing. Plus, I send mqtt messages every x secs to my dev mqtt broker, to replicate the same behavior. I was using this while developing the support for mqtt inside my own system.
I’ve done the same way for opensprinkler, in order to avoid messing with my sprinklers.
It’s done in C#, but it should be easy with anything else.
-
@akbooer is there any chance on you decoupling the tasmota and shelly bridges from openLuup. I'm asking because if the bridges were stand alone plugins, they could be used as quasi templates for other MQTT devices. For example, my BlueIris server MQTT messaging now maps to individual Vera devices that represent BlueIris cameras (created with the Tasmota bridge), but the functionality of each vera device is limited, due to the way in which the tasmota bridge creates its child devices. With a stand alone plugin, I could revise a clone of the plugin to include more specific functionality for a given MQTT source.
Everything MQTT wise works well now, so no real need to do this, but it strikes me that it would be a cleaner approach to handling MQTT in openLuup and the myriad IOT devices that will make use of the protocol.
-
They're closely coupled so that they can auto-install if any of their devices are detected, rather than having to download a bridge plugin separately. As such, I consider them to be an integral part of the system (a change, certainly, from my previous device-agnostic approach, but part of my personal move away from ZWave.)
The MQTT bridge functionality is totally general, and I would have thought that this was a better place to start.
...or am I missing your point, here?
-
@archers said in openLuup: Shelly Bridge plugin:
@akbooer top notch service as always! Hopefully you will get good use of it also.
Well, we'll see (the device arrived yesterday)...
Latest development version of openLuup (v21.11.2) has an initial attempt to service the Dimmer2 device:
- inputs are handled exactly as the switch device – so, essentially, as a scene controller showing the latest activated scene: short press; long press; etc... This should work for both input switches (if you have any with two.)
- on/off button on the control panel should work for the dimmer bulb.
- slider control is not yet implemented.
...my current issue is that, although I now have the Shelly Dimmer2 device, I don't have any dimmable bulbs! Everything I have is LED, and they're either non-dimmable or smart devices anyway. In particular, I can't tell whether the power and Watts parameters work correctly for the dimmer.
So I'd appreciate a listing of any bugs that you find, and I'll continue to work on the slider control.
Incidentally, I've update to the latest firmware for this device:
20210909-150154/v1.11.4-DNSfix-ge6b2f6d
since it came with a very old version that didn't even publish the model number. It seems to work fine, but I've not updated any other of my devices. -
@akbooer It's just easier to understand the code/ what's occurring in a plugin as opposed to openLuup, mainly because of the typical plugin structure and its place on top of the openLuup subsystem. That's probably a trivial distinction to you, but for me it's a huge difference in understanding as I'm not in any way fluent with the inside baseball of the OLuup object model.
Per your MQTT comment, though it can be done (https://github.com/jziolkowski/tdm), it would be difficult to have functional device bridges if you took away MQTT, as you'd have to interrogate a router in some fashion to find out if these devices exist on one's network, and then use http commands to control the devices. So I see MQTT handling as more an innate part of the OL subsystem, like http, than a device profile like tasmota or shelly, device profiles that are typically handled as stand alone plugins.
-
@akbooer said in openLuup: Shelly Bridge plugin:
Well, we'll see (the device arrived yesterday)...
Latest development version of openLuup (v21.11.2) has an initial attempt to service the Dimmer2 device:inputs are handled exactly as the switch device – so, essentially, as a scene controller showing the latest activated scene: short press; long press; etc... This should work for both input switches (if you have any with two.)
on/off button on the control panel should work for the dimmer bulb.
slider control is not yet implemented....my current issue is that, although I now have the Shelly Dimmer2 device, I don't have any dimmable bulbs! Everything I have is LED, and they're either non-dimmable or smart devices anyway. In particular, I can't tell whether the power and Watts parameters work correctly for the dimmer.
So I'd appreciate a listing of any bugs that you find, and I'll continue to work on the slider control.
Incidentally, I've update to the latest firmware for this device: 20210909-150154/v1.11.4-DNSfix-ge6b2f6d since it came with a very old version that didn't even publish the model number. It seems to work fine, but I've not updated any other of my devices.@akbooer thank you for the effort, I installed v21.11.2 and have tested this a bit.
For a start I have my switch connected to "sw 1". It is a single button switch, defined as a "one button mode" in the Shelly GUI.
"sw 1" seems to report as "light/0" in the Mqtt message.It does not work fully in OpenLuup yet, below I list what I have found.
Turning on/off with the physical switch:
-
The status in AltUI does change when turning the light on and off.
-
When I turn the light "off" with the physical switch I have:
light/0:
off
light/0/status:{"ison":false,"source":"input","has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"mode":"white","brightness":80}
-
When I turn the light "on" with the physical switch (at 80%) I have:
light/0:
on
light/0/status:
{"ison":true,"source":"input","has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"mode":"white","brightness":80}
Turning the light on/off in AltUI:
-
The light does not turn on/off when I turn it on/off in AltUI.
-
When I turn it "on" in AltUI I have:
light/0:
off
light/0/status:
{"ison":false,"source":"input","has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"mode":"white","brightness":80}
relay/0/command:
on
-
When I turn it "off" in AltUI I have:
light/0:
off
light/0/status:
{"ison":false,"source":"input","has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"mode":"white","brightness":80}
relay/0/command:
off
When I turn it "on" in AltUI it looks like this:
When I turn on the light with the physical switch it looks like this:
In Mqtt Explorer I have the following:
Light on (i.e. turned on with the physical switch):
Light off (i.e. turned off with the physical switch):
Turning on in AltUI (but light off):
Turning off in AltUI (light still off):
The "relay/0/command" command that is sent from AltUI does in other words not to give any effect on the Shelly device. In fact with a fresh Mqtt Explorer session it only emerges when turning on/off in AltUI.
Hopefully this gives some hints to what is wrong. Let me know if you need more information.
@akbooer said in openLuup: Shelly Bridge plugin:
...my current issue is that, although I now have the Shelly Dimmer2 device, I don't have any dimmable bulbs! Everything I have is LED, and they're either non-dimmable or smart devices anyway. In particular, I can't tell whether the power and Watts parameters work correctly for the dimmer.
Dimmable LED lights are a bit tricky still. Some of them work and some of then do not work very well. It can be a bit of a pain to find good ones. The upside is that the Shelly dimmer can be changed from trailing and leading edge dimming (under "Calibration"). This should hopefully mean that it can be a little bit better to adapt to different lights.
@akbooer said in openLuup: Shelly Bridge plugin:
Incidentally, I've update to the latest firmware for this device: 20210909-150154/v1.11.4-DNSfix-ge6b2f6d since it came with a very old version that didn't even publish the model number. It seems to work fine, but I've not updated any other of my devices.
Excellent news that the latest FW seems to work, I will test it later on one of my devices.
-
-
More than enough to be going on with! Brilliant. Thanks.
-
Can you give latest development (v21.11.8) a try?
I don't think I'm quite there yet, but the dimmer control should work to some extent.
This is surprisingly hard, since the status/control aspect of the Shelly dimmer is not quite the same as that of a ZWave one... I've always hated the way that Vera handled dimmers anyway! But I'm doing the best I can.
68/144