openLuup: Shelly Bridge plugin
-
Restarting mosquitto this is in log
2021-04-17 20:59:14.986 openLuup.server:: GET /data_request?id=lu_status2&output_format=json&DataVersion=687035184&Timeout=60&MinimumDelay=1500&_=1618687270165 HTTP/1.1 tcp{client}: 0xf5619c8 2021-04-17 20:59:21.613 openLuup.io.server:: MQTT:1884 connection closed tcp{client}: 0xfc60a48 2021-04-17 20:59:21.614 openLuup.mqtt:: RECEIVE ERROR: closed tcp{client}: 0xfc60a48 2021-04-17 20:59:21.616 openLuup.mqtt:: localhost.bridge-01 UNSUBSCRIBE from # tcp{client}: 0xfc60a48 2021-04-17 20:59:27.984 openLuup.io.server:: MQTT:1884 connection from 192.168.1.25 tcp{client}: 0xf096c288 2021-04-17 20:59:28.031 openLuup.mqtt:: localhost.bridge-01 SUBSCRIBE to # tcp{client}: 0xf096c288 2021-04-17 20:59:28.033 luup.variable_set:: 30001.shellyix3-front.online was: EMPTY now: true #hooks:0 2021-04-17 20:59:28.036 luup.variable_set:: 30007.shelly1-93BEFE.online was: EMPTY now: true #hooks:0 2021-04-17 20:59:28.056 luup.variable_set:: 30002.shelly1-93A847.online was: EMPTY now: true #hooks:0 2021-04-17 20:59:28.068 luup.variable_set:: 30005.shelly1-93FC56.online was: EMPTY now: true #hooks:0 2021-04-17 20:59:28.384 openLuup.server:: request completed (4780 bytes, 1 chunks, 13396 ms) tcp{client}: 0xf5619c8 2021-04-17 20:59:28.453 openLuup.server:: GET /data_request?id=user_data&output_format=json&DataVersion=687028312&_=1618687270166 HTTP/1.1 tcp{client}: 0xf5619c8 2021-04-17 20:59:28.931 openLuup.server:: request completed (766007 bytes, 48 chunks, 476 ms) tcp{client}: 0xf5619c8 2021-04-17 20:59:32.943 luup.tasmota:47: JSON error: Expected value but found invalid token at character 1 2021-04-17 20:59:32.994 openLuup.server:: GET /data_request?id=lu_status2&output_format=json&DataVersion=687035197&Timeout=60&MinimumDelay=1500&_=1618687270167 HTTP/1.1 tcp{client}: 0xf5619c8 2021-04-17 20:59:33.059 luup.tasmota:47: JSON error: Expected value but found invalid token at character 1 2021-04-17 20:59:33.538 luup.tasmota:47: JSON error: Expected value but found invalid token at character 1 2021-04-17 20:59:33.630 luup.tasmota:47: JSON error: Expected value but found invalid token at character 1 2021-04-17 20:59:34.639 luup.variable_set:: 30004.shellyix3-rear.online was: EMPTY now: true #hooks:0 2021-04-17 20:59:34.763 openLuup.server:: request completed (3732 bytes, 1 chunks, 1767 ms) tcp{client}: 0xf5619c8 2021-04-17 20:59:34.813 openLuup.server:: GET /data_request?id=user_data&output_format=json&DataVersion=687028316&_=
Devices still work after mosquitto restart
Will now reload luup and double check If this does infact cause devices to fail.
-
reload luup devices have now failed
log2021-04-17 21:04:07.840 openLuup.scheduler:: [25] BroadLink-Mk2 device startup completed: status=true, msg=All OK, name=BroadLink_Mk2 2021-04-17 21:04:07.841 openLuup.scheduler:: [46] Shelly device startup 2021-04-17 21:04:07.841 luup.set_failure:: status = 0 2021-04-17 21:04:07.842 luup.variable_set:: 46.urn:micasaverde-com:serviceId:HaDevice1.CommFailure was: 0 now: 0 #hooks:0 2021-04-17 21:04:07.843 luup.variable_set:: 46.urn:micasaverde-com:serviceId:HaDevice1.CommFailureTime was: 0 now: 0 #hooks:0 2021-04-17 21:04:07.843 openLuup.scheduler:: [46] Shelly device startup completed: status=true, msg=OK, name=ShellyBridge 2021-04-17 21:04:07.844 openLuup.scheduler:: [47] Tasmota device startup 2021-04-17 21:04:07.844 luup.set_failure:: status = 0 2021-04-17 21:04:07.844 luup.variable_set:: 47.urn:micasaverde-com:serviceId:HaDevice1.CommFailure was: 0 now: 0 #hooks:0 2021-04-17 21:04:07.845 luup.variable_set:: 47.urn:micasaverde-com:serviceId:HaDevice1.CommFailureTime was: 0 now: 0 #hooks:0 2021-04-17 21:04:07.846 openLuup.scheduler:: [47] Tasmota device startup completed: status=true, msg=OK, name=TasmotaBridge 2021-04-17 21:04:07.847 luup_log:3: ALTUI: UPNPregisterDataProvider(3,Vera@192.168.1.11,http://127.0.0.1:3480/data_request?id=lr_HTTP_VeraBridgeMirror_192.168.1.11,[{
2021-04-17 21:04:21.212 openLuup.server:: request completed (835 bytes, 0 chunks, 0 ms) tcp{client}: 0xfc86dd0 2021-04-17 21:04:21.214 openLuup.server:: GET /luvd/D_GenericShellyDevice.xml HTTP/1.1 tcp{client}: 0xf37a830 2021-04-17 21:04:21.215 openLuup.server:: request completed (293 bytes, 0 chunks, 0 ms) tcp{client}: 0xf37a830 2021-04-17 21:04:21.217 openLuup.server:: GET /luvd/D_Reactor.xml HTTP/1.1 tcp{client}: 0xfe92080 2021-04-17 21:04:21.221 openLuup.server:: request completed (1156 bytes, 0 chunks, 0 ms) tcp{client}: 0xfe92080 2021-04-17 21:04:21.222 openLuup.server:: GET /luvd/D_ReactorSensor.xml HTTP/1.1 tcp{client}: 0xff353d8 2021-04-17 21:04:21.224 openLuup.server:: request completed (1572 bytes, 0 chunks, 0 ms) tcp{client}: 0xff353d8 2021-04-17 21:04:21.226 openLuup.server:: GET /luvd/D_DimmableRGBLight1.xml HTTP/1.1 tcp{client}: 0xfe940f8 2021-04-17 21:04:21.229 openLuup.server:: request completed (1507 bytes, 0 chunks, 0 ms) tcp{client}: 0xfe940f8 2021-04-17 21:04:21.253 openLuup.server:: GET /luvd/D_ShellyBridge.xml HTTP/1.1 tcp{client}: 0xfd25c78
will now restart mosquitto without deleting devices.
-
Restarting mosquitto brings devices back to life.
log
2021-04-17 21:09:39.969 openLuup.io.server:: MQTT:1884 connection closed tcp{client}: 0xff53448 2021-04-17 21:09:39.972 openLuup.mqtt:: RECEIVE ERROR: closed tcp{client}: 0xff53448 2021-04-17 21:09:39.973 openLuup.mqtt:: localhost.bridge-01 UNSUBSCRIBE from # tcp{client}: 0xff53448 2021-04-17 21:09:45.774 openLuup.io.server:: MQTT:1884 connection from 192.168.1.25 tcp{client}: 0xf527b20 2021-04-17 21:09:45.823 openLuup.mqtt:: localhost.bridge-01 SUBSCRIBE to # tcp{client}: 0xf527b20 2021-04-17 21:09:45.826 luup.shelly:46: New Shelly announced: shellyix3-rear 2021-04-17 21:09:45.827 luup.attr_set:: 30004.ip = 192.168.1.105 2021-04-17 21:09:45.828 luup.attr_set:: 30004.mac = E8DB84D6E80A 2021-04-17 21:09:45.829 luup.attr_set:: 30004.model = SHIX3-1 2021-04-17 21:09:45.829 luup.attr_set:: 30004.firmware = 20210413-154502/v1.10.2-gb89901a 2021-04-17 21:09:45.906 luup.shelly:46: New Shelly announced: shelly1-93A847 2021-04-17 21:09:45.907 luup.attr_set:: 30002.ip = 192.168.1.102 2021-04-17 21:09:45.908 luup.attr_set:: 30002.mac = BCDDC293A847 2021-04-17 21:09:45.908 luup.attr_set:: 30002.model = SHSW-1 2021-04-17 21:09:45.909 luup.attr_set:: 30002.firmware = 20210415-125832/v1.10.3-g23074d0 2021-04-17 21:09:46.040 luup.shelly:46: New Shelly announced: shelly1-93FC56 2021-04-17 21:09:46.041 luup.attr_set:: 30005.ip = 192.168.1.100 2021-04-17 21:09:46.042 luup.attr_set:: 30005.mac = BCDDC293FC56 2021-04-17 21:09:46.043 luup.attr_set:: 30005.model = SHSW-1 2021-04-17 21:09:46.043 luup.attr_set:: 30005.firmware = 20210415-125832/v1.10.3-g23074d0 2021-04-17 21:09:46.360 luup.shelly:46: New Shelly announced: shellyix3-front 2021-04-17 21:09:46.361 luup.attr_set:: 30001.ip = 192.168.1.106 2021-04-17 21:09:46.362 luup.attr_set:: 30001.mac = E8DB84D6C6C8 2021-04-17 21:09:46.363 luup.attr_set:: 30001.model = SHIX3-1 2021-04-17 21:09:46.363 luup.attr_set:: 30001.firmware = 20210413-154502/v1.10.2-gb89901a 2021-04-17 21:09:51.275 luup.tasmota:47: JSON error: Expected value but found invalid token at character 1 2021-04-17 21:09:51.594 luup.tasmota:47: JSON error: Expected value but found invalid token at character 1 2021-04-17 21:09:51.647 luup.tasmota:47: JSON error: Expected value but found invalid token at character 1 2021-04-17 21:09:51.936 luup.tasmota:47: JSON error: Expected value but found invalid token at character 1 2021-04-17 21:09:54.170 luup.shelly:46: New Shelly announced: shelly1-93BEFE 2021-04-17 21:09:54.171 luup.attr_set:: 30007.ip = 192.168.1.101 2021-04-17 21:09:54.172 luup.attr_set:: 30007.mac = BCDDC293BEFE 2021-04-17 21:09:54.172 luup.attr_set:: 30007.model = SHSW-1 2021-04-17 21:09:54.173 luup.attr_set:: 30007.firmware = 20210415-125832/v1.10.3-g23074d0 2021-04-17 21:10:00.117 luup_log:0: 13Mb, 0.8%cpu, 0.0days
-
OK Mosquitto reports bridge disconnect and 5 seconds later reconnects, when i reload luup.
I then power off 1 device and back on, Mosquitto reports device already connected,closing connection then new client shelly device and ip.
back in AltUI the device i power cycled is working , all other still not.
-
Here's what I found with my Shellies (more to come, I have a couple more on the test bench, not already connected).
- Shelly 1PM seems OK. Ext temperatures are not mapped, but the variable is crated:
This should be easily mapped. I don't have humidity attached, but it's similar, looking at the docs.
- Shelly plug is not correctly mapped. Here's the announce payload:
{"id":"shelly-veraplug","model":"SHPLG-S","mac":"XXX","ip":"192.168.1.46","new_fw":true,"fw_ver":"20210323-105718/v1.10.1-gf276b51"}
It's mapped as a scene control, instead of a plug. Power variables are correctly saved.
As I've said, I have buttons, uni and EM on my test bench and I'll add them very soon, so I could help with code if necessary @akbooer .
- Shelly 1PM seems OK. Ext temperatures are not mapped, but the variable is crated:
-
Try v21.4.18 to see if the plug now works (it will create a separate child device.)
-
Try v21.4.18 to see if the plug now works (it will create a separate child device.)
@akbooer all set now for shelly plug!
EDIT: I think category_num and subcategory_num should be set to at least 3/0, so the UI could filter them better.
So, the recommendation for Shelly 1 PM used as detached relay (input separated from relay) is to manually use the variables?
-
Good news on the plug. I haven't yet considered setting the (sub)category automatically, but it should be easy enough.
For any Shelly with switches, the generic device has the raw variables but also they're treated as a scene controller, so you have
sl_SceneActivated
andLastSceneTime
available to you. -
Good news on the plug. I haven't yet considered setting the (sub)category automatically, but it should be easy enough.
For any Shelly with switches, the generic device has the raw variables but also they're treated as a scene controller, so you have
sl_SceneActivated
andLastSceneTime
available to you.@akbooer I have a Shelly Plug (not the "S" variant) that I now finally setup on my test Pi to try the Shelly bridge.
The plug shows as it should in the Shellies room:
The following variables are mapped:
The payload is:
{"id":"shellyplug-6CC126","model":"SHPLG2-1","mac":"xxx","ip":"192.168.1.30","new_fw":false,"fw_ver":"20201124-092420/v1.9.0@57ac4ad8"}
However no child devices show up for the plug what I can see.
Is this something that can be added to the bridge, or have I missed anything in my setup?(running OpenLuup v 21.4.18)
-
@akbooer I have a Shelly Plug (not the "S" variant) that I now finally setup on my test Pi to try the Shelly bridge.
The plug shows as it should in the Shellies room:
The following variables are mapped:
The payload is:
{"id":"shellyplug-6CC126","model":"SHPLG2-1","mac":"xxx","ip":"192.168.1.30","new_fw":false,"fw_ver":"20201124-092420/v1.9.0@57ac4ad8"}
However no child devices show up for the plug what I can see.
Is this something that can be added to the bridge, or have I missed anything in my setup?(running OpenLuup v 21.4.18)
-
@akbooer that seems to have worked, now I get the child device and can control the plug on/off, thanks!
@akbooer now on to my second Shelly, a Shelly Uni.
Same thing here, I assume, no child devices are created some mapping is required.
(For my Uni I have the two relays connected to two relays reading two states from the alarm, and no buttons connected to control the two inputs. In other words in my application I do not really need the input child devices.)The temperature gets mapped correctly.
The two "relay" variables are the outputs for each channel are also as they should from what I can see.Payload:
{"id":"shellyuni-483FDA82C252","model":"SHUNI-1","mac":"xxx","ip":"192.168.1.31","new_fw":false,"fw_ver":"20201124-093042/v1.9.0@57ac4ad8"}
I think the "input" variables are the two buttons that you can control as a user that need child devices.
If I remember it correctly @therealdb also has a Uni if you need more input from a second use case.