-
Hi @akbooer
Just bringing this over as suggested..
I’ve started to use the console view a lot more, mainly for it’s look and simplicity , but I noticed it does not do any live updates compared to ALTUI, you have to do a full browser reload. Is that by design, or is mine not working?
Also if I want to go strait to the console view, rather than into ALTUI, I recall seeing something abut altering that in the guide by for the life of me I can’t find it. Is it possible to do, if so how would I do that..
You suggested this was something you were looking at ? Also you said You don't need a "full browser reload", just click on the display menu item to refresh the screen. - what do you mean by `display menu?
-
A long while ago (May, 2015) I wrote my 2000-th post on another forum: openLuup - running unmodified plugins on any machine. Here’s the gist of it:
...I want to work in a more open and stable [Vera] environment...
...All would be solved if Luup was open source and could be run on the plethora of cheap and reliable hardware available today. But it’s not. But we could get something like that effect if we engineered a sufficient subset of Luup to run on such a platform. Could it be done? What would we need?
1. UI
2. scheduler
3. web server
4. Luup compatible API
5. Device and Implementation xml file reader
6. Zwave bridge to Vera
7. runs most plugins without modificationWhat we wouldn’t need is UPnP.
What have we (nearly) got already?
We have, courtesy of @amg0, the most excellent AltUI: Alternate UI to UI7, and that, I think, is probably the hardest one to do in the above list. Items 2 - 5, and 7, I’ve prototyped, in pure Lua, and posted elsewhere: DataYours on Raspberry Pi, running selected plugins unmodified, including: DataYours, EventWatcher, Netatmo, RBLuaTest, altUI. See screenshot attached.Is it worth the effort? Probably not. Will I pursue this quest? Yes.
openLuup was the result.
-
Very minor issue: was messing about renaming a few rooms and ended up with a room being listed twice. One with the room's contents and the other with no room contents.
It simply turns out one room name had a trailing space. It is possible in both AltUI and the openLuup console to create a room name with a trailing space. Once having done so chaos then ensues, as the rooms are not necessarily treated as different and become difficult to manipulate.
Just need to trim white space off room names. Haven't tested if it's possible to add in leading spaces. That may also be possible.
-
Hey guys...
Long time... 😉
Since my first day with Vera, I'm using RulesEngine from @vosmont to handle complex rules that will do something based on multiple condition base on "true/false" and also based on time.
Do you think I will be able to do that directly with LUA in openLuup ?
For example..
IF bedroom-motion1 is not detecting motion for 15 minutes
AND
IF bedroom-motion2 is not detecting motion for 15 minutes
AND
IF current-time is between 6am and 11pm
AND
IF binary-light1 is OFF
AND
IF binary-light2 is OFF
THEN
execute LUA code
WAIT 2 minute
execute LUA codeBUT IF any "conditions" failed while in the "THEN" , It need to stop...
I currently have around 60 rules like that 😞
-
Hoping you could tell us a bit about your experiences with ZWaveJS and MQTT.
-
Currently I have a Vera and Hue hub all reliably controlled by openLuup with AltUI, plus any number of plugins. Been working really well for a few years now. However would like to head for a more MQTT based set up. Eliminate the Hue hub and hopefully eliminate Vera by using ZWAVE JS UI. Noting that Zwavejs2mqtt has been renamed to Z-Wave JS UI. Probably also run the stuff using Docker. Just because. Everything would end up on the one computer for easier management. Erhhh that's the hope.
Some of the new Zigbee Aqara stuff is very good and inexpensive plus it fits in with HomeKit. Also the Aqara battery powered stuff looks to have a good battery lifetime: ie suggested up to five years. The battery operated Hue buttons I have; have lasted for ages. Would like to use zigbee2mqtt with a SonOff dongle, which would allow access to the over two and half thousand devices zigbee2mqtt now supports:
| Zigbee2MQTT
AK has the MQTT stuff working in openLuup. Have played around with it and it works well, as one would expect. Love the UDP to MQTT code.
Shellys are great and also very inexpensive and they spit out & accept MQTT but I would prefer to stay away from WiFi. Not meshed and higher power consumption. Horses for courses.
Now here's the query:
Got about forty or more ZWave twin light switches, plus a few other ZWave bits & pieces such as blind controllers. Then there are the Hue devices on top of that. That's a lot of virtual devices to set up in openLuup. What's an appropriate way to do this?It seems there is no "auto magic bridge set up". Do I need to use say @therealdb's Virtual Devices plugin that supports MQTT or is there some other approach?
I have to confess I still don't understand the master child approach in that plugin. Seems one light switch would have all the other light switches hanging off it? Helps Vera but not a problem with openLuup - why is that? Suspect AK's good coding beats Vera's?
GitHub - dbochicchio/vera-VirtualDevices: Virtual HTTP Devices plug-in for Vera and openLuup GitHub - dbochicchio/vera-VirtualDevices: Virtual HTTP Devices plug-in for Vera and openLuup
Virtual HTTP Devices plug-in for Vera and openLuup - GitHub - dbochicchio/vera-VirtualDevices: Virtual HTTP Devices plug-in for Vera and openLuup
Setting up manually say 100 virtual devices is a bit much to ask. I had a look at hacking the user_data.json file. Good approach till you see all the UIDs and the individually numbered ControlURL and EventURLs that need to be set up.
I need some way of say of creating about 80 light switches in "No room" or in say the "ZWave upgrade" room. Or say some sort of code that could go through all my existing bridged ZWAVE devices in openLuup and create virtual devices for each one. I caould then use the openLuup console to name them and place them in their rooms:
openLuup_IP_address:3480/console?page=devices_table
At that point I could hack the user_data.json file to insert the MQTT topics fairly easily for each? Plus any other fine tuning needed.
Then the old ZWave stuff could be swapped over to ZWAVE JS UI and all the virtual MQTT devices would be ready to go or am I dreaming? Then delete all the old Vera bridged stuff. I'm not too fussed about scene code and the like, as a I have all my code in one block, that is set up in the openLuup start up.
It seems that with ZWay you can create all the ZWave device by doing some sort of interrogation of ZWay's API? Seems also to be the case with the Shelleys?
So any ideas, suggestions or code snippets are welcome on how to move towards MQTT and in particular ZWAVE JS UI and zigbee2mqtt.
I'm in no hurry as openLuup is performing nicely, with the old Vera handling all my ZWave devices.
-
-
Bit of an odd one this:
Bare metal install on Debian Bullseye (Intel NUC)I've noticed when travelling, I connect to my L2TP VPN and I cannot get AltUI to update. I just get 'Waiting Initial Data'
Specifically this is in Chrome:
Version 108.0.5359.94 (Official Build) (x86_64)
In Chrome I can access and control everything via the Openluup console.
In Chrome I can also access and control everything via the Z-Wave expert UI and Z-Wave UIIn Safari I get a more complete view of AltUI but loads of errors along the lines of:
the module or function ALTUI_PluginDisplays.drawBinaryLight does not exist, check your configurationHomewave on my iOS devices is fine across the same VPN config,
I can ssh into all my serversNot a huge issue, just curious if anyone has any thoughts of what I might tweak to resolve it?
(FWIW I also access my IMAP and SMTP servers across the same VPN with no issues, as well as remote desktop. Also MS Reactor on the same host as Openluup)
TIA for any thoughts
C
-
Hi Ak,
Not sure when it started as it took me a while to notice.
I have a function on a luup.call_timer to turn on a switch and then use a luup.call_delay to turn it off a minute later. This is done by the same global function, but on the luup.call_delay i get a message in the log : "luup.call_delay:: unknown global function name: HouseDevice1_PumpCommand"
This is in the init function:
luup.call_timer("HouseDevice1_PumpCommand", 2, "2:15:00", hm_Heating.PumpHealthRunDay, hm_Heating.PumpCMD.HEALTH.."1", true)This is in the function to schedule to off command giving the global function name not found:
luup.call_delay("HouseDevice1_PumpCommand", hm_Heating.PumpHealthOnDuration, hm_Heating.PumpCMD.HEALTH.."0")Is it because I use the "TRUE" parameter that is openLuup specific so the timer does not fire just once?
Running v21.7.25, may be time to update?
Cheers Rene
-
Hi, I have been trying to install OpenLuup on MacOS but I am failing, so far.
Is there a step-by-step instruction (for MacOS) to follow?After installing LuaRocks, luasec, luafilesystem and luasocket I then try to run lua5.1 openLuup_install.lua and then get the messages below.
Any ideas and proposals are appreciated.
Regards
JanopenLuup_install 2019.02.15 @akbooer
lua5.1: openLuup_install.lua:18: module ‘socket.http’ not found:
no field package.preload[‘socket.http’]
no file ‘./socket/http.lua’
no file ‘/usr/local/share/lua/5.1/socket/http.lua’
no file ‘/usr/local/share/lua/5.1/socket/http/init.lua’
no file ‘/usr/local/lib/lua/5.1/socket/http.lua’
no file ‘/usr/local/lib/lua/5.1/socket/http/init.lua’
no file ‘./socket/http.so’
no file ‘/usr/local/lib/lua/5.1/socket/http.so’
no file ‘/usr/local/lib/lua/5.1/loadall.so’
no file ‘./socket.so’
no file ‘/usr/local/lib/lua/5.1/socket.so’
no file ‘/usr/local/lib/lua/5.1/loadall.so’
stack traceback:
[C]: in function ‘require’
openLuup_install.lua:18: in main chunk -
Every now and then my openLuup stops responding. This is the LuaUPnP.log when it happens:
2021-08-20 14:59:39.827 :: openLuup LOG ROTATION :: (runtime 11.0 days) 2021-08-20 14:59:39.831 openLuup.server:: GET /data_request?id=sdata HTTP/1.1 tcp{client}: 0x55b6023b8088 2021-08-20 14:59:39.853 openLuup.server:: request completed (49215 bytes, 4 chunks, 22 ms) tcp{client}: 0x55b6023b8088 2021-08-20 14:59:39.854 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55b6023b8088 2021-08-20 14:59:40.826 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b600f46ab8 2021-08-20 14:59:40.829 openLuup.server:: GET /data_request?id=sdata HTTP/1.1 tcp{client}: 0x55b600f46ab8 2021-08-20 14:59:40.846 openLuup.server:: request completed (49215 bytes, 4 chunks, 16 ms) tcp{client}: 0x55b600f46ab8 2021-08-20 14:59:40.847 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55b600f46ab8 2021-08-20 14:59:41.827 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b600d1ad98 2021-08-20 14:59:41.829 openLuup.server:: GET /data_request?id=sdata HTTP/1.1 tcp{client}: 0x55b600d1ad98 2021-08-20 14:59:41.838 openLuup.server:: request completed (49215 bytes, 4 chunks, 8 ms) tcp{client}: 0x55b600d1ad98 2021-08-20 14:59:41.838 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55b600d1ad98 2021-08-20 14:59:42.827 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b6016b9848 2021-08-20 14:59:42.829 openLuup.server:: GET /data_request?id=sdata HTTP/1.1 tcp{client}: 0x55b6016b9848 2021-08-20 14:59:42.847 openLuup.server:: request completed (49215 bytes, 4 chunks, 17 ms) tcp{client}: 0x55b6016b9848 2021-08-20 14:59:42.876 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55b6016b9848 2021-08-20 14:59:43.054 luup.watch_callback:: 30003.DS18B20.Temperature called [37]virtualSensorWatchCallback() function: 0x55b600c2fff0 2021-08-20 14:59:43.054 luup.variable_set:: 38.urn:toggledbits-com:serviceId:VirtualSensor1.PreviousRawValue was: 28.3 now: 28.5 #hooks:0 2021-08-20 14:59:43.054 luup.variable_set:: 38.urn:toggledbits-com:serviceId:VirtualSensor1.RawValue was: 28.5 now: 28.4 #hooks:0 2021-08-20 14:59:43.054 luup.variable_set:: 38.urn:upnp-org:serviceId:TemperatureSensor1.CurrentTemperature was: 28.5 now: 28.4 #hooks:0 2021-08-20 14:59:43.054 luup.variable_set:: 38.urn:toggledbits-com:serviceId:VirtualSensor1.PreviousValue was: 28.3 now: 28.5 #hooks:0 2021-08-20 14:59:43.054 luup.variable_set:: 38.urn:toggledbits-com:serviceId:VirtualSensor1.LastUpdate was: 1629464323 now: 1629464383 #hooks:0 2021-08-20 14:59:43.265 openLuup.server:: request completed (3193 bytes, 1 chunks, 5550 ms) tcp{client}: 0x55b60162e488 2021-08-20 14:59:43.267 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55b60162e488 2021-08-20 14:59:43.278 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b6023c8458 2021-08-20 14:59:43.278 openLuup.server:: GET /data_request?id=status&DataVersion=516611499&Timeout=15&MinimumDelay=100&output_format=json&_r=1629464383277 HTTP/1.1 tcp{client}: 0x55b6023c8458 2021-08-20 14:59:43.381 openLuup.server:: request completed (1091 bytes, 1 chunks, 102 ms) tcp{client}: 0x55b6023c8458 2021-08-20 14:59:43.381 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55b6023c8458 2021-08-20 14:59:43.392 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b6013d6cc8 2021-08-20 14:59:43.393 openLuup.server:: GET /data_request?id=status&DataVersion=516611500&Timeout=15&MinimumDelay=100&output_format=json&_r=1629464383391 HTTP/1.1 tcp{client}: 0x55b6013d6cc8 2021-08-20 14:59:43.496 openLuup.server:: request completed (3196 bytes, 1 chunks, 4981 ms) tcp{client}: 0x55b601a37db8 2021-08-20 14:59:43.826 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b601d05a08 2021-08-20 14:59:43.828 openLuup.server:: GET /data_request?id=sdata HTTP/1.1 tcp{client}: 0x55b601d05a08 2021-08-20 14:59:43.844 openLuup.server:: request completed (49215 bytes, 4 chunks, 15 ms) tcp{client}: 0x55b601d05a08 2021-08-20 14:59:43.844 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55b601d05a08 2021-08-20 14:59:44.524 openLuup.server:: GET /data_request?id=lu_status2&output_format=json&DataVersion=516611500&Timeout=60&MinimumDelay=1500&_=1629292536029 HTTP/1.1 tcp{client}: 0x55b601a37db8 2021-08-20 14:59:44.828 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b6023a7d18 2021-08-20 14:59:44.831 openLuup.server:: GET /data_request?id=sdata HTTP/1.1 tcp{client}: 0x55b6023a7d18 2021-08-20 14:59:44.844 openLuup.server:: request completed (49215 bytes, 4 chunks, 12 ms) tcp{client}: 0x55b6023a7d18 2021-08-20 14:59:44.844 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55b6023a7d18 2021-08-20 14:59:45.514 openLuup.server:: GET /data_request?id=variableget&DeviceNum=0&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&Variable=Mode&_=1629292536030 HTTP/1.1 tcp{client}: 0x55b601ab8228 2021-08-20 14:59:45.617 openLuup.server:: request completed (1 bytes, 1 chunks, 102 ms) tcp{client}: 0x55b601ab8228 2021-08-20 14:59:45.827 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b600b8de38 2021-08-20 14:59:45.828 openLuup.server:: GET /data_request?id=sdata HTTP/1.1 tcp{client}: 0x55b600b8de38 2021-08-20 14:59:45.834 openLuup.server:: request completed (49215 bytes, 4 chunks, 5 ms) tcp{client}: 0x55b600b8de38 2021-08-20 14:59:45.836 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55b600b8de38 2021-08-20 14:59:46.828 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b6018a53f8 2021-08-20 14:59:46.830 openLuup.server:: GET /data_request?id=sdata HTTP/1.1 tcp{client}: 0x55b6018a53f8 2021-08-20 14:59:46.841 openLuup.server:: request completed (49215 bytes, 4 chunks, 11 ms) tcp{client}: 0x55b6018a53f8 2021-08-20 14:59:46.842 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55b6018a53f8 2021-08-20 14:59:47.829 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b600d2d938 2021-08-20 14:59:47.832 openLuup.server:: GET /data_request?id=sdata HTTP/1.1 tcp{client}: 0x55b600d2d938 2021-08-20 14:59:47.854 openLuup.server:: request completed (49215 bytes, 4 chunks, 21 ms) tcp{client}: 0x55b600d2d938 2021-08-20 14:59:47.855 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55b600d2d938 2021-08-20 14:59:47.962 luup.variable_set:: 10086.urn:upnp-org:serviceId:TemperatureSensor1.CurrentTemperature was: 28.3 now: 28.5 #hooks:0 2021-08-20 14:59:48.370 openLuup.server:: request completed (1359 bytes, 1 chunks, 4977 ms) tcp{client}: 0x55b6013d6cc8 2021-08-20 14:59:48.372 openLuup.server:: request completed (1359 bytes, 1 chunks, 3847 ms) tcp{client}: 0x55b601a37db8 2021-08-20 14:59:48.373 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55b6013d6cc8 2021-08-20 14:59:48.384 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b601e62df8 2021-08-20 14:59:48.385 openLuup.server:: GET /data_request?id=status&DataVersion=516611502&Timeout=15&MinimumDelay=100&output_format=json&_r=1629464388383 HTTP/1.1 tcp{client}: 0x55b601e62df8 2021-08-20 14:59:48.813 openLuup.server:: GET /data_request?id=lu_status2&output_format=json&DataVersion=516611502&Timeout=60&MinimumDelay=1500&_=1629292536031 HTTP/1.1 tcp{client}: 0x55b601a37db8 2021-08-20 14:59:48.829 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b600c44bf8 2021-08-20 14:59:48.832 openLuup.server:: GET /data_request?id=sdata HTTP/1.1 tcp{client}: 0x55b600c44bf8 2021-08-20 14:59:48.854 openLuup.server:: request completed (49215 bytes, 4 chunks, 21 ms) tcp{client}: 0x55b600c44bf8 2021-08-20 14:59:48.856 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55b600c44bf8 2021-08-20 14:59:49.829 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b600e1fea8 2021-08-20 14:59:49.830 openLuup.server:: GET /data_request?id=sdata HTTP/1.1 tcp{client}: 0x55b600e1fea8 2021-08-20 14:59:49.835 openLuup.server:: request completed (49215 bytes, 4 chunks, 5 ms) tcp{client}: 0x55b600e1fea8 2021-08-20 14:59:49.835 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55b600e1fea8 2021-08-20 14:59:50.831 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b601cfa118 2021-08-20 14:59:50.832 openLuup.server:: GET /data_request?id=sdata HTTP/1.1 tcp{client}: 0x55b601cfa118 2021-08-20 14:59:50.837 openLuup.server:: request completed (49215 bytes, 4 chunks, 4 ms) tcp{client}: 0x55b601cfa118 2021-08-20 14:59:50.838 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55b601cfa118 2021-08-20 14:59:51.833 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b601462bb8 2021-08-20 14:59:51.835 openLuup.server:: GET /data_request?id=sdata HTTP/1.1 tcp{client}: 0x55b601462bb8 2021-08-20 14:59:51.852 openLuup.server:: request completed (49215 bytes, 4 chunks, 17 ms) tcp{client}: 0x55b601462bb8 2021-08-20 14:59:51.854 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55b601462bb8 2021-08-20 14:59:52.834 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b6016b1c98 2021-08-20 14:59:52.836 openLuup.server:: GET /data_request?id=sdata HTTP/1.1 tcp{client}: 0x55b6016b1c98 2021-08-20 14:59:52.847 openLuup.server:: request completed (49215 bytes, 4 chunks, 11 ms) tcp{client}: 0x55b6016b1c98 2021-08-20 14:59:52.848 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55b6016b1c98 2021-08-20 14:59:53.193 luup.variable_set:: 10005.urn:micasaverde-com:serviceId:SceneController1.sl_SceneActivated was: 255 now: 255 #hooks:0 2021-08-20 14:59:53.193 luup.variable_set:: 10006.urn:micasaverde-com:serviceId:HaDevice1.sl_TamperAlarm was: 0 now: 0 #hooks:0 2021-08-20 14:59:53.193 luup.variable_set:: 10094.urn:micasaverde-com:serviceId:HaDevice1.sl_BatteryAlarm was: 0 now: 0 #hooks:0 2021-08-20 14:59:53.193 luup.variable_set:: 10096.urn:micasaverde-com:serviceId:HaDevice1.sl_BatteryAlarm was: 10 now: 10 #hooks:0 2021-08-20 14:59:53.193 luup.variable_set:: 10098.urn:micasaverde-com:serviceId:HaDevice1.sl_BatteryAlarm was: 10 now: 10 #hooks:0 2021-08-20 14:59:53.193 luup.variable_set:: 10104.urn:micasaverde-com:serviceId:HaDevice1.sl_BatteryAlarm was: 10 now: 10 #hooks:0 2021-08-20 14:59:53.194 luup.variable_set:: 10106.urn:micasaverde-com:serviceId:HaDevice1.sl_BatteryAlarm was: 0 now: 0 #hooks:0 2021-08-20 14:59:53.194 luup.variable_set:: 10109.urn:micasaverde-com:serviceId:HaDevice1.sl_BatteryAlarm was: 0 now: 0 #hooks:0 2021-08-20 14:59:53.194 luup.variable_set:: 10112.urn:micasaverde-com:serviceId:DoorLock1.sl_UserCode was: UserID="4" UserName="Ella" now: UserID="4" UserName="Ella" #hooks:0 2021-08-20 14:59:53.194 luup.variable_set:: 10112.urn:micasaverde-com:serviceId:DoorLock1.sl_LockButton was: 1 now: 1 #hooks:0 2021-08-20 14:59:53.194 luup.variable_set:: 10112.urn:micasaverde-com:serviceId:DoorLock1.sl_PinFailed was: 1 now: 1 #hooks:0 2021-08-20 14:59:53.194 luup.variable_set:: 10112.urn:micasaverde-com:serviceId:HaDevice1.sl_BatteryAlarm was: 0 now: 0 #hooks:0 2021-08-20 14:59:53.194 luup.variable_set:: 10131.urn:micasaverde-com:serviceId:HaDevice1.sl_TamperAlarm was: 0 now: 0 #hooks:0 2021-08-20 14:59:53.194 luup.variable_set:: 10132.urn:micasaverde-com:serviceId:HaDevice1.sl_TamperAlarm was: 0 now: 0 #hooks:0 2021-08-20 14:59:53.194 luup.variable_set:: 10133.urn:micasaverde-com:serviceId:HaDevice1.sl_TamperAlarm was: 0 now: 0 #hooks:0 2021-08-20 14:59:53.194 luup.variable_set:: 10165.urn:micasaverde-com:serviceId:HaDevice1.sl_Alarm was: SMOKE now: SMOKE #hooks:0 2021-08-20 14:59:53.194 luup.variable_set:: 10165.urn:micasaverde-com:serviceId:HaDevice1.sl_TamperAlarm was: 0 now: 0 #hooks:0 2021-08-20 14:59:53.194 luup.variable_set:: 10188.urn:micasaverde-com:serviceId:HaDevice1.sl_TamperAlarm was: 1 now: 1 #hooks:0 2021-08-20 14:59:53.194 luup.variable_set:: 10188.urn:micasaverde-com:serviceId:HaDevice1.sl_Alarm was: TAMPER_ALARM now: TAMPER_ALARM #hooks:0 2021-08-20 14:59:53.194 luup.variable_set:: 10191.urn:micasaverde-com:serviceId:HaDevice1.sl_BatteryAlarm was: 10 now: 10 #hooks:0 2021-08-20 14:59:53.299 openLuup.server:: request completed (5449 bytes, 1 chunks, 4485 ms) tcp{client}: 0x55b601a37db8 2021-08-20 14:59:53.505 openLuup.server:: request completed (5449 bytes, 1 chunks, 5119 ms) tcp{client}: 0x55b601e62df8 2021-08-20 14:59:53.511 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55b601e62df8 2021-08-20 14:59:53.513 openLuup.server:: GET /data_request?id=lu_status2&output_format=json&DataVersion=516611523&Timeout=60&MinimumDelay=1500&_=1629292536032 HTTP/1.1 tcp{client}: 0x55b601a37db8 2021-08-20 14:59:53.522 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b600bc7068 2021-08-20 14:59:53.524 openLuup.server:: GET /data_request?id=status&DataVersion=516611523&Timeout=15&MinimumDelay=100&output_format=json&_r=1629464393521 HTTP/1.1 tcp{client}: 0x55b600bc7068 2021-08-20 14:59:53.834 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b601b8cbe8 2021-08-20 14:59:53.835 openLuup.server:: GET /data_request?id=sdata HTTP/1.1 tcp{client}: 0x55b601b8cbe8 2021-08-20 14:59:53.840 openLuup.server:: request completed (49215 bytes, 4 chunks, 5 ms) tcp{client}: 0x55b601b8cbe8 2021-08-20 14:59:53.841 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55b601b8cbe8 2021-08-20 14:59:54.834 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b6013dacd8 2021-08-20 14:59:54.836 openLuup.server:: GET /data_request?id=sdata HTTP/1.1 tcp{client}: 0x55b6013dacd8 2021-08-20 14:59:54.849 openLuup.server:: request completed (49215 bytes, 4 chunks, 12 ms) tcp{client}: 0x55b6013dacd8 2021-08-20 14:59:54.850 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55b6013dacd8 2021-08-20 14:59:55.835 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b602316198 2021-08-20 14:59:55.836 openLuup.server:: GET /data_request?id=sdata HTTP/1.1 tcp{client}: 0x55b602316198 2021-08-20 14:59:55.841 openLuup.server:: request completed (49215 bytes, 4 chunks, 5 ms) tcp{client}: 0x55b602316198 2021-08-20 14:59:55.842 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55b602316198 2021-08-20 15:00:10.955 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b601547598 2021-08-20 15:00:10.955 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b6016c7cf8 2021-08-20 15:00:10.955 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b600b75158 2021-08-20 15:00:10.955 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b60187d188 2021-08-20 15:00:10.955 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b6011a5bf8 2021-08-20 15:00:10.955 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b60115ecd8 2021-08-20 15:00:10.955 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b601018c18 2021-08-20 15:00:10.956 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b60175d068 2021-08-20 15:00:10.956 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b60224ced8 2021-08-20 15:00:10.956 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b6017869d8 2021-08-20 15:00:10.956 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b601ab40e8 2021-08-20 15:00:10.956 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b601914178 2021-08-20 15:00:10.956 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b60100a228 2021-08-20 15:00:10.956 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b60197a998 2021-08-20 15:00:10.956 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b601103238 2021-08-20 15:00:10.956 openLuup.io.server:: MQTT:1888 connection from 127.0.0.1 tcp{client}: 0x55b600c62438 2021-08-20 15:00:10.956 openLuup.io.server:: MQTT:1888 connection from 127.0.0.1 tcp{client}: 0x55b601eaabf8 2021-08-20 15:00:10.956 openLuup.io.server:: MQTT:1888 connection from 127.0.0.1 tcp{client}: 0x55b6017c95b8 2021-08-20 15:00:10.956 openLuup.io.server:: MQTT:1888 connection from 127.0.0.1 tcp{client}: 0x55b600d6e508 2021-08-20 15:00:10.956 openLuup.io.server:: MQTT:1888 connection from 127.0.0.1 tcp{client}: 0x55b601dd2168 2021-08-20 15:00:10.956 openLuup.io.server:: MQTT:1888 connection from 127.0.0.1 tcp{client}: 0x55b60155eb68 2021-08-20 15:00:10.957 openLuup.io.server:: MQTT:1888 connection from 127.0.0.1 tcp{client}: 0x55b6016ddcd8 2021-08-20 15:00:10.957 openLuup.io.server:: MQTT:1888 connection from 127.0.0.1 tcp{client}: 0x55b602384ca8 2021-08-20 15:00:10.957 openLuup.io.server:: MQTT:1888 connection from 127.0.0.1 tcp{client}: 0x55b60230cc78 2021-08-20 15:00:10.957 openLuup.io.server:: MQTT:1888 connection from 127.0.0.1 tcp{client}: 0x55b6017e3338 2021-08-20 15:00:10.957 openLuup.io.server:: MQTT:1888 connection from 127.0.0.1 tcp{client}: 0x55b600965de8 2021-08-20 15:00:10.957 openLuup.io.server:: MQTT:1888 connection from 127.0.0.1 tcp{client}: 0x55b601e23608 2021-08-20 15:00:10.957 openLuup.io.server:: MQTT:1888 connection from 127.0.0.1 tcp{client}: 0x55b6018da2f8 2021-08-20 15:00:10.957 openLuup.io.server:: MQTT:1888 connection from 127.0.0.1 tcp{client}: 0x55b600c9aa08 2021-08-20 15:00:10.957 openLuup.io.server:: MQTT:1888 connection from 127.0.0.1 tcp{client}: 0x55b600bbf0f8 2021-08-20 15:00:10.957 openLuup.io.server:: MQTT:1888 connection from 127.0.0.1 tcp{client}: 0x55b601334518 2021-08-20 15:00:10.958 openLuup.io.server:: MQTT:1888 connection from 127.0.0.1 tcp{client}: 0x55b60183b5f8 2021-08-20 15:00:10.958 openLuup.io.server:: MQTT:1888 connection from 127.0.0.1 tcp{client}: 0x55b6015682a8 2021-08-20 15:00:10.958 openLuup.io.server:: MQTT:1888 connection from 127.0.0.1 tcp{client}: 0x55b6018869e8 2021-08-20 15:00:10.958 openLuup.io.server:: MQTT:1888 connection from 127.0.0.1 tcp{client}: 0x55b6008839c8 2021-08-20 15:00:10.958 openLuup.io.server:: MQTT:1888 connection from 127.0.0.1 tcp{client}: 0x55b60154ed58 2021-08-20 15:00:10.959 openLuup.io.server:: MQTT:1888 connection from 127.0.0.1 tcp{client}: 0x55b601a259e8 2021-08-20 15:00:10.959 openLuup.io.server:: MQTT:1888 connection from 127.0.0.1 tcp{client}: 0x55b600f617c8 2021-08-20 15:00:10.959 openLuup.io.server:: MQTT:1888 connection from 127.0.0.1 tcp{client}: 0x55b6015884c8 2021-08-20 15:00:10.959 openLuup.io.server:: MQTT:1888 connection from 127.0.0.1 tcp{client}: 0x55b601c85fe8 2021-08-20 15:00:10.959 openLuup.io.server:: MQTT:1888 connection from 127.0.0.1 tcp{client}: 0x55b602275ae8 2021-08-20 15:00:10.959 openLuup.io.server:: MQTT:1888 connection from 127.0.0.1 tcp{client}: 0x55b60190ab88 2021-08-20 15:00:10.959 openLuup.io.server:: MQTT:1888 connection from 127.0.0.1 tcp{client}: 0x55b601692038 2021-08-20 15:00:10.959 openLuup.io.server:: MQTT:1888 connection from 127.0.0.1 tcp{client}: 0x55b601fcea78 2021-08-20 15:00:10.960 openLuup.io.server:: MQTT:1888 connection from 127.0.0.1 tcp{client}: 0x55b601ca7f28 2021-08-20 15:00:10.960 openLuup.io.server:: MQTT:1888 connection from 127.0.0.1 tcp{client}: 0x55b601fd37f8 2021-08-20 15:00:10.960 openLuup.io.server:: MQTT:1888 connection from 127.0.0.1 tcp{client}: 0x55b6020ec968 2021-08-20 15:00:10.961 openLuup.server:: GET /data_request?id=variableget&DeviceNum=0&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&Variable=Mode&_=1629292536033 HTTP/1.1 tcp{client}: 0x55b601ab8228 2021-08-20 15:00:10.967 luup_log:0: 32Mb, 3.3%cpu, 11.0days 2021-08-20 15:00:10.972 openLuup.server:: request completed (3361 bytes, 1 chunks, 17459 ms) tcp{client}: 0x55b601a37db8 2021-08-20 15:00:10.973 openLuup.server:: request completed (3361 bytes, 1 chunks, 17449 ms) tcp{client}: 0x55b600bc7068 2021-08-20 15:00:10.990 luup.variable_set:: 10116.urn:upnp-org:serviceId:TemperatureSensor1.CurrentTemperature was: 21.8 now: 21.9 #hooks:0 2021-08-20 15:00:10.990 luup.variable_set:: 10129.urn:micasaverde-com:serviceId:HumiditySensor1.CurrentLevel was: 58.8 now: 58.7 #hooks:0 2021-08-20 15:00:10.991 openLuup.io.server:: MQTT:1888 connection closed tcp{client}: 0x55b600ba45a8 2021-08-20 15:00:10.991 openLuup.mqtt:: closed tcp{client}: 0x55b600ba45a8 2021-08-20 15:00:10.992 openLuup.mqtt:: mqttthing_Klimat kllaren_838dee2e UNSUBSCRIBE from tele/Källartemp/SENSOR tcp{client}: 0x55b600ba45a8 2021-08-20 15:00:10.992 openLuup.mqtt:: ERROR publishing application message for mqtt:tele/Källartemp/SENSOR : closed 2021-08-20 15:00:10.992 openLuup.io.server:: HTTP:3480 connection from 127.0.0.1 tcp{client}: 0x55b601c8c288 2021-08-20 15:00:10.992 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55b600bc7068 2021-08-20 15:00:10.992 openLuup.server:: GET /data_request?id=sdata HTTP/1.1 tcp{client}: 0x55b601547598 2021-08-20 15:00:10.993 openLuup.io.server:: MQTT:1888 connection closed tcp{client}: 0x55b600a62818 2021-08-20 15:00:10.993 openLuup.mqtt:: RECEIVE ERROR: closed tcp{client}: 0x55b600a62818 2021-08-20 15:00:10.994 openLuup.mqtt:: mqttthing_Uttag garaget_6f4265a1 UNSUBSCRIBE from openLuup/update/10149/SwitchPower1/Status tcp{client}: 0x55b600a62818 2021-08-20 15:00:10.994 openLuup.io.server:: MQTT:1888 connection closed tcp{client}: 0x55b600ba8428 2021-08-20 15:00:10.994 openLuup.mqtt:: RECEIVE ERROR: closed tcp{client}: 0x55b600ba8428 2021-08-20 15:00:10.994 openLuup.mqtt:: mqttthing_Takflkt hallen_6da387bf UNSUBSCRIBE from tele/TakfläktHall/LWT tcp{client}: 0x55b600ba8428 2021-08-20 15:00:10.994 openLuup.mqtt:: mqttthing_Takflkt hallen_6da387bf UNSUBSCRIBE from stat/TakfläktHall/POWER2 tcp{client}: 0x55b600ba8428 2021-08-20 15:00:10.994 openLuup.io.server:: MQTT:1888 connection closed tcp{client}: 0x55b600e59b88 2021-08-20 15:00:10.994 openLuup.mqtt:: RECEIVE ERROR: closed tcp{client}: 0x55b600e59b88 2021-08-20 15:00:10.994 openLuup.mqtt:: mqttthing_Klimat sovrummet_0d664e41 UNSUBSCRIBE from openLuup/update/20010/HumiditySensor1/CurrentLevel tcp{client}: 0x55b600e59b88 2021-08-20 15:00:10.994 openLuup.mqtt:: mqttthing_Klimat sovrummet_0d664e41 UNSUBSCRIBE from openLuup/update/20021/TemperatureSensor1/CurrentTemperature tcp{client}: 0x55b600e59b88 2021-08-20 15:00:10.994 openLuup.io.server:: MQTT:1888 connection closed tcp{client}: 0x55b600bd02d8 2021-08-20 15:00:10.994 openLuup.mqtt:: RECEIVE ERROR: closed tcp{client}: 0x55b600bd02d8 2021-08-20 15:00:10.994 openLuup.mqtt:: mqttthing_Entrdrr_6acda58a UNSUBSCRIBE from openLuup/update/10095/SecuritySensor1/Tripped tcp{client}: 0x55b600bd02d8 2021-08-20 15:00:10.995 openLuup.io.server:: MQTT:1888 connection closed tcp{client}: 0x55b600bb6cf8 2021-08-20 15:00:10.995 openLuup.mqtt:: RECEIVE ERROR: closed tcp{client}: 0x55b600bb6cf8 2021-08-20 15:00:10.995 openLuup.mqtt:: mqttthing_Temperatur poolen_a589d192 UNSUBSCRIBE from tele/Pooltemp/SENSOR tcp{client}: 0x55b600bb6cf8 2021-08-20 15:00:10.995 openLuup.io.server:: MQTT:1888 connection closed tcp{client}: 0x55b6009ff868 2021-08-20 15:00:10.995 openLuup.mqtt:: RECEIVE ERROR: closed tcp{client}: 0x55b6009ff868 2021-08-20 15:00:10.995 openLuup.mqtt:: mqttthing_Rrelsesensor hallen_cf7c8293 UNSUBSCRIBE from openLuup/update/20013/SecuritySensor1/Tripped tcp{client}: 0x55b6009ff868 2021-08-20 15:00:10.995 openLuup.io.server:: MQTT:1888 connection closed tcp{client}: 0x55b600a23e28 2021-08-20 15:00:10.995 openLuup.mqtt:: RECEIVE ERROR: closed tcp{client}: 0x55b600a23e28 2021-08-20 15:00:10.995 openLuup.mqtt:: mqttthing_Luftfuktighet badrum_d79a0ffb UNSUBSCRIBE from openLuup/update/10190/HumiditySensor1/CurrentLevel tcp{client}: 0x55b600a23e28 2021-08-20 15:00:10.995 openLuup.io.server:: MQTT:1888 connection closed tcp{client}: 0x55b600bb33b8 2021-08-20 15:00:10.995 openLuup.mqtt:: RECEIVE ERROR: closed tcp{client}: 0x55b600bb33b8 2021-08-20 15:00:10.995 openLuup.mqtt:: mqttthing_Ljussensor hallen_19569c17 UNSUBSCRIBE from openLuup/update/20006/LightSensor1/CurrentLevel tcp{client}: 0x55b600bb33b8 2021-08-20 15:00:10.995 openLuup.io.server:: MQTT:1888 connection closed tcp{client}: 0x55b600a136b8 2021-08-20 15:00:10.995 openLuup.mqtt:: RECEIVE ERROR: closed tcp{client}: 0x55b600a136b8 2021-08-20 15:00:10.995 openLuup.mqtt:: mqttthing_Ljussensor trningsrum_ebf319c5 UNSUBSCRIBE from openLuup/update/20004/LightSensor1/CurrentLevel tcp{client}: 0x55b600a136b8 2021-08-20 15:00:10.995 openLuup.io.server:: MQTT:1888 connection closed tcp{client}: 0x55b600babaa8 2021-08-20 15:00:10.995 openLuup.mqtt:: RECEIVE ERROR: closed tcp{client}: 0x55b600babaa8 2021-08-20 15:00:10.995 openLuup.mqtt:: mqttthing_Solceller watt_e351a23b UNSUBSCRIBE from openLuup/update/10163/LightSensor1/CurrentLevel tcp{client}: 0x55b600babaa8 2021-08-20 15:00:10.995 openLuup.io.server:: MQTT:1888 connection closed tcp{client}: 0x55b6004a9de8 2021-08-20 15:00:10.995 openLuup.mqtt:: RECEIVE ERROR: closed tcp{client}: 0x55b6004a9de8 2021-08-20 15:00:10.995 openLuup.mqtt:: mqttthing_Luftfuktighet dusch_91df9a58 UNSUBSCRIBE from openLuup/update/20008/HumiditySensor1/CurrentLevel tcp{client}: 0x55b6004a9de8 2021-08-20 15:00:10.995 openLuup.io.server:: MQTT:1888 connection closed tcp{client}: 0x55b600b84628 2021-08-20 15:00:10.995 openLuup.mqtt:: RECEIVE ERROR: closed tcp{client}: 0x55b600b84628 2021-08-20 15:00:10.996 openLuup.mqtt:: mqttthing_Altandrr kk_db6d3edd UNSUBSCRIBE from openLuup/update/10097/SecuritySensor1/Tripped tcp{client}: 0x55b600b84628 2021-08-20 15:00:10.996 openLuup.io.server:: MQTT:1888 connection closed tcp{client}: 0x55b600be6548 2021-08-20 15:00:10.996 openLuup.mqtt:: RECEIVE ERROR: closed tcp{client}: 0x55b600be6548 2021-08-20 15:00:10.996 openLuup.mqtt:: mqttthing_Test datarum_adbe85e6 UNSUBSCRIBE from openLuup/update/20007/Dimming1/LoadLevelTarget tcp{client}: 0x55b600be6548 2021-08-20 15:00:10.996 openLuup.mqtt:: mqttthing_Test datarum_adbe85e6 UNSUBSCRIBE from openLuup/update/20007/SwitchPower1/Status tcp{client}: 0x55b600be6548And then in syslog:
Aug 20 15:00:11 username systemd[1]: openluup.service: Control process exited, code=exited status=7 Aug 20 15:00:11 username systemd[1]: openluup.service: Failed with result 'exit-code'. -
Wanted to check if was day or night and figured I would use:
local altitude = luup.variable_get(SID.SOLAR, 'ALT', ID.OPEN_LUUP)If altitude is positive it's day, else it's night. However when I read these variables they are incorrect for my locale. The actual values for sunset and midday are correct but do not occur at sunset or midday. I have checked the clock that openLuup uses and it's correct.
Now the time for midday is one hour out and the time for sunset is 13 hours out.
I checked this by getting the UNIX epoch for my location for both sunset and midday and then adding the hours of offset and then called:
local ID = { OPEN_LUUP = 2 } local SID = { OPEN_LUUP = "openLuup", SOLAR = "solar" } --local localTime = my_epoch_for_midday + (3600*1) local localTime = my_epoch_for_sunset + (3600*13) local coords = {Epoch = localTime, '', Latitude = '', Longitude = ''} luup.call_action(SID.SOLAR, "GetSolarCoords", coords, ID.OPEN_LUUP) local altitude = luup.variable_get(SID.SOLAR, 'ALT', ID.OPEN_LUUP) local azimuth = luup.variable_get(SID.SOLAR, 'AZ', ID.OPEN_LUUP) print('New altitude: '..altitude) print('New azimuth: '..azimuth)and I get the right answers.
Not sure what I'm doing wrong. Or perhaps there is some code mix up with UTC versus local time. I checked the documentation but no mention of the solar variables.
If I look at the chart it looks like the whole thing is correct but shifted by my timezone. However I wouldn't expect the timezone to come into play in these calculations.
Feature request: would like to see an openLuup variable that is true for day and false for night. eg IsDay
-
-
Creating a separate thread for anyone who is interested in using the basic (vera) smartphone UI with openLuup
B834C005-6193-4954-95B0-6D020EAEEFDD.jpeg
The actual L_sPhoneUI.lua file needed comes from the ‘ Smartphone Web Interface ’ that’s installed via the mios App Store.
Once you’ve got the file and have uploaded it to openLuup, add the following to your Lua Startup
dofile ("L_sPhoneUI.lua")FYI - all associated js, css and graphic files seem to be hosted at https://download1.mios.com/L_sPhoneUI_layout so not sure how long they will remain available there, but theoretically alternative hosting could be done..
-
Hi,
I’ve got the L_sPhoneUI.lua file, which is the very basic Vera smartphone UI, and it’s just a do - end code construct. How do I make that work under OpenLuup?
do .. then loads of code here.. endI’ve tried putting into the normal xml/json plugin space but it does seem to get picked up, as none of the handlers are registered?
-
Hi AK,
I can't find any info on how a variable watch actually ends.
I have the following variable watch on an alarm panel plugin UPnP variable. The code is part of some extended startup lua:
luup.variable_watch("waitForZoneToClose","urn:micasaverde-com:serviceId:EVL3VistaAlarmPanel1", "FaultedZoneNames", 7)In the same startup lua, the global function "waitForZoneToClose" is called when the "FaultedZoneNames" variable changes, but this same function is also called at the start of a routine that determines what zones are actually faulted on the alarm panel.
openZoneCount= waitForZoneToClose(7, "urn:micasaverde-com:serviceId:EVL3VistaAlarmPanel1", "FaultedZoneNames" , "","")So although the luup watch variables are included in the function params, they are not used within the function:
function waitForZoneToClose(dev_id, service, variable, old_val, new_val) openZoneCount = getOpenZones() --retrieves open zone names on panel, and zones to bypass per mode setting if openZoneCount > 0 then -- there are open zones buildReservedZonesTable() -- run routine to pop bypass and vent zones from the zonesToClose stack removeReservedZones() openZoneCount = tablelength(tZonesToClose) -- run the count again to see if any zone was popped off the stack during removeReservedZones end return openZoneCount endBecause I run the function recursively ie. when the variable that holds the open zones changes, I rerun the function that detects open zones, and if any relevant zones are still open, the code for the same watch is ran again, to detect if any zones have changed status, this before trying to auto arm the panel. So there might be a situation where two or more zones need to be closed before the panel will arm, and it takes real time to physically close each zone, one by one, and as each closes, the callback would trigger again.
Hope that makes sense.
I wasn't clear if a variable watch ends when the watched variable changes and the code then proceeds. Or do you have to end the watch via code somehow? I was concerned about a possible condition where watch upon watch would be added to memory until a luup reload would clear the watches, or do the watches end and self-cleanup when the callback function is called.
-
Hi,
I have an old raspberry pi and 7" touchscreen gathering dust, and have started to explore how I could potentially use the openLuup feature to ‘specify my own’ index.html?
The openLuup manual suggests it’s straightforward to set up, the challenge is going to be around how best to create a single html for just one of my plugins so i can use it in a kiosk type mode..
As you can probably tell, html and web development are alien to me 🙂 - but I assume I can do something basic, like create buttons that just call luup.call_action - e.g. here’s one from a plugin I created.
Luup
luup.call_action("urn:nodecentral-net:serviceId:Matrix1","SYCall",{ action ="I3" },1083)Html
<form action="https://google.com"> <input type="submit" value="Go to Google" /> </form>Not sure how that luup.call_action translate to a url, but I guess it’s something like this..
http://ip_address:3480/data_request?id=action&output_format=xml&DeviceNum=1083&serviceId=urn:nodecentral-net:serviceId:SYMatrix1&SYCall={action=I3}Has anyone done anything like this already, and has any examples of their own html content they can share ?
Is there maybe something out there that can translates any Vera static .json file into something presentable on a .html page. ? I had a quick look through @amg0 AltUi content on GitHub for inspiration but that is a way more comprehensive interface, compared to the single screen look I’m going for..
Any suggestion/advice (examples ideally) would be much appreciated..
-
I noticed this morning something that have seen in the past but forgotten about.
When I restart the OpenLuup server (in my case an Ubuntu PC) the Vera and Z-way bridges do not get in contact with the corresponding servers, i.e. are shown in red in AltUI. The solution for me is to make a "Relaod Luup engine" and then they are ok. I do not know if it is a general issue or only for my setup.
To be honest it is not much of a problem since OpenLuup is so stable. If and when you restart the server the hazzle of reloading is not that big. In fact I had forgotten about it since it was so long ago I had to restart anything...
The one use case I can think of is that the server gets restarted due to a power outage or something and if you are not at home the system does not fully recover without manual interaction. I my case I have the server on an UPS, but still a thought.
Is this a known issue and is it something that can be addressed somehow? As I said low priority, at least for me. 🙂
-
Have you ever considered running openLuup under LuaJIT instead of Lua5.1 interpreter?
The LuaJIT Project
For kicks, I switched my installation to the latest LuaJIT2.1 beta3 dating from 2017 and being a lua5.1 interpreter it is a drop in replacement. I had to move the lfs library from one folder to another likely because of an include path difference but I am seeing a further speed/efficiency improvement vs. lua5.1.
My CPU load has dropped another 25% to now hover around 2.2% down from 2.8%. I have yet to make sure that everything else works but so far everything appears to be the same.
The luajit site claims up to 5x speed increase through the interpreter and 120x improvement through the compiler vs the standard lua5.1.Screen Shot 2020-07-05 at 23.10.02.png
My initial interest was from being able to access some ffi libraries to handle video streams...
PS: Wow it is pretty impressive under load... browsing through ALTUI which used to cause spikes of CPU utilization from 2.8% to 4.8% now only go from 2.3% to 2.6%. It almost looks like noise. I am running it on a pretty fast x64 thread so it may not be that significant but this could make a big difference on ARM.
-
Here is a snippet of the log:
2021-08-22 16:57:28.106 openLuup.servlet:: file not found:etc/cmh-ludl/localcdn/jquery-ui.css 2021-08-22 16:57:28.107 openLuup.server:: request completed (150 bytes, 0 chunks, 1 ms) tcp{client}: 0x564e387b57a8 2021-08-22 16:57:28.114 openLuup.server:: GET /etc/cmh-ludl/localcdn/font-awesome.min.css HTTP/1.1 tcp{client}: 0x564e38b3af28 2021-08-22 16:57:28.116 openLuup.servlet:: file not found:etc/cmh-ludl/localcdn/font-awesome.min.css 2021-08-22 16:57:28.116 openLuup.server:: request completed (157 bytes, 0 chunks, 1 ms) tcp{client}: 0x564e38b3af28 2021-08-22 16:57:28.117 openLuup.io.server:: HTTP:3480 connection from 10.17.1.100 tcp{client}: 0x564e385a7098 2021-08-22 16:57:28.123 openLuup.server:: GET /etc/cmh-ludl/localcdn/bootstrap.min.css HTTP/1.1 tcp{client}: 0x564e385a7098 2021-08-22 16:57:28.123 openLuup.servlet:: file not found:etc/cmh-ludl/localcdn/bootstrap.min.css 2021-08-22 16:57:28.124 openLuup.server:: request completed (154 bytes, 0 chunks, 0 ms) tcp{client}: 0x564e385a7098 2021-08-22 16:57:28.124 openLuup.server:: GET /etc/cmh-ludl/localcdn/jquery.bootgrid.min.css HTTP/1.1 tcp{client}: 0x564e387b57a8 2021-08-22 16:57:28.125 openLuup.servlet:: file not found:etc/cmh-ludl/localcdn/jquery.bootgrid.min.css 2021-08-22 16:57:28.126 openLuup.server:: request completed (160 bytes, 0 chunks, 0 ms) tcp{client}: 0x564e387b57a8 2021-08-22 16:57:28.127 openLuup.io.server:: HTTP:3480 connection from 10.17.1.100 tcp{client}: 0x564e38ea35a8 2021-08-22 16:57:28.127 openLuup.io.server:: HTTP:3480 connection from 10.17.1.100 tcp{client}: 0x564e3882e378 2021-08-22 16:57:28.133 openLuup.server:: GET /etc/cmh-ludl/localcdn/joint.css HTTP/1.1 tcp{client}: 0x564e3882e378 2021-08-22 16:57:28.134 openLuup.servlet:: file not found:etc/cmh-ludl/localcdn/joint.css 2021-08-22 16:57:28.135 openLuup.server:: request completed (146 bytes, 0 chunks, 0 ms) tcp{client}: 0x564e3882e378 2021-08-22 16:57:28.136 openLuup.io.server:: HTTP:3480 connection from 10.17.1.100 tcp{client}: 0x564e36e44d08 2021-08-22 16:57:28.136 openLuup.server:: GET /etc/cmh-ludl/localcdn/spectrum.min.css HTTP/1.1 tcp{client}: 0x564e38ea35a8 2021-08-22 16:57:28.137 openLuup.servlet:: file not found:etc/cmh-ludl/localcdn/spectrum.min.css 2021-08-22 16:57:28.137 openLuup.server:: request completed (153 bytes, 0 chunks, 0 ms) tcp{client}: 0x564e38ea35a8 2021-08-22 16:57:28.141 openLuup.server:: GET /etc/cmh-ludl/localcdn/jquery.min.js HTTP/1.1 tcp{client}: 0x564e36e44d08And here is a screen shot showing the files exist:
Screenshot 2021-08-22 170642.png
Altui will not load. Using the current openLuup dev version 2021.08.16 which was updated today. There is a forward slash in front of etc for the get but not for the file not found error.
OpenLuup unavailable
-
The last three mornings OpenLuup for some reason has been unavailable. In other words it has not been responding when trying to connect via AltUI or Console.
I have been trying to investigate a bit around what this could be but not got it pinned down.
I run OpenLuup with one Zway bridge and two Vera bridges. The Zway and Veras have all been available every time, so that should not be the problem.
When the problems started I had updated OpenLuup with Mqtt and added a few Mqtt devices. At the same time I also updated AltUI to the latest version. At the same time I also removed some devices from Room 101.
The Mqtt devices are normally reporting data as they should.In Lua startup I have added the following entries related to Mqtt:
luup.attr_set ("openLuup.MQTT.Port", 1883) luup.attr_set ("openLuup.MQTT.Username", "luup") luup.attr_set ("openLuup.MQTT.Password", "openluup") luup.attr_set ("openLuup.MQTT.PublishDeviceStatus", "0") -- ================================== Mqtt functions below: local json = require "openLuup.json" function MyMQTThandler (topic, message) local info = json.decode (message) local t = info.AM2301.Temperature local h = info.AM2301.Humidity luup.variable_set ("urn:upnp-org:serviceId:TemperatureSensor1", "CurrentTemperature", t, 216) luup.variable_set ("urn:micasaverde-com:serviceId:HumiditySensor1", "CurrentLevel", h, 228) end luup.register_handler ("MyMQTThandler", "mqtt:tele/tasmota_test/SENSOR") function TasmotaCO2Axel (topic, message) local info = json.decode (message) local t = info.BME280.Temperature local h = info.BME280.Humidity local p = info.BME280.Pressure local c = info.MHZ19B.CarbonDioxide luup.variable_set ("urn:upnp-org:serviceId:TemperatureSensor1", "CurrentTemperature", t, 229) -- set temp to device luup.variable_set ("urn:micasaverde-com:serviceId:HumiditySensor1", "CurrentLevel", h, 230) -- set humidity to device luup.variable_set ("urn:micasaverde-com:serviceId:GenericSensor1", "CurrentLevel", p, 232) -- set air pressure to device luup.variable_set ("urn:micasaverde-com:serviceId:GenericSensor1", "CurrentLevel", c, 231) -- set CO2 to device end luup.register_handler ("TasmotaCO2Axel", "mqtt:tele/TasmotaCO2Ax/SENSOR") function TasmotaCO2Anton (topic, message) local info = json.decode (message) local t = info.BME280.Temperature local h = info.BME280.Humidity local p = info.BME280.Pressure local c = info.MHZ19B.CarbonDioxide luup.variable_set ("urn:upnp-org:serviceId:TemperatureSensor1", "CurrentTemperature", t, 233) -- set temp to device luup.variable_set ("urn:micasaverde-com:serviceId:HumiditySensor1", "CurrentLevel", h, 234) -- set humidity to device luup.variable_set ("urn:micasaverde-com:serviceId:GenericSensor1", "CurrentLevel", p, 235) -- set air pressure to device luup.variable_set ("urn:micasaverde-com:serviceId:GenericSensor1", "CurrentLevel", c, 236) -- set CO2 to device end luup.register_handler ("TasmotaCO2Anton", "mqtt:tele/TasmotaCO2An/SENSOR") -- =======================================================================
This morning it seems as if OpenLuup stopped working at 06:24, I kept MqttExporer up and running over night and it the data reporting had stopped at that time. (The image shows the last reported data and then it shows that it commences again after I restarted OpenLuup at 07:19.
Before restarting I grabbed all the log files, the last few entries in the log are:
2021-03-18 06:24:09.712 luup.variable_set:: 149.urn:upnp-org:serviceId:TemperatureSensor1.CurrentTemperature was: -10.6 now: -10.5 #hooks:0 2021-03-18 06:24:09.712 openLuup.server:: request completed (2 bytes, 1 chunks, 4 ms) tcp{client}: 0x55ca8d503438 2021-03-18 06:24:09.721 luup.variable_set:: 229.urn:upnp-org:serviceId:TemperatureSensor1.CurrentTemperature was: 20.4 now: 20.4 #hooks:0 2021-03-18 06:24:09.721 luup.variable_set:: 230.urn:micasaverde-com:serviceId:HumiditySensor1.CurrentLevel was: 46.7 now: 46.7 #hooks:0 2021-03-18 06:24:09.721 luup.variable_set:: 232.urn:micasaverde-com:serviceId:GenericSensor1.CurrentLevel was: 1016.5 now: 1016.5 #hooks:0 2021-03-18 06:24:09.721 luup.variable_set:: 231.urn:micasaverde-com:serviceId:GenericSensor1.CurrentLevel was: 2010 now: 2020 #hooks:0 2021-03-18 06:24:09.754 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55ca8cb5cf68 2021-03-18 06:24:09.754 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55ca8c855e68 2021-03-18 06:24:09.754 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55ca8d2daa08 2021-03-18 06:24:09.754 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55ca8c7c3218 2021-03-18 06:24:09.754 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55ca8ca87948 2021-03-18 06:24:09.754 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55ca8d312d98 2021-03-18 06:24:09.754 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55ca8c7e95f8 2021-03-18 06:24:09.754 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55ca8c74a218 2021-03-18 06:24:09.754 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55ca8bfefea8 2021-03-18 06:24:09.755 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55ca8c6ebce8 2021-03-18 06:24:09.756 openLuup.io.server:: MQTT:1883 connection closed tcp{client}: 0x55ca8c4dfe48 2021-03-18 06:24:09.756 openLuup.mqtt:: closed tcp{client}: 0x55ca8c4dfe48 2021-03-18 06:24:09.756 openLuup.mqtt:: TasmotaCO2Ax UNSUBSCRIBE from cmnd/TasmotaCO2Ax/# tcp{client}: 0x55ca8c4dfe48 2021-03-18 06:24:09.756 openLuup.mqtt:: TasmotaCO2Ax UNSUBSCRIBE from cmnd/tasmotas/# tcp{client}: 0x55ca8c4dfe48 2021-03-18 06:24:09.756 openLuup.mqtt:: TasmotaCO2Ax UNSUBSCRIBE from cmnd/TasmotaCO2Ax_fb/# tcp{client}: 0x55ca8c4dfe48 2021-03-18 06:24:09.756 openLuup.mqtt:: ERROR publishing application message for mqtt:cmnd/TasmotaCO2Ax/POWER : closed
The last rows are a bit strange to me, them seem to indicate that something goes wrong with the Mqtt for that device?
@akbooer I assume that it could be more of interest in the logs, I can of course email them if needed. Also let me know if any more information is missing.
-
Thanks for reporting that.
I see that you have two essentially identical handlers. This is not a problem, but I would choose to move that processing to a helper function, indexing the device number list with the received topic.
You say that you’ve seen this on several consecutive days. Does it always happen at the same time?
To interpret the log:
- the sending of a published message to TasmotaC02Ax has failed, because it found that the socket was closed.
- this might indicate an issue with that device, or a timeout.
- as a result, the server has cancelled the subscriptions from that device.
The server is designed to cope with this situation, and I’ve tested clients going up and down all the time, without a problem. Nonetheless, the only mechanism that I know of which can totally freeze a system is an incomplete socket transaction due to network issues. AFAIK, there haven’t been any recent changes to other socket handling code (HTTP server, and the like.)
-
@akbooer I grabbed the logs from yesterday also and it is not exactly the same time, it was 04:22 if I read the logs correctly.
I do not have the logs from the day before, but it was ok in the evening and frozen in the morning at approx 07:00 when I checked.As it seems it was two devices (TasmotaCO2Ax and TasmotaCO2An) that got an error.
2021-03-17 04:22:26.339 luup.variable_set:: 236.urn:micasaverde-com:serviceId:GenericSensor1.CurrentLevel was: 587 now: 593 #hooks:0 2021-03-17 04:22:26.340 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x5580d3e8cfd8 2021-03-17 04:22:26.340 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x5580d43678a8 2021-03-17 04:22:26.340 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x5580d3e375d8 2021-03-17 04:22:26.340 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x5580d3cf1848 2021-03-17 04:22:26.340 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x5580d3dc5a88 2021-03-17 04:22:26.340 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x5580d46e2698 2021-03-17 04:22:26.340 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x5580d40adfc8 2021-03-17 04:22:26.340 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x5580d45a96a8 2021-03-17 04:22:26.340 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x5580d3a55748 2021-03-17 04:22:26.340 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x5580d3192208 2021-03-17 04:22:26.340 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x5580d3f40118 2021-03-17 04:22:26.340 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x5580d3b455a8 2021-03-17 04:22:26.340 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x5580d3ea7548 2021-03-17 04:22:26.340 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x5580d47471d8 2021-03-17 04:22:26.341 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x5580d3b92588 2021-03-17 04:22:26.341 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x5580d37022a8 2021-03-17 04:22:26.341 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x5580d37bc3e8 2021-03-17 04:22:26.341 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x5580d43b3068 2021-03-17 04:22:26.341 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x5580d4d6c0f8 2021-03-17 04:22:26.341 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x5580d40f7b68 2021-03-17 04:22:26.341 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x5580d47249a8 2021-03-17 04:22:26.341 openLuup.io.server:: MQTT:1883 connection closed tcp{client}: 0x5580d3abfcb8 2021-03-17 04:22:26.341 openLuup.mqtt:: RECEIVE ERROR: closed tcp{client}: 0x5580d3abfcb8 2021-03-17 04:22:26.341 openLuup.io.server:: MQTT:1883 connection closed tcp{client}: 0x5580d4268eb8 2021-03-17 04:22:26.341 openLuup.mqtt:: RECEIVE ERROR: closed tcp{client}: 0x5580d4268eb8 2021-03-17 04:22:26.341 openLuup.io.server:: MQTT:1883 connection closed tcp{client}: 0x5580d47d0f18 2021-03-17 04:22:26.341 openLuup.mqtt:: RECEIVE ERROR: closed tcp{client}: 0x5580d47d0f18 2021-03-17 04:22:26.341 openLuup.server:: GET /data_request?id=lu_action&DeviceNum=175&id=variableset&serviceId=urn:micasaverde-com:serviceId:HumiditySensor1&Variable=CurrentLevel&Value=44.1 HTTP/1.1 tcp{client}: 0x5580d3ab86f8 2021-03-17 04:22:26.342 luup.variable_set:: 175.urn:micasaverde-com:serviceId:HumiditySensor1.CurrentLevel was: 44.1 now: 44.1 #hooks:0 2021-03-17 04:22:26.342 openLuup.server:: request completed (2 bytes, 1 chunks, 0 ms) tcp{client}: 0x5580d3ab86f8 2021-03-17 04:22:26.344 openLuup.io.server:: MQTT:1883 connection closed tcp{client}: 0x5580d3718798 2021-03-17 04:22:26.344 openLuup.mqtt:: closed tcp{client}: 0x5580d3718798 2021-03-17 04:22:26.344 openLuup.mqtt:: TasmotaCO2Ax UNSUBSCRIBE from cmnd/TasmotaCO2Ax/# tcp{client}: 0x5580d3718798 2021-03-17 04:22:26.344 openLuup.mqtt:: TasmotaCO2Ax UNSUBSCRIBE from cmnd/tasmotas/# tcp{client}: 0x5580d3718798 2021-03-17 04:22:26.344 openLuup.mqtt:: TasmotaCO2Ax UNSUBSCRIBE from cmnd/TasmotaCO2Ax_fb/# tcp{client}: 0x5580d3718798 2021-03-17 04:22:26.344 openLuup.mqtt:: ERROR publishing application message for mqtt:cmnd/TasmotaCO2Ax/POWER : closed 2021-03-17 04:22:26.344 openLuup.io.server:: MQTT:1883 connection closed tcp{client}: 0x5580d3faa808 2021-03-17 04:22:26.344 openLuup.mqtt:: closed tcp{client}: 0x5580d3faa808 2021-03-17 04:22:26.344 openLuup.mqtt:: TasmotaCO2An UNSUBSCRIBE from cmnd/TasmotaCO2An_fb/# tcp{client}: 0x5580d3faa808 2021-03-17 04:22:26.344 openLuup.mqtt:: TasmotaCO2An UNSUBSCRIBE from cmnd/TasmotaCO2An/# tcp{client}: 0x5580d3faa808 2021-03-17 04:22:26.344 openLuup.mqtt:: TasmotaCO2An UNSUBSCRIBE from cmnd/tasmotas/# tcp{client}: 0x5580d3faa808 2021-03-17 04:22:26.344 openLuup.mqtt:: ERROR publishing application message for mqtt:cmnd/TasmotaCO2An/POWER : closed
-
Ooh, that’s interesting. That’s an awful lot of HTTP sockets being closed. I assume you don’t actually have many active HTTP connections at night. I think your system might be running out of file descriptors (which are used by the socket library.). This gives me somewhere to look...
-
@akbooer I have some 10 external devices reporting temperature etc to some 35 devices in OpenLuup. The sockets in the log are for the updates of these devices.
Currently they are doing this via http, the intention is to move most of these to Mqtt, hopefully that will off load the http socket.When you say it, when I tested the Mqtt bridge from @therealdb I also had some problems with http endpoint crashes (see the posts around January 30:th in this thread).
So looking at the socket sounds like a good idea.I will do some more tests to try and get some more info also.
-
Also interesting!
You're able to play with the backlog queue length in the HTTP (and any other) server too. Default is 2000, I don't know why I chose that, it is perhaps too big. But you can use this startup configuration line to change that:
luup.atttr_set ("openLuup.HTTP.Backlog", 2000) -- queue length
see: http://w3.impa.br/~diego/software/luasocket/tcp.html#listen
Might be interesting to see if this makes any difference (eg. make it a lot smaller.)
Your help is much appreciated, since this is something that I can't reproduce at random on my own systems.
-
The latest development v21.3.18 has added a little log analysis tool to the log console pages. It shows the maximum gap between log entries and the time at which that ocurred. In normal operation this should be less than 120 seconds (since openLuup writes cpu and memory statistics at that rate.)
Should make it easier to spot any large breaks in the logs (obviously not if the entire system is frozen!)
-
@akbooer I installed it, will check it a few times tonight.
-
I had the same crash this night. This time it became unavailable at 03:51.
Last night I reinstalled the two Tasmota sensors I added before the crash so that they have the same Tasmota release as the older sensor that I had for the initial tests when it did not crash. This made no difference, so I can rule that one out.
When looking in the log file from before the crash it looks very similar:
021-03-19 03:51:48.344 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55b6338f7778 2021-03-19 03:51:48.344 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55b6348fa9a8 2021-03-19 03:51:48.344 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55b63427b0d8 2021-03-19 03:51:48.344 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55b634b6da68 2021-03-19 03:51:48.344 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55b632a24e88 2021-03-19 03:51:48.344 openLuup.io.server:: HTTP:3480 connection closed openLuup.server.receive closed tcp{client}: 0x55b63443ef78 2021-03-19 03:51:48.348 openLuup.io.server:: MQTT:1883 connection closed tcp{client}: 0x55b633f49218 2021-03-19 03:51:48.348 openLuup.mqtt:: closed tcp{client}: 0x55b633f49218 2021-03-19 03:51:48.348 openLuup.mqtt:: tasmota_test UNSUBSCRIBE from cmnd/tasmota_test_fb/# tcp{client}: 0x55b633f49218 2021-03-19 03:51:48.348 openLuup.mqtt:: tasmota_test UNSUBSCRIBE from cmnd/tasmota_test/# tcp{client}: 0x55b633f49218 2021-03-19 03:51:48.348 openLuup.mqtt:: tasmota_test UNSUBSCRIBE from cmnd/tasmotas/# tcp{client}: 0x55b633f49218 2021-03-19 03:51:48.348 openLuup.mqtt:: ERROR publishing application message for mqtt:cmnd/tasmota_test/POWER : closed
At 08:38 it crashed again, this is the first time it has crashed so soon again:
21-03-19 08:38:41.016 openLuup.server:: GET /data_request?id=lu_action&DeviceNum=192&id=variableset&serviceId=urn:micasaverde-com:serviceId:HumiditySensor1&Variable=CurrentLevel&Value=39.4 HTTP/1.1 tcp{client}: 0x55beb3bcdbd8 2021-03-19 08:38:41.016 openLuup.server:: GET /data_request?id=lu_action&DeviceNum=164&id=variableset&serviceId=urn:upnp-org:serviceId:TemperatureSensor1&Variable=CurrentTemperature&Value=-2.1 HTTP/1.1 tcp{client}: 0x55beb3da8618 2021-03-19 08:38:41.016 luup.variable_set:: 192.urn:micasaverde-com:serviceId:HumiditySensor1.CurrentLevel was: 38.6 now: 39.4 #hooks:0 2021-03-19 08:38:41.016 openLuup.server:: request completed (2 bytes, 1 chunks, 0 ms) tcp{client}: 0x55beb3bcdbd8 2021-03-19 08:38:41.016 luup.variable_set:: 164.urn:upnp-org:serviceId:TemperatureSensor1.CurrentTemperature was: -2.1 now: -2.1 #hooks:0 2021-03-19 08:38:41.017 openLuup.server:: request completed (2 bytes, 1 chunks, 0 ms) tcp{client}: 0x55beb3da8618 2021-03-19 08:38:41.022 openLuup.io.server:: MQTT:1883 connection closed tcp{client}: 0x55beb3c83ca8 2021-03-19 08:38:41.022 openLuup.mqtt:: closed tcp{client}: 0x55beb3c83ca8 2021-03-19 08:38:41.022 openLuup.mqtt:: TasmotaCO2An UNSUBSCRIBE from cmnd/TasmotaCO2An_fb/# tcp{client}: 0x55beb3c83ca8 2021-03-19 08:38:41.022 openLuup.mqtt:: TasmotaCO2An UNSUBSCRIBE from cmnd/tasmotas/# tcp{client}: 0x55beb3c83ca8 2021-03-19 08:38:41.022 openLuup.mqtt:: TasmotaCO2An UNSUBSCRIBE from cmnd/TasmotaCO2An/# tcp{client}: 0x55beb3c83ca8 2021-03-19 08:38:41.022 openLuup.mqtt:: ERROR publishing application message for mqtt:cmnd/TasmotaCO2An/POWER : closed
I have also checked the log analysis tool and could see one device that was often very slow. This is temp data from a Shelly Uni brought in with Sitesensor. I notised the Shelly being very slow also when accessing via the webpage.
I could see the following in the log file just before the the first crash:
# lines: 1214, maximum gap: 42.646s @ 2021-03-19 03:51:46.785 2021-03-19 03:51:04.137 luup.variable_set:: 206.urn:toggledbits-com:serviceId:SiteSensor1.LastRun was: 1616121064 now: 1616122264 #hooks:0 2021-03-19 03:51:04.137 luup.variable_set:: 206.urn:toggledbits-com:serviceId:SiteSensor1.LastQuery was: 1616121064 now: 1616122264 #hooks:0 2021-03-19 03:51:04.137 luup.variable_set:: 206.urn:toggledbits-com:serviceId:SiteSensor1.LastEval was: 1616121064 now: 1616122264 #hooks:0 2021-03-19 03:51:04.137 luup.variable_set:: 206.urn:toggledbits-com:serviceId:SiteSensor1.Message was: Last query OK now: Requesting JSON... #hooks:0 2021-03-19 03:51:04.137 luup_log:206: SiteSensor: Requesting JSON data 2021-03-19 03:51:04.137 luup.variable_set:: 206.urn:toggledbits-com:serviceId:SiteSensor1.LogCapture was: 03:31:04: SiteSensor: Requesting JSON data|03:31:04: SiteSensor: "GET" "http://192.168.1.31/status", headers={ }|0... now: 03:51:04: SiteSensor: Requesting JSON data #hooks:0 2021-03-19 03:51:04.138 luup_log:206: SiteSensor: "GET" "http://192.168.1.31/status", headers={ } 2021-03-19 03:51:04.138 luup.variable_set:: 206.urn:toggledbits-com:serviceId:SiteSensor1.LogCapture was: 03:51:04: SiteSensor: Requesting JSON data now: 03:51:04: SiteSensor: Requesting JSON data|03:51:04: SiteSensor: "GET" "http://192.168.1.31/status", headers={ } #hooks:0 2021-03-19 03:51:46.785 luup_log:206: SiteSensor: Response is 908 bytes in "/tmp/Q_SiteSensor_206.txt" 2021-03-19 03:51:46.785 luup.variable_set:: 206.urn:toggledbits-com:serviceId:SiteSensor1.LogCapture was: 03:51:04: SiteSensor: Requesting JSON data|03:51:04: SiteSensor: "GET" "http://192.168.1.31/status", headers={ } now: 03:51:04: SiteSensor: Requesting JSON data|03:51:04: SiteSensor: "GET" "http://192.168.1.31/status", headers={ }|0... #hooks:0 2021-03-19 03:51:46.786 luup.variable_set:: 206.urn:toggledbits-com:serviceId:SiteSensor1.Message was: Requesting JSON... now: Parsing response... #hooks:0 2021-03-19 03:51:46.787 luup.set_failure:: status = 0 2021-03-19 03:51:46.787 luup.variable_set:: 206.urn:micasaverde-com:serviceId:HaDevice1.CommFailure was: 0 now: 0 #hooks:0 2021-03-19 03:51:46.787 luup.variable_set:: 206.urn:micasaverde-com:serviceId:HaDevice1.CommFailureTime was: 0 now: 0 #hooks:0 2021-03-19 03:51:46.787 luup.variable_set:: 206.urn:toggledbits-com:serviceId:SiteSensor1.Message was: Parsing response... now: Retrieving last response... #hooks:0 2021-03-19 03:51:46.788 luup_log:206: SiteSensor: Eval #1: "response.ext_temperature[\"0\"].tC"=(number)24.44 2021-03-19 03:51:46.788 luup.variable_set:: 206.urn:toggledbits-com:serviceId:SiteSensor1.LogCapture was: 03:51:04: SiteSensor: Requesting JSON data|03:51:04: SiteSensor: "GET" "http://192.168.1.31/status", headers={ }|0... now: 03:51:04: SiteSensor: Requesting JSON data|03:51:04: SiteSensor: "GET" "http://192.168.1.31/status", headers={ }|0... #hooks:0
It was again very slow just before the second crash:
# lines: 1598, maximum gap: 46.871s @ 2021-03-19 08:38:34.554 2021-03-19 08:37:47.682 luup_log:206: SiteSensor: "GET" "http://192.168.1.31/status", headers={ } 2021-03-19 08:37:47.682 luup.variable_set:: 206.urn:toggledbits-com:serviceId:SiteSensor1.LogCapture was: 08:37:47: SiteSensor: Requesting JSON data now: 08:37:47: SiteSensor: Requesting JSON data|08:37:47: SiteSensor: "GET" "http://192.168.1.31/status", headers={ } #hooks:0 2021-03-19 08:38:34.554 luup_log:206: SiteSensor: Request returned no data, status 500 2021-03-19 08:38:34.554 luup.variable_set:: 206.urn:toggledbits-com:serviceId:SiteSensor1.LogCapture was: 08:37:47: SiteSensor: Requesting JSON data|08:37:47: SiteSensor: "GET" "http://192.168.1.31/status", headers={ } now: 08:37:47: SiteSensor: Requesting JSON data|08:37:47: SiteSensor: "GET" "http://192.168.1.31/status", headers={ }|0... #hooks:0 2021-03-19 08:38:34.554 luup.variable_set:: 206.urn:toggledbits-com:serviceId:SiteSensor1.Failed was: 0 now: 1 #hooks:0 2021-03-19 08:38:34.554 luup.variable_set:: 206.urn:toggledbits-com:serviceId:SiteSensor1.FailedSince was: now: 1616139514 #hooks:0 2021-03-19 08:38:34.554 luup.variable_set:: 206.urn:toggledbits-com:serviceId:SiteSensor1.LastFail was: 1616052193 now: 1616139514 #hooks:0 2021-03-19 08:38:34.555 luup.set_failure:: status = 1 2021-03-19 08:38:34.555 luup.variable_set:: 206.urn:micasaverde-com:serviceId:HaDevice1.CommFailure was: 0 now: 1 #hooks:0 2021-03-19 08:38:34.555 luup.variable_set:: 206.urn:micasaverde-com:serviceId:HaDevice1.CommFailureTime was: 0 now: 1616139514 #hooks:0 2021-03-19 08:38:34.555 luup.variable_set:: 206.urn:micasaverde-com:serviceId:SecuritySensor1.Tripped was: 0 now: 1 #hooks:0 2021-03-19 08:38:34.555 luup.variable_set:: 206.urn:micasaverde-com:serviceId:SecuritySensor1.LastTrip was: 1616052265 now: 1616139514 #hooks:0 2021-03-19 08:38:34.555 luup.variable_set:: 206.urn:micasaverde-com:serviceId:SecuritySensor1.ArmedTripped was: 0 now: 1 #hooks:0 2021-03-19 08:38:34.555 luup.variable_set:: 206.urn:toggledbits-com:serviceId:SiteSensor1.Message was: Requesting JSON... now: Retrieving last response... #hooks:0 2021-03-19 08:38:34.555 luup.variable_set:: 206.urn:toggledbits-com:serviceId:SiteSensor1.Message was: Retrieving last response... now: Last query failed, HTTP status 500 #hooks:0 2021-03-19 08:38:34.555 luup.set_failure:: status = 1 2021-03-19 08:38:34.555 luup.variable_set:: 206.urn:micasaverde-com:serviceId:HaDevice1.CommFailure was: 1 now: 1 #hooks:0
After the second crash I deactivated the Sitesensor fetching this data from the Shelly. At least I have not seen so long delays after that.
I have not yet changed the server backlog.
I will continue to do some testing, but I am not quite sure what I am chasing at the moment.
-
OK, well thanks again for all that. I will take a while to consider this. However, my first suggestion would anyway have been to disable SiteSenso, if at all possible, and see how it goes.
Once again, there is nothing amiss with a break in the log of up to 120s, and, indeed, in my latest edit (internal, as yet) I have disabled the gap warning message unless is exceeds 120 seconds.
-
@akbooer yes that was my thought also and see how it goes.
Btw I typically have delays of 2-4 seconds. At times a bit longer, those often being Sitesensors or Netmon pinging PCs that are offline.
That Shelly was the one device often being really slow. In fact it is often slow accessing via the browser also.The strange thing is that all the devices have been up and running on my system for a really long time, but maybe adding the Mqtt on top was the last small straw. Strange anyway.
-
You mention a slow Shelly. This should not be a problem, but, again, worth just taking it out of the loop sometime? Why is it 'slow'?
-
@akbooer I do not fully know. It is a Shelly Uni with two relays and one temp sensor.
I have read so-so reports on the Shelly Uni in fact.
It is situated close to the wifi access point, but I moved it a bit just now and it got better wifi quality numbers.
It is sitting in the midst of the electrical central, could be one reason perhaps.
The idea is to move it to Mqtt for the temp reporting and then it should work better. I turned off that Sitesensor for now to test if it helps anything. -
That's great, thanks. Just to let you know that I am taking this very seriously and I now have a fairly continuous stream of UDP updates going from my VeraLite to three different openLuup systems (Rpi, BeagleBone Black, Synology Docker) via the UDP -> MQTT bridge, with MQTT Explorer running on an iMac subscribed to one or other of those. From time to time the iMac sleeps, so the Explorer disconnects and then later reconnects. All openLuup instances are running the latest v21.3.19 looking for large gaps in the logs (or, indeed, a system freeze.)
So I am stress-testing this as far as I can without having your exact configuration.
-
Can you just remind me what machine architecture you’re running on?
-
@akbooer I'm running on an an old 2,27x4 GHz Fujitsu i3 Esprimo SFF PC with Ubuntu 18.04.5 and 4GB RAM and a 120 GB SSD.
My Z-way server is on a separate Raspberry Pi 3B+ with a Razberry board. Then one old UI5 Vera Lite and a UI7 Vera Plus, both almost completely offloaded, just a few virtual devices left on them.
-
This morning no crash. Not sure which of the changes I made that made the difference. Still good progress and something to continue working from.
This is what I did yesterday:
-
Updated to OpenLuup 21.3.19 from 21.3.18
-
Removed the line
luup.attr_set ("openLuup.MQTT.PublishDeviceStatus", "0")
from Lua Startup. I tested reloading without the line and it was not needed anymore as it seems -
Deactivated a few Sitesensors; the slow Shelly Uni, one fetching weather data and three more fetching some local data
-
Deleted two devices from Netmon that does not exist anymore, i.e. never respond to ping
-
Cut the power to my three test Mqtt devices, i.e. no active Mqtt devices reporting anything over Mqtt all night
-
-
Progress indeed. A slow build back should isolate the culprit.
For my part, I’ve spotted a difference in behaviour between my RPi and Docker instances when there’s a network outage, resulting in an error message "no route to host" on the RPi which blocks the system for longer than 2 minutes. Needs further investigation.
-
@akbooer yes exactly my plan. I started one of the Mqtt sensors this morning to see what happens. No other changes until tomorrow is the plan.
Interesting finding on the network outage!
-
The latest development version v21.3.20 has a new console page openLuup > System > Required which shows key system modules, and also those required by each plugin.
I am seeing some small version differences between my systems, but I don't think this is the issue. I would, nevertheless, be interested in your version of this page:
Incidentally, this system (running in a Docker on my Synology NAS) ran overnight with over 100,000 MQTT messages sent to MQTT Explorer, totalling over 18 Mb of data without any issues at all.