MQTT – setup and use
-
Excellent diagnosis. Let's hope that's the root cause.
Entirely exaplins why I couldn't reproduce this ... my Shelly 2.5s are on 1.9.4, but telling me there's a 1.10.3, so I'll be sure NOT to do that!
I don't follow the Shelly forum much, so please pass on when it's safe again to upgrade.
@rafale77 Shellies are manual update... a good choice, as I'm sure you'll agree!
@akbooer I routinely updated the two new Shellies and then I got v1.10.3, bad decision as it turnes out.
My two older Shellies are on v1.9.0 and worked directly when I enabled Mqtt.Manual update is better, automatic is a pain, Win 10 is a good example on that. I assume I will get it on my Qnap when I update it.
I have also blocked the Shellies and Tasmotas in the the router -
@crille said in MQTT – setup and use:
May I bother you with my next issue? Every time I restart Homebridge my sensor values and current state of bridged devices are lost to mqttthing and shows 0 or OFF until there is an update from the device. Is there a way to retain the values from openLuup/update?
In the latest testing branch release (v21.4.30) the MQTT server now subscribes to the topic
openLuup/query
. If you publish a message with the format:devNo.serviceId.variable
, for example,- topic: openLuup/query
- message: 2.openLuup.Memory_Mb
it will force an immediate update message:
- topic: openLuup/update/2/openLuup/Memory_Mb
- message: 8.7 (or whatever)
You should be able to use this to get an initial value for any mqttthing.
Notice the formatting difference between the message and the returned topic ('.' instead of '/') this is intentional because it is in line with openLuup's existing dev.srv.var notation and it reminds you that it's not a part of the query topic, but it goes in the message, and avoids the need for openLuup to use a wildcard subscription.
-
@akbooer I routinely updated the two new Shellies and then I got v1.10.3, bad decision as it turnes out.
My two older Shellies are on v1.9.0 and worked directly when I enabled Mqtt.Manual update is better, automatic is a pain, Win 10 is a good example on that. I assume I will get it on my Qnap when I update it.
I have also blocked the Shellies and Tasmotas in the the router@archers said in MQTT – setup and use:
@akbooer I routinely updated the two new Shellies and then I got v1.10.3, bad decision as it turnes out.
I usually wait a couple of days, then update them in batch via MQTT. all good at the moment. I've blocked them from the reaching the Internet as well.
-
@archers said in MQTT – setup and use:
@akbooer I routinely updated the two new Shellies and then I got v1.10.3, bad decision as it turnes out.
I usually wait a couple of days, then update them in batch via MQTT. all good at the moment. I've blocked them from the reaching the Internet as well.
@therealdb said in MQTT – setup and use:
update them in batch via MQTT
That’s a great idea! I’ve been doing them individually over HTTP up to now.
-
Thank you very much to all.
in fact I had updated the Shelly plug (v1.10.3)
I installed v1.9.4 following the instructions of ArcherS.
but unfortunately I still have the same problem.
I have the creation of the Shelly Bridge, but no child.here are the logs
2021-05-01 08:52:42.237 openLuup.io.server:: MQTT:1885 connection from 192.168.1.149 tcp{client}: 0x2ec6018 2021-05-01 08:52:42.267 luup.create_device:: [80] D_ShellyBridge.xml / I_ShellyBridge.xml / D_ShellyBridge.json (ShellyBridge) 2021-05-01 08:52:42.268 openLuup.context_switch:: ERROR: [dev #0] ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value) 2021-05-01 08:52:42.268 openLuup.mqtt:: ERROR publishing application message for mqtt:shellies/shellyplug-s-20E453/online : ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value) 2021-05-01 08:52:42.269 openLuup.scheduler:: [80] Shelly device startup 2021-05-01 08:52:42.269 luup.set_failure:: status = 0 2021-05-01 08:52:42.270 luup.variable_set:: 80.urn:micasaverde-com:serviceId:HaDevice1.CommFailure was: EMPTY now: 0 #hooks:0 2021-05-01 08:52:42.270 luup.variable_set:: 80.urn:micasaverde-com:serviceId:HaDevice1.CommFailureTime was: EMPTY now: 0 #hooks:0 2021-05-01 08:52:42.270 openLuup.scheduler:: [80] Shelly device startup completed: status=true, msg=OK, name=ShellyBridge 2021-05-01 08:52:42.271 luup.shelly:0: New Shelly announced: shellyplug-s-20E453 2021-05-01 08:52:42.271 openLuup.luup:: creating room [10] Shellies 2021-05-01 08:52:42.272 openLuup.context_switch:: ERROR: [dev #0] ./L_ShellyBridge.lua:226: attempt to index field '?' (a nil value) 2021-05-01 08:52:42.272 openLuup.mqtt:: ERROR publishing application message for mqtt:shellies/announce : ./L_ShellyBridge.lua:226: attempt to index field '?' (a nil value) 2021-05-01 08:52:42.273 openLuup.context_switch:: ERROR: [dev #0] ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value) 2021-05-01 08:52:42.273 openLuup.mqtt:: ERROR publishing application message for mqtt:shellies/shellyplug-s-20E453/announce : ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value) 2021-05-01 08:52:42.275 openLuup.context_switch:: ERROR: [dev #0] ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value) 2021-05-01 08:52:42.275 openLuup.mqtt:: ERROR publishing application message for mqtt:shellies/shellyplug-s-20E453/relay/0/power : ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value) 2021-05-01 08:52:42.276 openLuup.context_switch:: ERROR: [dev #0] ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value) 2021-05-01 08:52:42.276 openLuup.mqtt:: ERROR publishing application message for mqtt:shellies/shellyplug-s-20E453/relay/0/energy : ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value) 2021-05-01 08:52:42.305 openLuup.context_switch:: ERROR: [dev #0] ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value) 2021-05-01 08:52:42.306 openLuup.mqtt:: ERROR publishing application message for mqtt:shellies/shellyplug-s-20E453/relay/0 : ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value) 2021-05-01 08:52:42.307 openLuup.context_switch:: ERROR: [dev #0] ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value) 2021-05-01 08:52:42.307 openLuup.mqtt:: ERROR publishing application message for mqtt:shellies/shellyplug-s-20E453/temperature : ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value) 2021-05-01 08:52:42.308 openLuup.context_switch:: ERROR: [dev #0] ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value) 2021-05-01 08:52:42.309 openLuup.mqtt:: ERROR publishing application message for mqtt:shellies/shellyplug-s-20E453/temperature_f : ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value) 2021-05-01 08:52:42.310 openLuup.context_switch:: ERROR: [dev #0] ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value) 2021-05-01 08:52:42.310 openLuup.mqtt:: ERROR publishing application message for mqtt:shellies/shellyplug-s-20E453/overtemperature : ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value) 2021-05-01 08:52:42.311 openLuup.mqtt:: shellyplug-s-20E453 SUBSCRIBE to shellies/command tcp{client}: 0x2ec6018 2021-05-01 08:52:42.313 openLuup.mqtt:: shellyplug-s-20E453 SUBSCRIBE to shellies/shellyplug-s-20E453/command tcp{client}: 0x2ec6018 2021-05-01 08:52:42.314 openLuup.mqtt:: shellyplug-s-20E453 SUBSCRIBE to shellies/shellyplug-s-20E453/relay/0/command tcp{client}: 0x2ec6018
I have the same problem with the Tasmota bridge
-
Thank you very much to all.
in fact I had updated the Shelly plug (v1.10.3)
I installed v1.9.4 following the instructions of ArcherS.
but unfortunately I still have the same problem.
I have the creation of the Shelly Bridge, but no child.here are the logs
2021-05-01 08:52:42.237 openLuup.io.server:: MQTT:1885 connection from 192.168.1.149 tcp{client}: 0x2ec6018 2021-05-01 08:52:42.267 luup.create_device:: [80] D_ShellyBridge.xml / I_ShellyBridge.xml / D_ShellyBridge.json (ShellyBridge) 2021-05-01 08:52:42.268 openLuup.context_switch:: ERROR: [dev #0] ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value) 2021-05-01 08:52:42.268 openLuup.mqtt:: ERROR publishing application message for mqtt:shellies/shellyplug-s-20E453/online : ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value) 2021-05-01 08:52:42.269 openLuup.scheduler:: [80] Shelly device startup 2021-05-01 08:52:42.269 luup.set_failure:: status = 0 2021-05-01 08:52:42.270 luup.variable_set:: 80.urn:micasaverde-com:serviceId:HaDevice1.CommFailure was: EMPTY now: 0 #hooks:0 2021-05-01 08:52:42.270 luup.variable_set:: 80.urn:micasaverde-com:serviceId:HaDevice1.CommFailureTime was: EMPTY now: 0 #hooks:0 2021-05-01 08:52:42.270 openLuup.scheduler:: [80] Shelly device startup completed: status=true, msg=OK, name=ShellyBridge 2021-05-01 08:52:42.271 luup.shelly:0: New Shelly announced: shellyplug-s-20E453 2021-05-01 08:52:42.271 openLuup.luup:: creating room [10] Shellies 2021-05-01 08:52:42.272 openLuup.context_switch:: ERROR: [dev #0] ./L_ShellyBridge.lua:226: attempt to index field '?' (a nil value) 2021-05-01 08:52:42.272 openLuup.mqtt:: ERROR publishing application message for mqtt:shellies/announce : ./L_ShellyBridge.lua:226: attempt to index field '?' (a nil value) 2021-05-01 08:52:42.273 openLuup.context_switch:: ERROR: [dev #0] ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value) 2021-05-01 08:52:42.273 openLuup.mqtt:: ERROR publishing application message for mqtt:shellies/shellyplug-s-20E453/announce : ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value) 2021-05-01 08:52:42.275 openLuup.context_switch:: ERROR: [dev #0] ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value) 2021-05-01 08:52:42.275 openLuup.mqtt:: ERROR publishing application message for mqtt:shellies/shellyplug-s-20E453/relay/0/power : ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value) 2021-05-01 08:52:42.276 openLuup.context_switch:: ERROR: [dev #0] ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value) 2021-05-01 08:52:42.276 openLuup.mqtt:: ERROR publishing application message for mqtt:shellies/shellyplug-s-20E453/relay/0/energy : ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value) 2021-05-01 08:52:42.305 openLuup.context_switch:: ERROR: [dev #0] ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value) 2021-05-01 08:52:42.306 openLuup.mqtt:: ERROR publishing application message for mqtt:shellies/shellyplug-s-20E453/relay/0 : ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value) 2021-05-01 08:52:42.307 openLuup.context_switch:: ERROR: [dev #0] ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value) 2021-05-01 08:52:42.307 openLuup.mqtt:: ERROR publishing application message for mqtt:shellies/shellyplug-s-20E453/temperature : ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value) 2021-05-01 08:52:42.308 openLuup.context_switch:: ERROR: [dev #0] ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value) 2021-05-01 08:52:42.309 openLuup.mqtt:: ERROR publishing application message for mqtt:shellies/shellyplug-s-20E453/temperature_f : ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value) 2021-05-01 08:52:42.310 openLuup.context_switch:: ERROR: [dev #0] ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value) 2021-05-01 08:52:42.310 openLuup.mqtt:: ERROR publishing application message for mqtt:shellies/shellyplug-s-20E453/overtemperature : ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value) 2021-05-01 08:52:42.311 openLuup.mqtt:: shellyplug-s-20E453 SUBSCRIBE to shellies/command tcp{client}: 0x2ec6018 2021-05-01 08:52:42.313 openLuup.mqtt:: shellyplug-s-20E453 SUBSCRIBE to shellies/shellyplug-s-20E453/command tcp{client}: 0x2ec6018 2021-05-01 08:52:42.314 openLuup.mqtt:: shellyplug-s-20E453 SUBSCRIBE to shellies/shellyplug-s-20E453/relay/0/command tcp{client}: 0x2ec6018
I have the same problem with the Tasmota bridge
@christian_fabre said in MQTT – setup and use:
I have the same problem with the Tasmota bridge
Regarding the Tasmota bridge it creates one device per Tasmota, i.e. no additional child devices as for the Shellies. These you instead need to create yourself by e.g. using the Virtual Sensor plugin.
In this post you can find more on how I have done that.Did you try with Mqtt Explorer? It is a very good tool to see that the Mqtt devices, both Tasmota and Shellies are working as they should, and also to look at what they send.
-
@christian_fabre said in MQTT – setup and use:
I have the same problem with the Tasmota bridge
Regarding the Tasmota bridge it creates one device per Tasmota, i.e. no additional child devices as for the Shellies. These you instead need to create yourself by e.g. using the Virtual Sensor plugin.
In this post you can find more on how I have done that.Did you try with Mqtt Explorer? It is a very good tool to see that the Mqtt devices, both Tasmota and Shellies are working as they should, and also to look at what they send.
-
-
-
Try this: delete the Shelly bridge and restart openLuup.
-
ok i just did it.
After starting OpenLuup, the Shelly Bridge is created ...
I attach the log
2021-05-01 10:40:39.029 openLuup.mqtt:: mqtt-explorer-8cd8e0cf SUBSCRIBE to # tcp{client}: 0x1a575f0
2021-05-01 10:40:39.032 luup.create_device:: [82] D_ShellyBridge.xml / I_ShellyBridge.xml / D_ShellyBridge.json (ShellyBridge)
2021-05-01 10:40:39.033 openLuup.context_switch:: ERROR: [dev #0] ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value)
2021-05-01 10:40:39.033 openLuup.mqtt:: ERROR publishing application message for mqtt:shellies/shellyplug-s-20E453/online : ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value)
2021-05-01 10:40:39.277 openLuup.server:: request completed (509175 bytes, 32 chunks, 994 ms) tcp{client}: 0x1a51f78
2021-05-01 10:40:39.277 openLuup.scheduler:: [82] Shelly device startup
2021-05-01 10:40:39.277 luup.set_failure:: status = 0
2021-05-01 10:40:39.277 luup.variable_set:: 82.urn:micasaverde-com:serviceId:HaDevice1.CommFailure was: EMPTY now: 0 #hooks:0
2021-05-01 10:40:39.278 luup.variable_set:: 82.urn:micasaverde-com:serviceId:HaDevice1.CommFailureTime was: EMPTY now: 0 #hooks:0
2021-05-01 10:40:39.278 openLuup.scheduler:: [82] Shelly device startup completed: status=true, msg=OK, name=ShellyBridge
2021-05-01 10:40:39.279 luup.shelly:0: New Shelly announced: shellyplug-s-20E453
2021-05-01 10:40:39.279 openLuup.context_switch:: ERROR: [dev #0] ./L_ShellyBridge.lua:226: attempt to index field '?' (a nil value)
2021-05-01 10:40:39.279 openLuup.mqtt:: ERROR publishing application message for mqtt:shellies/announce : ./L_ShellyBridge.lua:226: attempt to index field '?' (a nil value)
2021-05-01 10:40:39.280 openLuup.mqtt:: mqtt-explorer-8cd8e0cf SUBSCRIBE to $SYS/# tcp{client}: 0x1a575f0
....................... -
ok i just did it.
After starting OpenLuup, the Shelly Bridge is created ...
I attach the log
2021-05-01 10:40:39.029 openLuup.mqtt:: mqtt-explorer-8cd8e0cf SUBSCRIBE to # tcp{client}: 0x1a575f0
2021-05-01 10:40:39.032 luup.create_device:: [82] D_ShellyBridge.xml / I_ShellyBridge.xml / D_ShellyBridge.json (ShellyBridge)
2021-05-01 10:40:39.033 openLuup.context_switch:: ERROR: [dev #0] ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value)
2021-05-01 10:40:39.033 openLuup.mqtt:: ERROR publishing application message for mqtt:shellies/shellyplug-s-20E453/online : ./L_ShellyBridge.lua:343: attempt to index field 'hadevice' (a nil value)
2021-05-01 10:40:39.277 openLuup.server:: request completed (509175 bytes, 32 chunks, 994 ms) tcp{client}: 0x1a51f78
2021-05-01 10:40:39.277 openLuup.scheduler:: [82] Shelly device startup
2021-05-01 10:40:39.277 luup.set_failure:: status = 0
2021-05-01 10:40:39.277 luup.variable_set:: 82.urn:micasaverde-com:serviceId:HaDevice1.CommFailure was: EMPTY now: 0 #hooks:0
2021-05-01 10:40:39.278 luup.variable_set:: 82.urn:micasaverde-com:serviceId:HaDevice1.CommFailureTime was: EMPTY now: 0 #hooks:0
2021-05-01 10:40:39.278 openLuup.scheduler:: [82] Shelly device startup completed: status=true, msg=OK, name=ShellyBridge
2021-05-01 10:40:39.279 luup.shelly:0: New Shelly announced: shellyplug-s-20E453
2021-05-01 10:40:39.279 openLuup.context_switch:: ERROR: [dev #0] ./L_ShellyBridge.lua:226: attempt to index field '?' (a nil value)
2021-05-01 10:40:39.279 openLuup.mqtt:: ERROR publishing application message for mqtt:shellies/announce : ./L_ShellyBridge.lua:226: attempt to index field '?' (a nil value)
2021-05-01 10:40:39.280 openLuup.mqtt:: mqtt-explorer-8cd8e0cf SUBSCRIBE to $SYS/# tcp{client}: 0x1a575f0
.......................@christian_fabre my Plug (not the S version) looks like this in Mqtt Explorer:
For some reason there is no announce message from your plug when comparing with my plug.
-
-
@christian_fabre that is good news, then it looks as the Shelly works as it should in respect of the Mqtt settings.
Just to rule out the obvious; the Shelly devices and Tasmota devices should show up in OpenLuup in the two rooms "Shellies" and "Tasmota" and not in "No room".
Maybe deleting the Shelly bridge and reloading as @akbooer suggests now that you have the announce message.
-
I have removed several of the Shelly and Tasmota bridges. But after the Reload, they are created in NoRoom.
The last thing I did was reload the OpenLuup files from GitHub OpenLuup Development, but I still have the same problem -
-
I have removed several of the Shelly and Tasmota bridges. But after the Reload, they are created in NoRoom.
The last thing I did was reload the OpenLuup files from GitHub OpenLuup Development, but I still have the same problem@christian_fabre said in MQTT – setup and use:
I have removed several of the Shelly and Tasmota bridges. But after the Reload, they are created in NoRoom.
Yes, the bridges are created in "No room", but the child devices should be created in the two rooms "Shellies" and "Tasmota" respectively.
-
The "Shellies" room is well created but it remains empty.
On the other hand, I have the Tasmota bridge in Noroom, but I do not have a "Tasmota" room![0_1619878068306_Capture d’écran 2021-05-01 160702.png](Uploading 100%!
-
-
@christian_fabre said in MQTT – setup and use:
more
I notice that the variable OffSet is missing in the variables of the Shelly bridgeYes, that’s undoubtedly the problem... have not been able to work on this today. Sorry.