Navigation

    Discussion Forum to share and further the development of home control and automation, independent of platforms.

    SmartHome Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    (Last Updated: February 17, 2021)
    For those who registered but didn't received the confirmation email, please send an email to support@smarthome.community with the email you used
    • Odd console display for triggers

      rafale77

      Screen Shot 2021-02-23 at 07.14.43.png

      @akbooer , I just noticed these last 3 watches which have a serviceID appended behind them in the console. It is only the last 3 and I can't figure out why. Any idea?

      openLuup
    • websocket

      rafale77

      A brainfart or maybe wishful thinking here but besides MQTT, it would be a really nice addition for openLuup to provide a websocket server which would "lock" the messages tighter than MQTT and then give allow MSR to connect to it through this protocol rather than the vera style http API.
      This came to me as I was observing MSR connection to openLuup through polling adding 0.3-0.4% of CPU load while not doing much of anything to Home-assistant. Just putting it out there. z-way-server also provides a websocket server through an app which could be used instead of the current fixed interval polling of the z-way bridge. MQTT would provide the same benefit but likely require a lot more user intervention to setup the MQTT topics and messages though it would lose the distributed clients/servers aspect.

      openLuup
    • Security Sensor LastTrip behavior

      rafale77

      I am not sure if this is the behavior inherited from the vera but I was looking at the codes and got annoyed that the LastTrip variable updates even when the variable set is to "untrip" the sensor. A bit of a pet peeve but I ended changing this behavior in the openLuup code to only update the LastTrip when it is a trip action. This is particularly annoying because of timed lighting or other sensors which are sending API calls to openLuup on a regular interval defeating the purpose (at least the one I think it is meant to have) of the variable.

      I just moved this line

      set ("LastTrip", tostring(os.time()))

      down to the armedtripped part of the code in the luup.lua file.

      @akbooer was there a reason for that behavior?

      openLuup
    • openLuup: Version Log

      akbooer

      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 modification

      What 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.

      DE2056BF-E548-4611-972B-40276F00BFEB.jpeg

      openLuup
    • openLuup: MQTT server

      akbooer

      Feedback / issues with openLuup's built-in MQTT server

      openLuup
    • luaJIT

      rafale77

      @akbooer,

      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.

      Screen Shot 2020-07-05 at 23.11.47.png

      openLuup
    • Missing App store contents in openLuup

      A

      A little while back the contents of the App Store in openLuup show that there are no plugins in the store and the date is shown as"

      Alt App Store (as of 1970-01-01 10:00:00)

      In the log I see this:

      2021-02-07 11:34:06.509 openLuup.wsapi.cgi:: /console : loading app database... 2021-02-07 11:34:06.550 openLuup.client:: WGET error status: -1, request: https://raw.githubusercontent.com/akbooer/AltAppStore/data/J_AltAppStore.json 2021-02-07 11:34:06.550 openLuup.wsapi.cgi:: /console : JSON decode error @[5 of 107, line: 1] unexpected data after valid JSON string 'tlsv <<<HERE>>> 1 alert protocol vers' 2021-02-07 11:34:06.569 openLuup.server:: request completed (8645 bytes, 0 chunks, 61 ms) tcp{client}: 0x34e2f68

      In AltUI, the store shows OK but I don't see a call to GitHub so it may be getting its info from a cached value or an xml file?

      openLuup
    • Generic support for external plug-ins in different languages

      therealdb

      I was toying with the idea to write a simple openLuup plug-in to execute any external plug-in (ie written in nodejs, puthon or even bash or .NET) via an openLuup plug-in, with access to luup's variables and/or the ability to execute actions against an external executable.

      The general idea is to get an existing library (ie: the one controlling LG TV, or SwitchBot) that's written in another language and write a simple (and generic) bridge to represent a device, getting variables from a command line bash script (or nodejs app or whatever) and leverage someone else's work, instead of playing catch-up and try to port it over to LUA.

      I did it by myself in my own fork of the MQTT2Luup bridge I released and it's working very well for me. I was able to implement support for Alexa, busylights, lgtv, netgear routers, switchbot and much more, all using established or official node packages, with a simple library to send command to the node lib (simulating a console in) and getting response from them (reading the console out). So my logic is still in the luup/openLuup engine and I could mix and match (ie: getting my TV volume to know if I want to raise up/down the thermostat temperature based on occupancy, or treat switchbots as normal light switch - and control them via Alexa and so on).

      So, instead of doing it all by myself, I'm wondering it this could interesting as a generic openLuup capability, or as a general and "standardized" effort. I know it sounds like MultiSystem Reactor, but it's not, since the primary purpose is to be specific to openLuup devices and leave the logic to the user (this could be of course Reactor, the upcoming MSReactor or whatever you want). Am I the only one mixing things together and with such a need?

      openLuup
    • call_action SendConfig

      DesT

      @akbooer

      I'm a fan of the SendConfig call action in a couple of scene...

      Did you implement something like GetConfig ?

      I have a couple of scene that I would need to do a GetConfig to do something based on the value...

      openLuup
    • Historian

      S

      I'm working on a very slow migration from DataYours to Historian and am wondering if there is a list of cache devices that can be modified to include some that are missing, specifically several voltage variable monitors in service EnergyMetering1.

      Just checked again and a couple showed up. It could be that these populate slowly after a Vera reboot?

      I would also like to modify the storage-aggergation, it is possible to edit that .conf file directly and reboot openLuup?

      openLuup
    • Custom function reloading...

      DesT

      Hey guys...

      in my openLuup startup I have

      Tools = require "L_MyLuaCode"

      And this, will read the file L_MyLuaCode.lua

      Is there a way except to restart openLuup to re-read this file ?

      openLuup
    • New pi - clone existing image?

      P

      Hello - the new pi has arrived with uzb. As an installation shortcut is there a way of 'factory resetting' openluup if I cloned the working image on my other pi ... or is that a really bad idea?

      openLuup
    • FAN dimmer device

      DesT

      @akbooer

      Do you think it could be possible to have a custom device for "dimmer" that instead of having the slider from 0 to 99 will give us Off/Low/Medium/High and will send 0,30,60,90 ?

      openLuup
    • Cloning scenes in openLuup and AltUI

      A

      I was trying to change the ID of a couple of scenes and came to the conclusion you can't do this without stopping openLuup, hacking user_data.json and restarting openLuup, which is a pain. (May be this could be added to openLuup ie be able change any scene ID to a non used one.)

      So I figured I would try and clone some of the scenes with the idea that I could then manually swap their contents around. Why would I want to do this? Just to make my scene management a bit more simple as all my scenes call the one pile of Lua code. I also wanted to make use of unused scene IDs sprinkled through the scene ID list.

      My understanding was the clone would occupy the first unused scene ID. Using AltUI, it just adds the clone on to the end of the list of scene IDs. In openLuup using the console page it failed to create the clone. Hits the URL OK:

      http://openLuup:3480/console?action=clone&scene=14

      Says this in the log:

      GET /console?action=clone&scene=14 HTTP/1.1 tcp{client}: 0x2c05008

      Searched high and low and no clones to be found.

      I see that AltUI does a create when it clones:

      openLuup.server:: GET /data_request?id=scene&action=create&json=WITH_ALL_THE_SCENE_INFO_HERE

      Any ideas?

      openLuup
    • AltUI/Reactor issue?

      PerH

      I woke up to one of the lights in the hallway dimming up and down constantly.. when i tried to open reactor logic summary, there was something weird with the GUI?
      The "Tools" tab resizes so i can't reach the logic summary button:
      24f6b3f7-cfca-45ba-b568-7c6f5a31ddd7-image.png

      The Reactor instance in Altui pages was also empty, no buttons or text on them, only the icon..

      I have a virtual switch to turn on all lights using reactor, and that one worked from the tablet in the kitchen, so reactor was functioning OK..

      I reloaded luup and hard refreshed the browser, and all but the "Tools" page is now back to normal.. @toggledbits ?

      EDIT: Theres supposed to be some text in the headers on this page, isn't it?
      70159d9d-85fc-4606-b38b-49f2909dce72-image.png

      openLuup
    • openLuup: Windows Subsystem for Linux (WSL)

      akbooer

      Windows Subsystem for Linux (WSL) is a compatibility layer for running Linux binary executables natively on Windows 10.

      This is one way to run openLuup under Windows without having to worry whether any of your plugins require a Unix/Linux environment – this way, they actually get one.

      Many flavours of Linux are available for WSL from the Microsoft Store – my favourite, to date, is Alpine WSL, which is a tiny (~8 Mb) and lightweight WSL distro based on musl, uses busybox, and just contains the most important things to be functional.

      Here's a rough guide to getting openLuup going under Alpine WSL

      Enable WSL on via the Windows control panel Install the Alpine WSL app from the Microsoft Store Start the Alpine application Install Lua and some libraries:

      Alpine comes with a really full set of Lua libraries available for install. You need to be su to install them:

      # apk add curl # apk add lua5.1 # apk add lua5.1-md5 # apk add lua5.1-cjson # apk add lua5.1-filesystem # apk add lua5.1-bitop # apk add lua5.1-sec You need to make the file system permanent: $ cd /mnt/c/ $ mkdir cmh-ludl $ cd cmh-ludl Now get and install openLuup and AltUI: $ wget https://github.com/akbooer/openLuup/raw/master/Utilities/openLuup_install.lua $ lua5.1 openLuup_install.lua

      When finished (it won't yet return to the command prompt)

      access openLuup via the URL: IP:3480/openLuup Update to latest version (Plugins page, type development in Update box) Install VeraBridge (Device Table > Create D_VeraBridge.xml / I_VeraBridge.xml) Add IP of Vera to VeraBridge attributes Reload VeraBridge device > Actions > GetVeraFiles (wait ~2 minutes) Reload

      Simple!

      openLuup
    • Logging lines

      C

      Evening, all. Hope you're all well.

      Did the logging line count / rotation challenge ever get sorted? I'm needing to look back at some historical events and my oldest log is barely 3 hours ago. (Not that I can recall how to try and change the line numbers etc)

      Cheers!

      C

      openLuup
    • Breakdown?

      PerH

      I've been fiddling with the zigate plugin, as the dongle arrived.. I installed the app from appstore, and saw that the plugin files were not installed properly.
      Downloaded the zip files and put all luup files in the cmh_ludl folder. Reloaded luup, and it was in and looking ok
      I then entered the IP for it to communicate with the dongle, and reloaded luup.

      Now the openluup service is running, but i can't get into either altUI or openluup console.

      I tried rebooting, stopping and starting the service, no effect.

      the logs doesnt seem to be updated either. Now what?

      openLuup
    • Playing sounds on the Zooz Siren ZSE19

      C

      I'm trying to do this now that I have migrated the siren to Zway. Here's the thread from the Vera forums on how to do it with a Vera: https://community.getvera.com/t/playing-sounds-on-the-zooz-siren-zse19/211318

      I'm guessing something needs to change in the code since previously it was calling out the vera specifically.

      Here's what shows up in the logs when I tried to use Reactor for the SendData. Zway plugin is device 18. And my siren is device number 95 in my Zway network.

      2020-12-01 15:37:27.052 openLuup.server:: POST /data_request HTTP/1.1 tcp{client}: 0x56194138c448 2020-12-01 15:37:27.052 luup.call_action:: 18.urn:micasaverde-com:serviceId:ZWaveNetwork1.SendData 2020-12-01 15:37:27.053 openLuup.server:: request completed (151 bytes, 1 chunks, 0 ms) tcp{client}: 0x56194138c448 2020-12-01 15:37:27.079 luup_log:18: ZWay: http://127.0.0.1:8083/ZWaveAPI/Run/SendData(95,x79 8 35) 2020-12-01 15:37:27.079 luup_log:18: ZWay: SyntaxError: Unexpected number 2020-12-01 15:37:27.184 openLuup.server:: request completed (8606 bytes, 1 chunks, 5939 ms) tcp{client}: 0x561941d02fe8
      openLuup
    • Imperihome - missing devices

      PerH

      While i wait for a replacement app for my local UI devices, i want to use imperihome as long as I can.. But i'm missing a lot of devices!

      All Z-Way bridge devices, all security/smoke and motion sensors (local RFXtrx child devices)..

      Found the "include vera bridge" in imperihome.lua, what else could cause this?

      openLuup

    openLuup: MQTT server

    openLuup
    4
    22
    143
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • akbooer
      akbooer last edited by

      Feedback / issues with openLuup's built-in MQTT server

      1 Reply Last reply Reply Quote 0
      • rafale77
        rafale77 last edited by

        I just tested the broker and... the cpu utilization went from 1.5% to 90%... only getting home assistant connected to it without even subscribing a topic...

        1 Reply Last reply Reply Quote 0
        • akbooer
          akbooer last edited by akbooer

          @rafale77

          Interesting. I've tried it on three different systems and not seen this. Anything available from the log?

          I should say, though, that the only MQTT clients I have been able to test with so far are the Shellies themselves.

          1 Reply Last reply Reply Quote 0
          • rafale77
            rafale77 last edited by

            The odd thing is that it seems to work fine. I am manually testing by sending messages from a mosquitto client command line tool. I reverted back to the mosquitto broker which uses <0.1% CPU. Could it be because I am using luajit?

            1 Reply Last reply Reply Quote 0
            • akbooer
              akbooer last edited by

              I’m using LuaJIT in development, so that’s one of the systems I am testing under. That typically runs at 0.2% CPU, as does the system on my Synology NAS, although I seem to be having a few issues there with IP address mapping. Are you running this under a VM?

              rafale77 1 Reply Last reply Reply Quote 0
              • rafale77
                rafale77 @akbooer last edited by

                @akbooer

                Yes I am running in inside a VM. I am not having any IP address mapping issues though... puzzling.

                See my openLuup cpu load. I am also checking it with "top" and the openLuup process goes nuts hovering between 87% and 92% when I uncomment the server launch code from the lua startup. Commenting it brings the CPU load back to normal.

                Screen Shot 2021-02-12 at 07.18.27.png

                1 Reply Last reply Reply Quote 0
                • PerH
                  PerH last edited by PerH

                  I updated to dev branch and added luup.attr_set ("openLuup.MQTT.Port", 1883) to LUA startup on my docker project machine now.
                  Stays at about .2 CPU here.. I'll try to get some data in later.

                  1 Reply Last reply Reply Quote 1
                  • PerH
                    PerH last edited by

                    Any plans on a GUI for MQTT server control? i would love a status window with topics and activity. 🙂

                    rafale77 akbooer 2 Replies Last reply Reply Quote 1
                    • rafale77
                      rafale77 @PerH last edited by rafale77

                      @perh

                      For inspiration, this is Home Assistant:

                      Screen Shot 2021-02-12 at 07.41.05.png

                      Edit: This is really weird, I am not seeing the cpu load problem anymore. Just retried it... and it seems to work just fine. The CPU load is a little higher but by a few decimals. Not sure what happened previously.

                      1 Reply Last reply Reply Quote 0
                      • therealdb
                        therealdb last edited by

                        I'll test it over the week-end, since snow is expected. I'll just relay all the traffic from my broker. I'll report back soon.

                        1 Reply Last reply Reply Quote 0
                        • akbooer
                          akbooer @PerH last edited by

                          @perh said in openLuup: MQTT server:

                          Any plans on a GUI for MQTT server control? i would love a status window with topics and activity.

                          Er, yes. It's already there in the openLuup console Server pages. I added a new one for MQTT, from which I notice that the same client IP is subscribed twice. I've not yet implemented UNSUBSCRIBE !! (but will do so now.)

                          Screenshot_2021-02-12 openLuup.png

                          Screenshot_2021-02-12 openLuup(1).png

                          1 Reply Last reply Reply Quote 0
                          • PerH
                            PerH last edited by PerH

                            Ok, think i found an issue?

                            All I did in openluup was to start MQTT in the lua_startup.

                            Then tried to connect something, and suddenly it started running wild with alot of these messages (and CPU at 95%):

                            2021-02-12 17:50:51.847   luup.incoming_callback:: function: 0x55694ad24e40 ERROR: table: 0x55694b5b18a0
                            2021-02-12 17:50:51.847   openLuup.context_switch::  ERROR: [dev #0] table: 0x55694b2257c0
                            2021-02-12 17:50:51.847   luup.incoming_callback:: function: 0x55694ac43980 ERROR: table: 0x55694b2257c0
                            2021-02-12 17:50:51.847   openLuup.context_switch::  ERROR: [dev #0] table: 0x55694b225ea0
                            2021-02-12 17:50:51.847   luup.incoming_callback:: function: 0x55694ad24e40 ERROR: table: 0x55694b225ea0
                            2021-02-12 17:50:51.848   openLuup.context_switch::  ERROR: [dev #0] table: 0x55694b13bae0
                            2021-02-12 17:50:51.848   luup.incoming_callback:: function: 0x55694ac43980 ERROR: table: 0x55694b13bae0
                            2021-02-12 17:50:51.848   openLuup.context_switch::  ERROR: [dev #0] table: 0x55694b13c200
                            2021-02-12 17:50:51.848   luup.incoming_callback:: function: 0x55694ad24e40 ERROR: table: 0x55694b13c200
                            2021-02-12 17:50:51.848   openLuup.context_switch::  ERROR: [dev #0] table: 0x55694b139d60
                            2021-02-12 17:50:51.848   luup.incoming_callback:: function: 0x55694ac43980 ERROR: table: 0x55694b139d60
                            2021-02-12 17:50:51.848   openLuup.context_switch::  ERROR: [dev #0] table: 0x55694b13a440
                            2021-02-12 17:50:51.848   luup.incoming_callback:: function: 0x55694ad24e40 ERROR: table: 0x55694b13a440
                            2021-02-12 17:50:51.848   openLuup.context_switch::  ERROR: [dev #0] table: 0x55694b9519a0
                            2021-02-12 17:50:51.848   luup.incoming_callback:: function: 0x55694ac43980 ERROR: table: 0x55694b9519a0
                            2021-02-12 17:50:51.848   openLuup.context_switch::  ERROR: [dev #0] table: 0x55694b952080
                            2021-02-12 17:50:51.848   luup.incoming_callback:: function: 0x55694ad24e40 ERROR: table: 0x55694b952080
                            

                            When I stopped the sender (stopped the container it was running in), the errors kept coming until I reloaded luup.

                            The sender was this, which is a program that parses data from Tibber Pulse into JSON. Tibber Pulse sends instant power data from my house power input.
                            It has two tobpics, do i have to establish these in the broker first?

                            1 Reply Last reply Reply Quote 0
                            • rafale77
                              rafale77 last edited by

                              Already a feature request: could the broker force users to use credentials like mosquitto does?

                              akbooer 1 Reply Last reply Reply Quote 0
                              • akbooer
                                akbooer @rafale77 last edited by

                                @rafale77 said in openLuup: MQTT server:

                                could the broker force users to use credentials like mosquitto does?

                                Absolutely not a problem. How would you like to be able to specify the credentials.

                                On your other problem... I’m working on it.

                                1 Reply Last reply Reply Quote 0
                                • rafale77
                                  rafale77 last edited by rafale77

                                  Credentials: Could be attributes of openLuup? somehow encoded?

                                  1 Reply Last reply Reply Quote 0
                                  • PerH
                                    PerH last edited by PerH

                                    Question: does the broker have to have the topics ready, or will it create them when some unit connects with topics?

                                    1 Reply Last reply Reply Quote 0
                                    • rafale77
                                      rafale77 last edited by

                                      I believe topics are created by subscribers/publishers. They are a "header" to the "message".

                                      1 Reply Last reply Reply Quote 0
                                      • akbooer
                                        akbooer last edited by akbooer

                                        The server/broker needs no configuration aside from the port number (except, soon, for defining login credentials.)

                                        The joy of MQTT is that you don’t need to know who is listening, where they are (IP address), who is sending, or what they’re sending. It’s just that if you’re subscribed to a topic, and someone publishes an application message with that topic, then you receive it.

                                        1 Reply Last reply Reply Quote 0
                                        • akbooer
                                          akbooer last edited by

                                          @rafale77

                                          The latest development release of openLuup, v21.2.16 should have fixed the error condition that you were seeing. I was using the socket.try() function incorrectly in an attempt to catch errors in a better way!

                                          I’ve also fixed the multiple subscriber issue that I was seeing. Still some more to do, including login credentials, but would appreciate any feedback at this stage.

                                          The Shelly bridge also seems to be working well with it... very responsive.

                                          rafale77 1 Reply Last reply Reply Quote 2
                                          • rafale77
                                            rafale77 last edited by

                                            Sounds good, Will get on it in the next few hours. I just finished refactoring a bunch of my scene lua code moving a couple of global state variables into virtual switch devices. I am trying to not convolute too many changes.

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Powered by NodeBB | Contributors
                                            Hosted freely by PointPub Media Communications Inc. | Contact us