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
    • Unsolved
    (Last Updated: February 23, 2021)
    • Openluup control of Alexa

      CatmanV2

      Very happy getting Alexa to control Openluup devices. I'm wondering if there's any way to get Openluup to control Alexa only devices (such as wifi enabled light bulbs?

      TIA

      C

      openLuup
    • openLuup: MQTT server

      akbooer

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

      openLuup
    • openLuup won't upgrade from 2020.05.22

      R

      Hello,
      Having issues updating to latest version. Is there documentation on it anywhere?

      openLuup
    • Restoring OpenLuup

      A

      I thought I would test and migrate my OpenLuup installation from my current old i3 Ubuntu server to a new Raspberry Pi 4.

      I have set up the new Pi with a fresh install of openLuup and it works as it should.

      As I have understood it I should install all the plugins I have on my old installation and then restore a backup file from my old installation onto the new server. Is this correct or should I do some more steps before migrating? When I see that everything is working the plan is to swap the IP, but initially the new server will have another IP.

      When I tried to test the resore procedure on the new server from a backup file of the new server I got an error and the restore script hangs.
      After reboot OpenLuup is back.

      What I did was type:
      ./openLuup_reload backup/backup.openLuup-88800000-2021-04-12.lzap
      in the Terminal from inside cmh-ludl ( I found this procedure in an old thread).

      When doing this I get the following error message:
      rm: can not remove '/www/altui/altui*': The file of catalogue does not exist (free-hand translated from Swedish)

      @akbooer am I missing something here?

      openLuup
    • OpenLuup unavailable

      A

      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.
      20210318MqttExplorer.png

      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.

      openLuup
    • My newbie questions

      Crille

      Creating my own topic for newbie questions about openLuup and AltUi 🙂

      Trying to create a scene with a timer to turn on device 1 at given time IF device 2 is Off.
      Wrote Lua to return false if device 2 is On.
      Log states "scene prevented from running by local scene Lua" but action is performed anyway, device 1 is turned On.
      Suggestions?

      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
    • AltUI and Console gui

      A

      I found some really minor gui issues in AltUI and in the Console.

      Once more it is not that much of a problem for me as I use them only for admin purposes. I thought I'd post them anyway so that they are known for future releases, depending on priorities of course. 🙂

      The first is related to the rounding of humidity devices in AltUI. It seems as if these numbers are always rounded down:

      AltUI:
      cae85b7d-8f20-440a-9ca2-8d568b63f00c-bild.png

      Console:
      8100685e-9389-4f5f-b1e7-96a25fbabe84-bild.png

      The second issue is that the value for generic sensors seems not to be visible in the Console:

      AltUI:
      7909f921-2a09-4687-9550-331640e32244-bild.png

      Console:
      d090457b-5357-4bbd-9073-8f1e830c893f-bild.png

      Variables:
      6a9ec1a0-37e7-479e-94f0-4321f7aeac93-bild.png

      openLuup
    • New to openLuup, issues with scenes

      Crille

      I got tired on waiting for a stable release of Vera FW so finally took the leap to installing openLuup.

      Unfortunately I haven't even got a simple scene to work.
      Trigger - If device 1 is turned on
      Action - Delay 2 seconds and turn device 2 on.

      I see the call to turn device 1 on in log but nothing else related after that.
      What am I doing wrong?

      openLuup
    • Luup reload required after server reboot

      A

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

      openLuup
    • Wrong dimmer value in gui

      A

      I installed a new dimmer a few days ago, a Sunrichter "knob smart dimmer" (SR-ZV2835RACS).

      It included without problems into Z-way and shows up in AluUI and in the Console as usual.
      However the dimmer value in AltUI/Console does not change when you adjust it manually on the dimmer. I have checked the variables and it seems as if AltUI displays LoadLevelTarget and when checking on the dimmer variables the LoadLevelTarget value is not updated in OpenLuup when the dim level is changed on the dimmer. In other words LoadLevelStatus and LoadLevelTarget differs and LoadLevelStatus shows the correct dim level set manually on the dimmer.
      If you change the dim level in OpenLuup then both values are updated.
      On/off state is however always updated.

      In Z-way the dim level is updated as it should, so it works there as it should from what I can see.

      Running OpenLuup 20.12.19 and AltUI 2.53b.2552.

      @akbooer any idea if this is something that can be fixed?

      openLuup
    • Vera Decoupled from the cloud services

      therealdb

      so, @rigpapa did it: https://github.com/toggledbits/Vera-Decouple

      It's completely decoupling Vera from the cloud. Very cool stuff. /cc @rafale77 @akbooer

      openLuup
    • openLuup Icons

      rafale77

      This is a set of openLuup icons to replace the ones which you normally would transfer over from the vera. The only thing for the dimmable lights is that one needs to use a new json file to replace the original light bulb with an vector graphics type which I am also sharing.

      icons.zip
      D_DimmableLight1.json.zip

      This is a sample of the icons on ALTUI:

      Screen Shot 2021-03-01 at 16.06.18.png

      openLuup
    • Custom device for dimmer

      DesT

      @akbooer

      What's the effort/work to have a custom device "view" ?

      Remember when I talked about a dimmer with low/med/high/off instead of the slider from 0 to 100 ...

      What I would need to do to have that ?

      Right now, I have a fan in the living room that use the fireplace heat to send it on the 2nd floor!

      For the moment, I put it manually at 30%, 60% and 100% to handle the low/med/high, but will be more useful on the interface to have only 3 buttons...

      openLuup
    • 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
    • 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
    For those who registered but didn't received the confirmation email, please send an email to support@smarthome.community with the email you used

    Security Sensor LastTrip behavior

    openLuup
    4
    23
    88
    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.
    • rafale77
      rafale77 last edited by 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?

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

        IIRC, this is what Vera does. There's nothing wrong at all with recording a trip when the sensor isn't armed. That's why there is an ArmedTripped variable which is only set when armed.

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

          That's not quite what I meant. The current behavior is that it is recording a LastTrip time stamp variable for an untrip event.
          What I did by moving the call down is to have it update the time stamp variable only when it is an tripped = 1 event regardless of it being armed or disarmed. I was just puzzled as to why why it would record the untrip event. I just took advantage of the conditional already in the code for the armed tripped part of the code.

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

            Ah, I see. Well, I know (I think I know) that I researched this behaviour thoroughly when doing the initial implementation, but still having a Vera, I may be able to check that. It' s just that I don't have any motion sensors attached to it currently. Perhas someone else can help us to check it out?

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

              ...or, of course, this may be a 'feature' of the ZWay bridge, only.

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

                I would not be surprised if this was one of these "not so smart" features of the vera and in my case it is not even relevant to the z-way bridge but it can be:

                Examples:

                1. Say I want to use a motion sensor to turn on the light and wait for a certain interval of time without any tripping before turning it off. I used this LastTrip time stamp to measure that time... bummer. The time will be off by quite a bit since it gets updated by the untrip event.
                2. I have Home Assistant and a tomographic presence detection system sending updates to an openLuup motion sensor. I set one to send updates every 2 seconds (because its event based logic seems to not quite work) no matter what the status is. This LastTrip variable gets updated every 2s... making it not very useful.
                1 Reply Last reply Reply Quote 0
                • akbooer
                  akbooer last edited by

                  Does the trip time get treated similarly?

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

                    Not sure what you mean. "LastTrip" I think is the only time stamp related to trip time?

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

                      Yup.. don’t know what I was thinking.

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

                        Oh, wait, yes I do. Does the time toggle on trip AND untrip?

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

                          I have a generic handler on status to log lasttrip on tripped/untripped. Maybe this could be an openluup extension on a custom service id, leaving the actual behavior intact.

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

                            @akbooer said in Security Sensor LastTrip behavior:

                            Oh, wait, yes I do. Does the time toggle on trip AND untrip?

                            Not completely sure to understand the question.
                            The LastTrip variable does get updated to os.time with both trip and untrip. The code calls for an update every time a set variable call is made to the tripped variable of the security sensorID and that's the problem. It would be easy enough to create a new variable through a plugin or in the set variable function if the original behavior actually serves a purpose. For now I am trying to see if it does on my setup. It is however a misnomer for the variable since it really doesn't record the last time the sensor was tripped. It records the last time the sensor state got updated...

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

                              So I can see now why one would want the "LastTrip" variable to record the untrip event... for door sensors where potentially someone could run a scene off of this timing. It doesn't make sense for a motion sensor since it isn't really an event per say for that type of sensor, it is a self reset of the sensor. I have now modified the code to only record the time if the "Tripped" value has changed unlike what it is doing now. Ideally I would have preferred a different behavior according to the type of security sensor.

                              PS: made a pull request with a proposal. For the motion sensors.

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

                                I have tested this for quite few days now and it all makes a lot more sense at least for the logic I used. I am even wondering why one wouldn't create another timestamp variable "LastUntrip" rather than using LastTrip for both trip and untrip. It appears indeed that having it tag both types of event was the behavior on the vera and I think i will keep my version for the motion sensors since it makes all my motion sensed lighting behave with the delay expected.

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

                                  So you’re suggesting that we retain the original behaviour, but you don’t approve of that in the case of motion sensors? What shall we do with your pull request?

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

                                    Since openLuup is luup on steroids, I'm officially suggesting differentiating its behavior, while retaining the luup original one for compatibility. So, something like LastTrip/Untrip in a different service definition should work better than altering it and causing troubles to other plug-ins assuming a different behavior.

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

                                      I have an alternate suggestion. Preserve the Vera Luup behavior, and create new state variables for the alternate behavior, perhaps TripTime and UntripTime? Maybe come up with a prefix to denote openLuup-specific states, and apply this throughout?

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

                                        The reason for my post was to try to get opinions and insights for the source and usage of this behavior.
                                        I like the @toggledbits ' suggestion. Though the initial behavior doesn't appear to be well thought through, I think it is water under the bridge and it would be a bit too risky to deviate from it. I was going to change my PR to add functionality rather than modifying existing ones. I am thinking of adding LastTripTime and LastUntripTime?

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

                                          Well, that's what I was suggesting anyway, so my vote is for it, definitely 🙂

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

                                            @rafale77 said in Security Sensor LastTrip behavior:

                                            Though the initial behavior doesn't appear to be well thought through

                                            You say that almost as if it wasn't the norm...

                                            ...and that would have gotten me banned over there... 🙂

                                            Edit: to embellish with a more useful comment... regardless of how stupid the behavior, I guarantee you, from personal experience, that someone relies on it.

                                            1 Reply Last reply Reply Quote 2
                                            • First post
                                              Last post

                                            Welcome. If you’d like to participate in the discussion, rather than just read, then you can join the forum. As a member, you can interact with others here to share your experience and ask the questions you need answered.

                                            Powered by NodeBB | Contributors
                                            Hosted freely by PointPub Media Communications Inc. | Contact us