@archers Very Cool gadget. I soldered to the flash pins, which given the size of the contacts was challenging, but managed to make it work. Now waiting for my BLE sensors to arrive.
Energy Monitoring built into the dual relay!
I've managed to use MSR UI on iOS devices to some degree*, so that although UI elements (e.g. rule sets) are not visible in portrait mode, you've seen them in landscape. Now with recents builds (24302) this does not work anymore, elements (rule sets, entities) are not anymore visible in landscape mode.
Does anyone have similar experiences? Using iOS 18 and Safari/Chrome browser.
( *Drag & drop of rule conditions have never worked on a mobile)
Hi All
Hopefully this place looks like a helpful forum as I’m quite new to all this!
I’ve had a few devices all working separately /through their proprietary apps but we’re just finishing off a large house extension and this has added to the list.
I’d ideally like to be able to view/switch a number of different devices on one screen/head end but have no idea where to start.
The devices we have/will have shortly are as follows;
Zigbee Smart Sockets
Zigbee smart switches (for lights)
Heatmiser Neo Underfloor Heating (this runs from a Samsung ASHP but that part is automatic)
Samsung VRF air conditioning (currently using Smart Things App)
Hive (2xLTHW heating circuits in the existing house and Hot Water)
Ring (doorbell!)
Hik Vision PoE CCTV
We have lots of appliances (Neff N70) which we can control remotely but not too fussed about controlling those at the
Moment)
Any help/recommendations would be appreciated!
Thanks
Adrian
After a major hassle got z-way running on my ubuntu 16 VM with a USB pasthough UZB1 stick including license and connected to Vera...
I see:
I also see:
0d6e8c78-c8cd-4307-9474-23e0d6a55094-image.png
But how do I update that?
e09ffa19-a31d-4a03-8983-01228bc5478f-image.png
I have a legacy home automation set-up running on Windows XP. the computer and software have now died.
I have written a very nice Excel VBA program to replace the software and it can run on any modern Windows system.
My only remaining problem is to output the correct signal to a USB port to trigger the wireless switches.
Has anybody done a similar exercise. Please help.
The locksmith is trying to persuade me to purchase the BE-TECH K35 touchscreen lock with both Wi-Fi and Bluetooth, claiming it's better than the Yale Assure Lock 2. What are your thoughts on this? Which one would you recommend?
Here is the link to the Chinese brand BE-TECH: BE-TECH Smart Deadbolt K3S.
The other smart lock I am considering is the Schlage Encode Plus.
Thank you!
Hi @toggledbits,
I have lots of logs with this:
<Engine:ERR> Assignment to alarm ignored -- expression-driven global cannot be set by assignmentAny hints to where look at to avoid this? Thanks.
Hi @toggledbits
I'd like to update my controllers with these new features, but I'm struggling to find any guidance in the docs - and in general to understand the context.
Could you please elaborate more? Thanks.
Hi All,
Kind of new to Home Automation. Started off Using Amazon Echo units and added a Samsung SmartThings hub. I have mostly been using plug in modules for turning lights on and off. I live in a very rural area where the internet goes out a lot. I eventually want to change to to a non internet Hub so things will work without needing an internet connection. But I will post with those questions at a later date.
So, the task at hand is this: I have flood lights at each corner of my house. They are currently controlled by switches at the front and back doors. I would like to add Security Cameras to each corner also. I can easily find small Wifi switches to put into the electrical box where the flood lights are located, then I can terminate the leads together behind the Decora switch to have constant power. Then I can use the constant power up at the lights electrical box to power the security cameras. I would also like to have a wireless switch to take the place of the Decora switch to be able to turn the lights off and on.
I cannot seem to find a product like this. It seems I can find the small wired in switch boxes that will also come with external smart wall switches, but the wall switches are an external box that does not fit in or cover the existing Wall switch electrical box. I can also find Wireless Decora switches that come with a remote wired in small switch box , but they all seem to be RF and do not integrate with a Smart Hub.
I am hoping someone here knows of a product that matches what I am looking for. Any help would be appreciated.
Also any recommendations for Wireless Security cameras are welcome.
Thanks for any help.
Hello,
I have a fresh openluup install on a raspberry.
Just installed "Vera Bridge" plugin, but I can't make it to work.
The plugin can not load the device infos from the vera.
This is what I can see in the OpenLuup log :
openLuup.client:: WGET error status: -1, request: http://192.168.1.2/port_3480/data_request?id=user_data2&output_format=json&ns=1
I have tried it from a console on the same raspberry this way :
wget http://192.168.1.2:3480/data_request?id=user_data2&output_format=json&ns=1
It worked, so I think it's not credential or network issue.
What can be the solution for this ?
more openluup log :
408 lines, 1 error, max gap 61s @ 2022-08-12 20:51:01.568
2022-08-12 19:21:24.150 :: openLuup LOG ROTATION :: (runtime 0.0 days)
2022-08-12 19:21:24.154 openLuup.init:: init phase completed
2022-08-12 19:21:24.155 openLuup.io.server:: starting HTTP:3480 server on port: 3480 tcp{server}: 0x1c48ee8
2022-08-12 19:21:24.157 openLuup.io.server:: starting SMTP server on port: 2525 tcp{server}: 0x1b461d8
2022-08-12 19:21:24.158 openLuup.io.server:: starting POP3 server on port: 11011 tcp{server}: 0x1b48780
2022-08-12 19:21:24.158 openLuup.historian:: starting data historian
2022-08-12 19:21:24.159 openLuup.historian:: using memory cache size (per-variable): 1024
2022-08-12 19:21:24.168 openLuup.scheduler:: starting
2022-08-12 19:21:24.169 openLuup.scheduler:: [2] openLuup device startup
2022-08-12 19:21:24.170 luup_log:2: v22.7.31
2022-08-12 19:21:24.171 luup_log:2: sync in 35.8 s
2022-08-12 19:21:24.190 luup.variable_watch:: callback=housemode_watcher, watching=2.openLuup.HouseMode
2022-08-12 19:21:24.191 luup.register_handler:: global_function_name=openLuup_email, request=openLuup@openLuup.local
2022-08-12 19:21:24.191 luup.register_handler:: global_function_name=openLuup_images, request=images@openLuup.local
2022-08-12 19:21:24.192 luup.register_handler:: global_function_name=openLuup_events, request=events@openLuup.local
2022-08-12 19:21:24.192 luup.register_handler:: global_function_name=openLuup_mailbox, request=mail@openLuup.local
2022-08-12 19:21:24.193 luup.chdev.append:: [AltAppStore] Alternate App Store
2022-08-12 19:21:24.193 luup.chdev.sync:: [2] openLuup, syncing children
2022-08-12 19:21:24.194 luup_log:2: starting MQTT $SYS/broker statistics
2022-08-12 19:21:24.196 luup_log:2: 3Mb, 2.1%cpu, 0.0days
2022-08-12 19:21:24.211 openLuup.scheduler:: [2] openLuup device startup completed: status=true, msg=sync in 35.8 s, name=L_openLuup
2022-08-12 19:21:24.212 openLuup.scheduler:: [3] Alternate UI device startup
2022-08-12 19:21:24.212 luup_log:3: ALTUI: initstatus(3) starting version: v2.54
2022-08-12 19:21:24.214 openLuup.scheduler:: [3] Alternate UI device startup completed: status=, msg=, name=
2022-08-12 19:21:24.214 openLuup.scheduler:: [7] VeraBridge device startup
2022-08-12 19:21:24.215 luup_log:7: VeraBridge
2022-08-12 19:21:24.215 luup_log:7: 2021.01.03
2022-08-12 19:21:24.216 luup_log:7: 192.168.1.2
2022-08-12 19:21:24.216 luup_log:7: device clone numbering starts at 10000
2022-08-12 19:21:24.217 luup_log:7: VeraBridge maps remote Zwave controller
2022-08-12 19:21:24.218 luup_log:7: v21.1.3
2022-08-12 19:21:24.242 openLuup.client:: WGET error status: -1, request: http://192.168.1.2/port_3480/data_request?id=user_data2&output_format=json&ns=1
2022-08-12 19:21:24.242 luup.set_failure:: status = 2
2022-08-12 19:21:24.243 luup.variable_set:: 7.urn:micasaverde-com:serviceId:HaDevice1.CommFailure was: 2 now: 2 #hooks:0
2022-08-12 19:21:24.244 luup.variable_set:: 7.urn:micasaverde-com:serviceId:HaDevice1.CommFailureTime was: 1660323316 now: 1660324884 #hooks:0
2022-08-12 19:21:24.246 luup_log:7: registering with AltUI [3] as Data Storage Provider
2022-08-12 19:21:24.247 luup.register_handler:: global_function_name=HTTP_VeraBridgeMirror_192.168.1.2, request=HTTP_VeraBridgeMirror_192.168.1.2
2022-08-12 19:21:24.249 luup.call_action:: 3.urn:upnp-org:serviceId:altui1.RegisterDataProvider
2022-08-12 19:21:24.260 openLuup.scheduler:: [7] VeraBridge device startup completed: status=, msg=No Vera, name=VeraBridge
2022-08-12 19:21:24.261 openLuup.scheduler:: [4] Alternate App Store device startup
2022-08-12 19:21:24.261 luup_log:4: AltAppStore : starting...
2022-08-12 19:21:24.262 luup.variable_set:: 4.urn:upnp-org:serviceId:altui1.DisplayLine1 was: AltAppStore now: AltAppStore #hooks:0
2022-08-12 19:21:24.263 luup.variable_set:: 4.urn:upnp-org:serviceId:altui1.DisplayLine2 was: now: #hooks:0
2022-08-12 19:21:24.264 luup_log:4: AltAppStore : v20.3.30
2022-08-12 19:21:24.264 luup.set_failure:: status = 0
2022-08-12 19:21:24.265 luup.variable_set:: 4.urn:micasaverde-com:serviceId:HaDevice1.CommFailure was: 0 now: 0 #hooks:0
2022-08-12 19:21:24.266 luup.variable_set:: 4.urn:micasaverde-com:serviceId:HaDevice1.CommFailureTime was: 0 now: 0 #hooks:0
2022-08-12 19:21:24.267 openLuup.scheduler:: [4] Alternate App Store device startup completed: status=true, msg=OK, name=AltAppStore
2022-08-12 19:21:24.268 openLuup.scheduler:: [5] Harmony Hub Control device startup
2022-08-12 19:21:24.280 luup.variable_set:: 5.urn:rboer-com:serviceId:Harmony1.LinkStatus was: Ok now: Starting... #hooks:0
2022-08-12 19:21:24.281 luup.variable_set:: 5.urn:rboer-com:serviceId:Harmony1.IconSet was: 0 now: 3 #hooks:0
2022-08-12 19:21:24.282 luup.attr_set:: 5.altid = HAM5_CNTRL
2022-08-12 19:21:24.326 luup.set_failure:: status = 0
2022-08-12 19:21:24.326 luup.variable_set:: 5.urn:micasaverde-com:serviceId:HaDevice1.CommFailure was: 0 now: 0 #hooks:0
2022-08-12 19:21:24.327 luup.variable_set:: 5.urn:micasaverde-com:serviceId:HaDevice1.CommFailureTime was: 0 now: 0 #hooks:0
2022-08-12 19:21:24.328 openLuup.scheduler:: [5] Harmony Hub Control device startup completed: status=true, msg=OK, name=Harmony Control
2022-08-12 19:21:24.332 luup_log:3: ALTUI: UPNPregisterDataProvider(3,Vera@192.168.1.2,http://127.0.0.1:3480/data_request?id=lr_HTTP_VeraBridgeMirror_192.168.1.2,[{
"default":"device.serviceId.name",
"key":"mirror",
"label":"Mirror",
"type":"text"
}])
2022-08-12 19:21:24.337 luup.variable_set:: 3.urn:upnp-org:serviceId:altui1.DataStorageProviders was: {"emoncms":{"url":"","callback":"sendValueToStorage_emoncms","parameters":[{"default":1,"type":"number","key":"node... now: {"Vera@192.168.1.2":{"url":"http://127.0.0.1:3480/data_request?id=lr_HTTP_VeraBridgeMirror_192.168.1.2","callback":... #hooks:0
2022-08-12 19:21:24.360 openLuup.io.server:: HTTP:3480 connection from 192.168.1.24 tcp{client}: 0x1d21868
2022-08-12 19:21:24.363 openLuup.server:: GET /data_request?id=lu_status2&output_format=json&DataVersion=323312852&Timeout=60&MinimumDelay=1500&=1660323303557 HTTP/1.1 tcp{client}: 0x1d21868
2022-08-12 19:21:24.646 openLuup.server:: request completed (34267 bytes, 3 chunks, 280 ms) tcp{client}: 0x1d21868
2022-08-12 19:21:24.648 openLuup.io.server:: HTTP:3480 connection from 192.168.1.24 tcp{client}: 0x1d6a9b0
2022-08-12 19:21:24.661 openLuup.server:: GET /data_request?id=user_data&output_format=json&DataVersion=323312340&=1660323303558 HTTP/1.1 tcp{client}: 0x1d21868
2022-08-12 19:21:25.252 openLuup.server:: request completed (70135 bytes, 5 chunks, 588 ms) tcp{client}: 0x1d21868
2022-08-12 19:21:25.253 luup_log:3: ALTUI: startupDeferred, called on behalf of device:3
2022-08-12 19:21:25.338 luup.variable_set:: 3.urn:upnp-org:serviceId:altui1.Version was: v2.54 now: v2.54 #hooks:0
2022-08-12 19:21:25.934 luup.variable_set:: 3.urn:upnp-org:serviceId:altui1.DataStorageProviders was: {"Vera@192.168.1.2":{"url":"http://127.0.0.1:3480/data_request?id=lr_HTTP_VeraBridgeMirror_192.168.1.2","callback":... now: {"thingspeak":{"url":"","callback":"sendValueToStorage_thingspeak","parameters":[{"type":"number","key":"channelid"... #hooks:0
2022-08-12 19:21:25.964 luup.variable_set:: 3.urn:upnp-org:serviceId:altui1.DataStorageProviders was: {"thingspeak":{"url":"","callback":"sendValueToStorage_thingspeak","parameters":[{"type":"number","key":"channelid"... now: {"emoncms":{"url":"","callback":"sendValueToStorage_emoncms","parameters":[{"default":1,"type":"number","key":"node... #hooks:0
2022-08-12 19:21:25.996 luup.variable_set:: 3.urn:upnp-org:serviceId:altui1.DataStorageProviders was: {"emoncms":{"url":"","callback":"sendValueToStorage_emoncms","parameters":[{"default":1,"type":"number","key":"node... now: {"emoncms":{"url":"","callback":"sendValueToStorage_emoncms","parameters":[{"default":1,"type":"number","key":"node... #hooks:0
2022-08-12 19:21:25.999 luup.variable_set:: 3.urn:upnp-org:serviceId:altui1.VariablesToSend was: now: #hooks:0
2022-08-12 19:21:26.009 luup.variable_set:: 3.urn:upnp-org:serviceId:altui1.RemoteVariablesToWatch was: now: #hooks:0
2022-08-12 19:21:26.010 luup.variable_set:: 3.urn:upnp-org:serviceId:altui1.VariablesToWatch was: now: #hooks:0
2022-08-12 19:21:26.012 luup.variable_set:: 3.urn:upnp-org:serviceId:altui1.Timers was: [] now: [] #hooks:0
2022-08-12 19:21:26.013 luup_log:3: ALTUI: Wkflow - enableWorkflows(3,0,0)
Thank You.
d.
I have the following ACL defined:
groups: admin: users: - admin applications: true api_acls: # This ACL allows users in the "admin" group to access the API - url: "/api" group: admin allow: true log: true # This ACL allows anyone/thing to access the /api/v1/alive API endpoint - url: "/api/v1/alive" allow: trueAnd I have authenticated to MSR as "admin" user. However, I'm getting "access denied" when trying to access http://*******:8111/api/v1/log
So what I'm missing, is my ACL incorrectly defined?
Using build 24302 on Docker.
Sorry if this has been covered before, just curious why triggers in openluup are not consistent..
I looked at a scene i’d created a while back via ALTUI using the Console view and noticed it didn’t show any Triggers, which was strange as it was my main front door event 🙂 . So I added the door tripped trigger again, but I’ve just noticed I now how two tiggers using this view.
25bfe00a-d63e-4dc1-a501-23e779c64379-image.png
In ALTUI it shows this.
I have an oven that I need to manage the temperature of, keeping it in the neighborhood of 600° C (1100° F). I have not been able to find a Zigbee-enabled solution to measure temps that high. Does anyone know if such a thing exists? If not, any ideas for how to roll a custom solution that I could integrate into a Sonoff ihost controller? I have no trouble finding high temperature probes, but none of them interface with my automation stack.
Thanks to @toggledbits for adding a custom CSS. I've started doing a darker Reactor style.
Here's the file: https://gist.github.com/dbochicchio/825098ac13b7f8cac22012eae37ff7ce
A couple of things are still too bright and I'll eventually catch-up. Just place it under your /config directory, naming the file as customstyles.css. Hard refresh your browser.
AK. Was doing an openLuup install and the installer errored with:
openLuup_install 2019.02.15 @akbooer getting openLuup version tar file from GitHub branch master... un-zipping download files... getting dkjson.lua... lua5.1: openLuup_install.lua:45: GitHub download failed with code 500 stack traceback: [C]: in function 'assert' openLuup_install.lua:45: in main chunk [C]: ?The installer code was executing this URL:
http://dkolf.de/src/dkjson-lua.fsl/raw/dkjson.lua?name=16cbc26080996d9da827df42cb0844a25518eeb3Running it manually gives:
dkolf.de The script could not be run error-free. Please check your error log file for the exact error message. You can find this in the KIS under "Product Management > *YOUR PRODUCT* > *CONFYGUAR* > Logfiles". Further information can be found in our FAQ. The script could not be executed correctly. Please refer to your error log for details about this error. You find it in your KIS under item "Product Admin > *YOUR PRODUCT* > *CONFIGURE* > Logfiles". Further information can also be found in our FAQ.I'm thinking the dkjson code URL has been changed. On dkolf.de there is a download link:
http://dkolf.de/dkjson-lua/dkjson-2.8.luaand dkjson code also seems to be in GitHub (I presume this is the same code?):
https://github.com/LuaDist/dkjson/blob/master/dkjson.luaI'm don't know what dkolf.de looked like previously but I do see the dkjson code has been updated as of 2024-06-17. Hope this helps.
Oh - and by the way the dkjson.lua file seems to have been downloaded OK by the installer - error or no error, so go figure.
Dear Forum,
I am just starting a smart home system. I've wanted to do this for 10 years at most and really would like to get a start. What I have are a couple of SONOFF wifi relays, some 433 (Hz/mHz) switches ( not wifi ) a couple of wifi lightbulbs, and I'd like to expand wifi thermostat, leak/water detectors, garage door openers and what ever else I can think of.
In the SONOFF items I have it's a particular app, the wifi bulbs are another app, and if I do a thermostat there might be another app. My wife is not a Luddite but she damn sure doesn't want to have to trouble shoot if/why a particular app breaks down.
So in what I do understand about smart home things is that I need/want a HUB. I spent 15 years doing some programming so I do have some computer ability, though I'd prefer to stay away from HAVING to line command operate the hub.
I would like a list of HUB's that people have found to be the best. Even better are links to let's say Amazon for that hub.
Regards from Noob Smart Home,
Barry
Hi!
In Home Assistant I sometimes uses the TTS, either to my Sonos or Google speakers. With reactor in Vera I also use TTS.
But in MSR I can't select the TTS-service. It's simply not there. Am I missing something, or is this the case, so far?
Thanks!
/Fanan
It’s been a while since I looked at openLuup as it had been running nicely and quietly in the background doing some basic tasks. With my VeraPlus looking like it’s finally succumbing to old age, I want to shift a number of the global module I have over to openLuup.
To do this, I have added the files (example would be xxpushover.lua to the cmh-ludl folder and the following to the startup
require “xxpushover”
The xxpushover.lua file itself starts with the following..
module("xxpushover", package.seeall)
And I always have a line in these files to allow me to check it’s been read in the start up related logs, which in this case it is..
The challenge I’m having is that when I try to call any of the functions within the module, it returns the following error..
"[string "ALTUI - LuaRunHandler"]:1: attempt to index global 'xxpushover' (a nil value)”
I’m no doubt missing something obvious, can anyone help me find out what it is ? Many thanks
Hi
I have just connected a bunch of EzloPi controllers to MSR to import some ESP based devices etc.
They all seemed to have worked and imported in to MSR apart from I have one missing device. It is a Digital Gas Sensor device.
This is how that device looks in the Ezlo API.
Devices Info:
_id: "10696001" deviceTypeId: "ezlopi" parentDeviceId: "10696000" category: "level_sensor" subcategory: "" gatewayId: "457a5069" batteryPowered: false name: "Gas Sensor Digital" type: "sensor" reachable: true persistent: true serviceNotification: false armed: false roomId: "" security: "no" ready: true status: "idle" parentRoom: true protectConfig: "default"Items Info:
_id: "20696001" deviceId: "10696001" hasGetter: true hasSetter: false name: "smoke_density" show: true valueType: "substance_amount" scale: "parts_per_million" value: 2.7472610473632812 valueFormatted: "2.75" status: "idle"There is also an Analog Gas sensor that one did import in to MSR OK.
68d63dab-b871-4f44-912b-cf6e0b9eb4c6-image.png
Devices Info:
_id: "10696000" deviceTypeId: "ezlopi" parentDeviceId: "10696000" category: "security_sensor" subcategory: "gas" gatewayId: "457a5069" batteryPowered: false name: "Gas Sensor Analog" type: "sensor" reachable: true persistent: true serviceNotification: false armed: false roomId: "" security: "no" ready: true status: "idle" parentRoom: true protectConfig: "default"Items Info:
_id: "20696000" deviceId: "10696000" hasGetter: true hasSetter: false name: "gas_alarm" show: true valueType: "token" enum: 0: "no_gas" 1: "combustible_gas_detected" 2: "toxic_gas_detected" 3: "unknown" valueFormatted: "no_gas" value: "no_gas" status: "idle"And this is how this MQ2 Gas Sensor looks like on their dashboard:
Digital
cb77dfa3-4af5-4d06-9635-89207a716a89-image.png
Analog
4fb4da1b-e946-4b89-876c-bcd9f5699b6c-image.png
They have an EzloPi website here you can create your own sensor projects using ESP boards, which is very interesting stuff!
And I just wrote on the Ezlo forum here, how to connect an EzloPi controller to MSR.
THANKS.
Build 21228 has been released. Docker images available from DockerHub as usual, and bare-metal packages here.
Home Assistant up to version 2021.8.6 supported; the online version of the manual will now state the current supported versions; Fix an error in OWMWeatherController that could cause it to stop updating; Unify the approach to entity filtering on all hub interface classes (controllers); this works for device entities only; it may be extended to other entities later; Improve error detail in messages for EzloController during auth phase; Add isRuleSet() and isRuleEnabled() functions to expressions extensions; Implement set action for lock and passage capabilities (makes them more easily scriptable in some cases); Fix a place in the UI where 24-hour time was not being displayed.A couple of things for you @toggledbits, since you mentioned that this release has new features and some tweaks are expected.
Local expressions cannot be deleted. Pushing the X button has no effect for me.
When cloning an entity action, the result is strange (first is cloned one, second is the original action):
a92ea094-9e2c-4aaa-bf47-2d07a6ffdbd0-image.png
When changing the action on the cloned element, the params are added to the original one. See screenshot:
92ac3011-83c8-466b-bd23-47d483ad7a52-image.png
Dark theme has a couple of strange contrasts. One is visible in the previous screenshots (white text on yellow background). Another one is in groups (blue text on blue background):
9b3c4988-53ef-44e6-9672-30e744cacb75-image.png
Overall, I found blue, yellow, red and green (in buttons and forms) to be too bright.
On the bright side:
I love the new script action: thank you! The dark theme is a great start to avoid getting blinded at night I promise I'll try very soon the new features around actions. Thanks!@archers Very Cool gadget. I soldered to the flash pins, which given the size of the contacts was challenging, but managed to make it work. Now waiting for my BLE sensors to arrive.
Energy Monitoring built into the dual relay!
I was seeing similar network issues and also came to the conclusion that the socket library was most likely at fault. My solution is to use Mosquitto as my main broker, which accepts all MQTT traffic (topic # in 0) with all my MQTT devices pointing to it, and then Mosquitto filters push traffic to openLuup. Below is my config file that displays the filters:
allow_anonymous true
password_file /mosquitto/data/PW.txt
listener 1883
connection openLuup
address 127.0.0.1:1882
topic tele/# out
topic stat/# out
topic BlueIris/# out
topic # in 0
cleansession false
notifications true
username *****
password *******
bridge_protocol_version mqttv311
try_private false
log_timestamp true
log_timestamp_format %Y-%m-%d--T_%H:%M:%S
As you can see, Mosquitto runs on the same server as openLuup. It is started by a docker compose file. The config filters eliminated the network errors on openLuup and my openLuup install now runs for days on end without any errors at all. I also have HA running on the same server via docker compose, though I only use it for its Hacs Alexa integration. I pipe my Alexa calls to HA using an HA token and a crude plugin that I wrote. I have not found a use for HA outside of openLuup yet, though there are some interesting integrations I will eventually try out.
As regards MQTT I don't think you need to worry about network traffic so much as mqtt is an extremely light protocol, at least in so far as compared to cameras and hi-def wireless etc ( I have a bunch of these high bandwidth devices on my network in their own subnets). I have found that the thing that tends to bog down is the lua socket function and as long as you limit its connections, you will probably alleviate most of the network problems.
Nginx is one of the best web servers available, specializing in load balancing millions of connections, and from what I've read, it is written in Lua. Which suggests that the lua socket module itself is causing the network issues as Nginx most likely rolled their own network library.
@akbooer I think I found the culprit causing the random connection disconnects to Mosquitto. The LWT payload for a given device is a simple string, which doesn't seem to decode in the json decode call. So I added the below code to send a json string to the decoder. The errors have disappeared and I now see the LWT variable in the service variables. The variable reads "LWT : Online"
--line 165
local valid = {SENSOR = true, STATE = true, RESULT = true, LWT = true}
--line 172
-- begin code
local info, err = json.decode (message)
if message then
if not info then -- json did not decode because of single string parameter
message = '{' .. '"' .. mtype .. '"' .. ':' .. '"' .. message .. '"' .. '}'
end
end
-- end code
local info, err = json.decode (message)
This is probably not the way you would handle the error, but it does work.
@akbooer Tasmota energy sensor
{
"Time": "2021-03-28T21:51:01",
"ENERGY": {
"TotalStartTime": "2020-06-07T00:10:43",
"Total": 2356.063,
"Yesterday": 7.056,
"Today": 6.459,
"Period": 24,
"Power": 285,
"ApparentPower": 302,
"ReactivePower": 99,
"Factor": 0.95,
"Voltage": 123,
"Current": 2.453
}
}
No, you can still configure UDP. You just need login credentials now.
If I have a few moments, I will try to set up one of my Pi machines this weekend with an instance of Mosquitto. My HA server that runs my docker Mosquitto is headless, and I run Ubuntu server, so command line captures of packets are just a drag. My Pi has an hdmi port so I should be able to load the gui version of wireshark, and then test/capture the traffic between the two instances. I will let you know.
@rafale77 hey Rafale,
I went down the very same road a while back and threw in towel because the polling by the MQTT plugin created CPU drags that stopped openLuup from functioning "reliably". The instability was also in part because I use two other must-have plugins that rely on polling, and I imagine that the combination of the three was creating a scenario that caused intermittent failures. And I too ended up implementing MQTT in Home Assistant and then using RealDB's virtual HTTP plugin to send commands to my WiFi devices--albeit not knowing the status of the devices in openLuup after the send.
I'm looking at RigPapa's socket proxy and WebSocket plugins to see if I can transform my polling plugins to Async. The MQTT plugin is too complex for me to convert though, so if you take a crack at it, and are successful, I would very much appreciate you publishing your results, as MQTT is becoming a must for me.
@akbooer I hate to add more to the pile... but I'm still seeing a receive error for the connection to mosquitto. openLuup 2021.04.29b
Here's the log error:
2021-05-01 14:22:38.815 openLuup.io.server:: MQTT:1882 connection closed tcp{client}: 0x5579919e9c58
2021-05-01 14:22:38.816 openLuup.mqtt:: RECEIVE ERROR: closed tcp{client}: 0x5579919e9c58
2021-05-01 14:22:43.935 luup.io.incoming:: bytes received: 51, status: OK tcp{client}: 0x557990e7f528
2021-05-01 14:22:48.435 luup.io.incoming:: bytes received: 51, status: OK tcp{client}: 0x557990e7f528
2021-05-01 14:22:49.763 luup.variable_set:: 10181.urn:micasaverde-com:serviceId:EnergyMetering1.KWHReading was: 1619904116 now: 1619904168 #hooks:0
2021-05-01 14:22:50.158 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x557991971ff8
2021-05-01 14:22:53.834 openLuup.io.server:: MQTT:1882 connection from 127.0.0.1 tcp{client}: 0x5579920dc0b8
2021-05-01 14:22:53.834 openLuup.mqtt:: client is in ERROR empty
2021-05-01 14:22:53.834 openLuup.mqtt:: credentials is in ERROR empty
2021-05-01 14:22:53.834 openLuup.mqtt:: subscriptions is in ERROR empty
using the below error trapping in function "MQTTservlet"
local function MQTTservlet (client)
if client == nil then
_log ("client is in ERROR nil")
else
if table.concat(client) == "" then
_log ("client is in ERROR empty")
else
_log (table.concat {"MQTT ERROR: ", table.concat(client)})
end
end
if credentials == nil then
_log ("credentials is in ERROR nil")
else
if table.concat(credentials) == "" then
_log ("credentials is in ERROR empty")
else
_log (table.concat {"MQTT ERROR: ", table.concat(credentials)})
end
end
if subscriptions == nil then
_log ("subscriptions is in ERROR nil")
else
if table.concat(subscriptions) == "" then
_log ("subscriptions is in ERROR empty")
else
_log (table.concat {"MQTT ERROR: ", table.concat(subscriptions)})
end
end
return function () incoming (client, credentials, subscriptions) end
end
I can't find a deeper layer in the stack where I can trap for the incoming message to see what's in the message that is throwing the error. As near as I can tell, if openLuup tries to connect to a running mosquitto instance, then it fails to see the topics and messages, and passes empty--but not nil--strings when the servlet interface sees incoming bytes.
If I restart mosquitto, openLuup then sees the topics and messages and the error messages stop--and the connection to mosquitto remains stable.
This behavior does not occur when I aim an IOT device directly at openLuup--in that the connection to the device always resumes when openLuup reloads--in other words, I don't need to restart the IOT device to enable the connection.
@akbooer Below is the relevant output of a typical packet between mosquitto and a mosquitto bridged instance. In this case, mosquitto is sending update data to the bridge regarding a tasmota device/switch I use to remotely reboot my Vera. The format is definitely MQTT 3.1 and not 5.0, as 5.0 would not parse correctly in the wireshark viewer. The data payload is at the top of the window as Wireshark will truncate long messages. I can PM you the entire capture as it's not much, but may contain technical info that's best kept private. Let me know.
I'll try to capture some traffic between openLuup and mosquitto later.
{"Version":"9.1.0(tasmota)","BuildDateTime":"2020-11-07T11:57:45","Module or Template":"Gosund-WP5","RestartReason":"Software/System restart","Uptime":"6T05:50:22","Hostname":"power_MainVera-0278","IPAddress":"10.17.2.33","RSSI":"100","Signal (dBm)":"-17","WiFi LinkCount":5,"WiFi Downtime":"0T00:00:10","MqttCount":14,"LoadAvg":19}
Frame 9: 433 bytes on wire (3464 bits), 433 bytes captured (3464 bits) on interface eth0, id 0
Ethernet II, Src: Advansus_0a:8c:3a (00:19:0f:0a:8c:3a), Dst: 96:62:08:fb:22:8a (96:62:08:fb:22:8a)
Internet Protocol Version 4, Src: 10.17.2.41, Dst: 10.17.2.110
Transmission Control Protocol, Src Port: 40664, Dst Port: 1882, Seq: 3, Ack: 3, Len: 367
MQ Telemetry Transport Protocol, Publish Message
Header Flags: 0x30, Message Type: Publish Message, QoS Level: At most once delivery (Fire and Forget)
0011 .... = Message Type: Publish Message (3)
.... 0... = DUP Flag: Not set
.... .00. = QoS Level: At most once delivery (Fire and Forget) (0)
.... ...0 = Retain: Not set
Msg Len: 364
Topic Length: 30
Topic: tele/power_MainVera/HASS_STATE
Message [truncated--see above]: {"Version":"9.1.0(tasmota)","BuildDateTime":"2020-11-07T11:57:45","Module or Template":"Gosund-WP5","RestartReason":"Software/System restart","Uptime":"6T05:50:22","Hostname":"power_MainVera-0278","IPAddress":"10.17.2
@buxton In the above, I'm seeing an extra closing right hand bracket in the JSON string.
I've been waiting for something like this. Very cool. Thx for the post
@akbooer
And a ping response from bridge to main instance:
Frame 33: 68 bytes on wire (544 bits), 68 bytes captured (544 bits) on interface eth0, id 0
Ethernet II, Src: 96:62:08:fb:22:8a (96:62:08:fb:22:8a), Dst: Advansus_0a:8c:3a (00:19:0f:0a:8c:3a)
Internet Protocol Version 4, Src: 10.17.2.110, Dst: 10.17.2.41
Transmission Control Protocol, Src Port: 1882, Dst Port: 40664, Seq: 5, Ack: 2851, Len: 2
MQ Telemetry Transport Protocol, Ping Response
Header Flags: 0xd0, Message Type: Ping Response
1101 .... = Message Type: Ping Response (13)
.... 0000 = Reserved: 0
Msg Len: 0
@toggledbits I was able to install the container through compose, however, I had to make some changes to get it working. See below for my compose file:
MSR:
container_name: reactor
image: toggledbits/reactor:latest-generic-amd64
restart: "on-failure"
environment:
REACTOR_DATA_PREFIX: /var/reactor
TZ: America/Los_Angeles
expose:
- 8111
ports:
- 8111:8111
volumes:
- /home/username/reactor:/var/reactor
- /etc/localtime:/etc/localtime:ro
tmpfs: /tmp
# logging:
# driver: "json-file"
# options:
# max-file: 5
# max-size: 2m
The changes I made are:
1.) substitute "MSR" for "web" for the service name. This was just a precaution against a generic service name interfering with container management programs I use, and was not a needed/critical change to get things working.
2.) simplify the volume syntax for binding a data volume. The syntax you have on your website caused a yaml compile error with version: '3.7' compose.
3.) comment out the logging options. These options compiled, but threw a runtime JSON error that stopped the container from coming up:
ERROR: for MSR Cannot create container for service MSR: json: cannot unmarshal number into Go struct field LogConfig.HostConfig.LogConfig.Config of type string
ERROR: Encountered errors while bringing up the project.
I hope to cut out some time next week to start forming some logic. The web UI looks great.
@akbooer No errors in 2021.04.18. Thanks for this as the changes also stabilized my Mosquitto bridge connection, which tended to flop with every error message.
2021-04-18 15:29:04.173 luup.tasmota:262: Topic ignored : tele/power_ServerWork/LWT : Online
2021-04-18 15:29:04.175 luup.tasmota:262: Topic ignored : tele/power_MainVera/LWT : Online
2021-04-18 15:29:04.176 luup.tasmota:262: Topic ignored : tele/power_HAServer/LWT : Online
2021-04-18 15:29:04.177 luup.tasmota:262: Topic ignored : tele/power_SideLandscape/LWT : Online
2021-04-18 15:29:04.178 luup.tasmota:262: Topic ignored : tele/power_GarageVera/LWT : Online
The Connect packet:
MQ Telemetry Transport Protocol, Connect Command
Header Flags: 0x10, Message Type: Connect Command
Msg Len: 94
Protocol Name Length: 4
Protocol Name: MQTT
Version: Unknown (132)
Connect Flags: 0xec, User Name Flag, Password Flag, Will Retain, QoS Level: At least once delivery (Acknowledged deliver), Will Flag
1... .... = User Name Flag: Set
.1.. .... = Password Flag: Set
..1. .... = Will Retain: Set
...0 1... = QoS Level: At least once delivery (Acknowledged deliver) (1)
.... .1.. = Will Flag: Set
.... ..0. = Clean Session Flag: Not set
.... ...0 = (Reserved): Not set
Keep Alive: 60
Client ID Length: 14
Client ID: Thing.MosquittoBridge
Will Topic Length: 43
Will Topic: $SYS/broker/connection/Thing.MosquittoBridge/state
Will Message Length: 1
Will Message: 0
User Name Length: 6
User Name: YYYYYY
Password Length: 10
Password: XXXXXXXXXX
@akbooer No historian errors and all "checked" variables are publishing to my InfluxDB server.
@akbooer
The subscribe packet:
Frame 156: 81 bytes on wire (648 bits), 81 bytes captured (648 bits) on interface eth0, id 0
Ethernet II, Src: Advansus_0a:8c:3a (00:19:0f:0a:8c:3a), Dst: 96:62:08:fb:22:8a (96:62:08:fb:22:8a)
Internet Protocol Version 4, Src: 10.17.2.41, Dst: 10.17.2.110
Transmission Control Protocol, Src Port: 36446, Dst Port: 1882, Seq: 147, Ack: 9, Len: 15
MQ Telemetry Transport Protocol, Unsubscribe Request
Header Flags: 0xa2, Message Type: Unsubscribe Request
1010 .... = Message Type: Unsubscribe Request (10)
.... 0010 = Reserved: 2
Msg Len: 5
Message Identifier: 2
Topic Length: 1
Topic: #
MQ Telemetry Transport Protocol, Subscribe Request
Header Flags: 0x82, Message Type: Subscribe Request
1000 .... = Message Type: Subscribe Request (8)
.... 0010 = Reserved: 2
Msg Len: 6
Message Identifier: 3
Topic Length: 1
Topic: #
Requested QoS: At most once delivery (Fire and Forget) (0)
The connect ACK:
MQ Telemetry Transport Protocol, Connect Ack
Header Flags: 0x20, Message Type: Connect Ack
0010 .... = Message Type: Connect Ack (2)
.... 0000 = Reserved: 0
Msg Len: 2
Acknowledge Flags: 0x00
0000 000. = Reserved: Not set
.... ...0 = Session Present: Not set
Reason Code: Success (0)
@akbooer Yes but as you can see on the connect, the version is "Version: Unknown (132)"
This is what is causing the problem. After much searching and trying different configs, I stumbled on the following which solved the problem. From mosquitto.org
try_private [ true | false ]
If try_private is set to true, the bridge will attempt to indicate to the remote broker that it is a bridge not an ordinary client. If successful, this means that loop detection will be more effective and that retained messages will be propagated correctly. Not all brokers support this feature so it may be necessary to set try_private to false if your bridge does not connect properly.
Defaults to true.
So I set the attribute to false in my bridge config and immediately connected openLuup to the mosquitto broker. The connect packet shows the right version, and with a luup reload, all of my mosquitto broker topics populated in mqtt explorer that was pointed at openLuup. However, I don't see the topics in the mqtt console on openLuup?? Which is odd because I not only see the openLuup topics in explorer, but I see the topics actively changing.
I'm not a good one to suggest code changes, but since this mosquitto setting defaults to true, can you try to incorporate the try_private flag in openLuup's MQTT server.... It took a long time to track this down and I imagine anyone else that tries to connect the two servers will be in for a similar bug fix adventure.
@akbooer Yes, I was thinking along those lines as the bridge config allows filters. The latest openLuup version now works fine with try_private flag set to default (true). Thanks for nailing this down and your work is definitely appreciated. Below is the connection to openLuup.
Here's my Mosquitto config for anyone who wants to bridge the two brokers:
allow_anonymous true
password_file /mosquitto/data/PW.txt
listener 1883
connection openLuup
address 127.0.0.1:1882
topic # out 0
topic # in 0
cleansession false
notifications true
username XXXXX
password YYYYYYYYYY
bridge_protocol_version mqttv311
Most of these settings can/should be modified to suit one's particular needs, but the settings should be employed. The password file for mosquitto needs to be encrypted with mosquitto's built-in encryption tool. The directions are straightforward and are described in on-line documents.