Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Unsolved
Collapse
Discussion Forum to share and further the development of home control and automation, independent of platforms.
B

Buxton

@Buxton
Possible feature request?
CatmanV2C
No idea how easy this would be. During my migration away from Z-wave I've been replacing the Z-wave devices with Sonoff which has broken some of my automations. Any chance of a 'Test Reaction' function to call out which ones are broken because an entity no longer exists? Without actually running the reaction? Or does this exist already and I'm just not aware of how to do it? Obviously I can see entities that are no longer available, but not quite what I'm looking for. I guess it's something of an edge case so no huge issue. TIA! C
Multi-System Reactor
Copying a global reaction
tunnusT
With build 25328, if you copy a global reaction, a new reaction does not appear in the UI unless you do a refresh. I recall this used to work without needing this page refresh? Anyway, only a minor nuisance.
Multi-System Reactor
Logic Assistance: Exterior Lights on when Illuminance Below Threshold
PablaP
Topic thumbnail image
Multi-System Reactor
Time series documentation
tunnusT
Is the current manual (incl. examples) up to date with how retention value is handled in time series configuration? Referring to this post
Multi-System Reactor
Genuinely impressed with Zigbee and HA / Reactor
CatmanV2C
Just for the record, in case anyone is following, I'm really rather impressed. I have installed one of these: https://www.amazon.co.uk/dp/B0B6P22YJC?ref=ppx_yo2ov_dt_b_fed_asin_title&th=1 That's connected (physically) to the VM running on my Synology, with a 2m USB extension. The same host also runs Openluup, Mosquito, HA Bridge. Yesterday I installed Zigbee2mqtt. That was a bit of a PITA but mostly because of ports and permissions. Once up and running, and the correct boxes ticked, immediately visible in Home Assistant via the MQTT integration, and thence into Reactor I've only got two devices. I bought the cheapest sensor I could find, which is a door sensor. Dead easy to add to ZIgbee2mqtt and again, immediately visible in HA. https://www.amazon.co.uk/dp/B0FPQLWRW1?ref=ppx_yo2ov_dt_b_fed_asin_title The dongle is on the top floor of the house, and I wanted the sensor on the back door (just about as far apart as it's possible to get short of going into the garage) When I moved the sensor downstairs it dropped out pretty instantly (which wasn't a huge surprise) so quick bit of research found out that smart plugs will act as routers so... https://www.amazon.co.uk/dp/B0FDQDPGBB?ref=ppx_yo2ov_dt_b_fed_asin_title Took me about 30 seconds to connect. Updated the name. Instantly visible in Reactor with the new name pushed over from Zigbee2mqtt. And lo, the door sensor now has a signal of 140 and works as far as I can tell perfectly and instantly (unlike my z-wave one). A few more of those will be purchased and used to replace the Tuya wifi cloud devices and the (continually failing) Z-wave plugs (yeah, they were TKB so....) Commended to the house. Thanks for everyone that got me on the right lines. C
Zigbee
Tuya Wifi to Tasmota flashing
CatmanV2C
Just popping this in here in case it's helpful to anyone else later. I've got several Tuya Wifi sockets that I'm getting rid of / replacing. Looking at which ones, if any, can be flashed to Tasmota: https://www.amazon.co.uk/dp/B09Y212TCK?ref=ppx_yo2ov_dt_b_fed_asin_title&th=1 Are NOT flashable C
Zigbee
MQTT templates for ZIgbee scene controller, or a better way?
CatmanV2C
Topic thumbnail image
Multi-System Reactor
Reset a delay
CatmanV2C
I'm sure this has been asked, and answered, but damned if I can figure it out Use case: I have a rear garden with lights. A door from the kitchen into the garden and a door from the garage. Currently if I open the kitchen door the lights come on (yay) and a 3 minute delay starts. After 3 minutes, no matter what else happens, the lights go off (Boo! But also yay!) What I would like is for the 3 minute delay until the lights go off to start from the latest door open event. That is, if I'm going from kitchen to garage, and back again, the lights stay on until there's three minutes of no activity. I've tried 'hacking' with a virtual switch, but can't seem to stop the delay. Any pointers? TIA C
Multi-System Reactor
Zigbee2mqtt installed! sytemctl not happy :(
CatmanV2C
Hello oh great ones. After a couple of hours messing with ports and permissions I have Zigbee2mqtt installed and running on my virtual pi Can connect to the front end and everything Odd one though, simply cannot get systemctl to work and the error is, well, unhelpful. The service file is this: [Unit] Description=zigbee2mqtt After=network.target [Service] Environment=NODE_ENV=production Type=notify ExecStart=/usr/local/bin/node index.js WorkingDirectory=/opt/zigbee2mqtt StandardOutput=inherit # Or use StandardOutput=null if you don't want Zigbee2MQTT messages filling syslog, for more options see systemd.exec(5) StandardError=inherit WatchdogSec=10s Restart=always RestartSec=10s User=pi [Install] WantedBy=multi-user.target Straight out of the docs with the change to point to my local node install (which we know works as it's the same as the very fine Reactor is using. Running manually pnpm start in /opt/zigbee2mqtt works fine However: catman@openluup:/etc/systemd/system$ sudo systemctl start zigbee2mqtt.service Job for zigbee2mqtt.service failed because the control process exited with error code. See "systemctl status zigbee2mqtt.service" and "journalctl -xe" for details. Which I have catman@openluup:/etc/systemd/system$ sudo systemctl status zigbee2mqtt.service ● zigbee2mqtt.service - zigbee2mqtt Loaded: loaded (/etc/systemd/system/zigbee2mqtt.service; disabled; vendor preset: enabled) Active: activating (auto-restart) (Result: exit-code) since Tue 2025-12-16 12:32:42 GMT; 4s ago Process: 3093 ExecStart=/usr/local/bin/node index.js (code=exited, status=217/USER) Main PID: 3093 (code=exited, status=217/USER) and -- A start job for unit zigbee2mqtt.service has begun execution. -- -- The job identifier is 17477. Dec 16 12:35:16 openluup systemd[3178]: zigbee2mqtt.service: Failed to determine user credentials: No such process Dec 16 12:35:16 openluup systemd[3178]: zigbee2mqtt.service: Failed at step USER spawning /usr/local/bin/node: No such process -- Subject: Process /usr/local/bin/node could not be executed -- Defined-By: systemd -- Support: https://www.debian.org/support -- -- The process /usr/local/bin/node could not be executed and failed. -- -- The error number returned by this process is ERRNO. Dec 16 12:35:16 openluup systemd[1]: zigbee2mqtt.service: Main process exited, code=exited, status=217/USER -- Subject: Unit process exited -- Defined-By: systemd -- Support: https://www.debian.org/support -- -- An ExecStart= process belonging to unit zigbee2mqtt.service has exited. -- -- The process' exit code is 'exited' and its exit status is 217. Dec 16 12:35:16 openluup systemd[1]: zigbee2mqtt.service: Failed with result 'exit-code'. -- Subject: Unit failed -- Defined-By: systemd -- Support: https://www.debian.org/support -- -- The unit zigbee2mqtt.service has entered the 'failed' state with result 'exit-code'. Dec 16 12:35:16 openluup systemd[1]: Failed to start zigbee2mqtt. -- Subject: A start job for unit zigbee2mqtt.service has failed -- Defined-By: systemd -- Support: https://www.debian.org/support -- -- A start job for unit zigbee2mqtt.service has finished with a failure. Which strikes me as very odd. Any blindingly obvious things I'm missing? TIA! C
Zigbee
Any thoughts on which is better
CatmanV2C
Obviously a quiet forum, but perhaps it's time I'm looking at rolling Zigbee into my system, in large part for the Aqara FP300 presence sensors which seem to finally provide a solution to if the wasp is actually in the box. My current set up is as follows: One Debian VM on Synology NAS running: Z-wave Server Open Luup Multi system reactor HA bridge Mosquito MQQT broker This machine has a UZB Z-wave stick connected via the USB port on the NAS Another HAOS VM on the same NAS running HAOS I've got some older Z-wave stuff that I keep around until it fails. I have some Tuya stuff integrated in HA My thought was to get either a SMLIGHT SLZB-06M or an Aqara Hub M2 Integrate them via Zigbee2MQQT (running on the Debian machine) and then expose them in HA so I can continue to automate in MSR. Thoughts on which of those devices wold be preferable long term. Both are POE capable which is good. It also appears I could add a USB dongle to the NAS and expose it to the HAOS machine. Any thoughts from the assembled experts here? TIA C
Zigbee
Single protocol?
CatmanV2C
Another question to the hive mind. Prompted by the fact that I lost yet another z-wave device over the weekend due to a power issue. It looks like z-way server is reporting another device failed (although it's working fine) and message queue is far too long IMHO. Also the failed device has been removed in the expert interface, but still there in the 'normal' one. Sigh. Currently I have z-wave, Tuya, thinking about Zigbee.... Does anyone use one single protocol for everything? Right now I'm feeling that as the z-wave stuff dies, I'm just gonna replace it with something else.... C
General Discussion
HDMI oddness
CatmanV2C
Not really Smart Home stuff, but going to ask as we have smart people... Bear with me on this one. Asking here because of the font of knowledge! For many eek years I have had a Virgin V6 box and a Raspberry Pi running Kodi connected to my TV through a cheap *** HDMI switch. It all worked beautifully but the absolutely critical thing was that the TV remote passed the signals back to the Pi to allow remote control of Kodi. Couple of changes of late: Installed a soundbar on the TV using the ARC (audio return channel). That then turns the soundbar on and off when the TV turns on and off and the TV volume control controls the soundbar volume direct. Everything continues to work Upgraded the software of the Tivo box to Virgin 360. This is literally software only. You get sent a snacky new Bluetooth remote hit 'upgrade' on the screen and off it goes. Now, things are not playing well. Typically when I turn on to watch Kodi the soundbar comes on (as it should) but the TV either puts out sound through its own speakers and the soundbar, or just the soundbar. It's not possible to control the volume of the soundbar through the TV. Also it's not longer possible to control Kodi using the TV remote. If I turn the TV360 box off, i.e. power it down, before turning on to watch Kodi, everything is fine. This makes little to no sense to me. My assumption is that the cheap *** HDMI switch is getting something from the TV360 connection that it didn't used to get when the software was Tivo and that's screwing up the HDMI communications. I'm upgrading the switch to something a little less chap, but wondered if anyone could validate my theory at all? TIA C
General Discussion
Reactor Loading Screen Safari
S
Topic thumbnail image
Multi-System Reactor
Constraints states visually do not match actual
S
Topic thumbnail image
Multi-System Reactor
Oh the joy of pairing
CatmanV2C
When I remember the old days Just added a new Tuya plug (OK so it's cloud) Start to finish, visible in HA and MSR < 30 seconds... C
Vera
Home Assistant Connect ZWA-2 & ZBT-2
therealdbT
Topic thumbnail image
Hardware
[MSR] Feature request: For Each action on arrays/groups
therealdbT
Topic thumbnail image
Multi-System Reactor
[Solved] Error: Command timeout
G
at _ClientAPI._commandTimeout (http://192.168.1.100:8111/client/ClientAPI.js:807:179 Seeing this randomly when returning to open browser tab after being away awhile. Once, maybe twice a day. "What did you do to trigger it?" Literally nothing, just walked away and returned and there it was. Actions taken in reasonably close proximity to this particular instance of it popping up: I'd restarted the MSR container in Portainer. I'll try to grab some logs here shortly.
Multi-System Reactor
Issue with MSR UI becoming unresponsive
S
I'm having an issue with MSR's UI being very unresponsive. It started happening a couple days ago and I didn't make any changes that would have caused this except adding some meross lan devices in HA. When I go into an entity action and use the search functionality, it usually will start filtering and then get to a place after a few letters are entered where it will take 30 seconds or more (sometimes minutes) for the UI to show what I am typing. During this time MSR ui is completely unresponsive. I've tried multiple browsers and multiple computers. HA and MSR are both deployed in docker. I have run HTOP on the host and when the problem happens there are no CPU/Memory spikes at all. From a functionality standpoint MSR is working perfectly. This seems to be an UI issue only. Do i need to ditch Docker and run MSR on a Proxmox VM? I have both stand alone Docker and Proxmox environments. I dont mind doing that I just want to be able to use the UI again... Installation method Home Assistant Container Core 2025.7.3 Frontend 20250702.3 nothing crazy in the logs except some openweather map stuff that doesn't make any sense as it is working fine in MSR Any help would be greatly appreciated Reactor latest-25328-b2ed1365 app 25328 configuration from /var/reactor/config NODE_PATH /opt/reactor:/opt/reactor/node_modules [latest-25328]2025-11-30T20:01:53.843Z <app:null> Reactor build latest-25328-b2ed1365 starting on v24.11.1 /usr/local/bin/node [latest-25328]2025-11-30T20:01:53.844Z <app:null> Process ID 1 user/group 0/0; docker; platform linux/x64 #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025; locale (undefined) [latest-25328]2025-11-30T20:01:53.844Z <app:null> Basedir /opt/reactor; data in /var/reactor/storage [latest-25328]2025-11-30T20:01:53.844Z <app:null> NODE_PATH=/opt/reactor:/opt/reactor/node_modules [latest-25328]2025-11-30T20:01:53.865Z <app:null> Resolved timezone=America/New_York, environment TZ=America/New_York; offset minutes from UTC=-300 [latest-25328]2025-11-30T20:01:53.867Z <default:null> Module i18n v25141 [latest-25328]2025-11-30T20:01:53.867Z <app:null> Configured locale (undefined); selected locale(s) en-US.UTF-8 [latest-25328]2025-11-30T20:01:53.879Z <app:null> Loaded locale en-US for en-US [latest-25328]2025-11-30T20:01:53.879Z <app:null> Local date/time using configured timezone and locale formatting is "11/30/2025, 3:01:53 PM" [latest-25328]2025-11-30T20:01:53.889Z <Structure:null> Module Structure v25326 [latest-25328]2025-11-30T20:01:53.890Z <Capabilities:null> Module Capabilities v24312 [latest-25328]2025-11-30T20:01:53.904Z <Plugin:null> Module Plugin v25141 [latest-25328]2025-11-30T20:01:53.923Z <Timer:null> Module Timer v25279 [latest-25328]2025-11-30T20:01:53.924Z <TimerBroker:null> Module TimerBroker v25314 [latest-25328]2025-11-30T20:01:53.927Z <Entity:null> Module Entity v25251 [latest-25328]2025-11-30T20:01:53.929Z <Controller:null> Module Controller v25253 [latest-25328]2025-11-30T20:01:53.930Z <AlertManager:null> Module AlertManager v25318 [latest-25328]2025-11-30T20:01:53.937Z <default:null> Module Ruleset v25283 [latest-25328]2025-11-30T20:01:53.937Z <default:null> Module Rulesets v25141 [latest-25328]2025-11-30T20:01:53.942Z <GlobalExpression:null> Module GlobalExpression v25258 [latest-25328]2025-11-30T20:01:53.953Z <Predicate:null> Module Predicate v25328 [latest-25328]2025-11-30T20:01:53.956Z <Rule:null> Module Rule v25323 [latest-25328]2025-11-30T20:01:53.958Z <GlobalReaction:null> Module GlobalReaction v25292 [latest-25328]2025-11-30T20:01:53.959Z <Engine:null> Module Engine v25325 [latest-25328]2025-11-30T20:01:53.964Z <httpapi:null> Module httpapi v25328 [latest-25328]2025-11-30T20:01:53.972Z <wsapi:null> Module wsapi v25328 [latest-25328]2025-11-30T20:01:53.994Z <TaskQueue:null> Module TaskQueue 24138 [latest-25328]2025-11-30T20:01:53.994Z <VeraController:null> Module VeraController v25141 [latest-25328]2025-11-30T20:01:54.179Z <HassController:null> Module HassController v25325 [latest-25328]2025-11-30T20:02:13.797Z <OWMWeatherController:null> Module OWMWeatherController v25268 [latest-25328]2025-11-30T20:02:13.800Z <SystemController:null> Module SystemController v25323 [latest-25328]2025-11-30T20:02:13.807Z <MQTTController:null> Module MQTTController v22092 [latest-25328]2025-11-30T20:02:20.630Z <OWMWeatherController:CRIT> FetchError: request to https://api.openweathermap.org/data/2.5/weather?lat=xxxxxxxxxx&lon=-xxxxxxxxx&appid=xxxxxxxxxxxxxxxxxxxxxxxxxx&units=standard&_r=1xxxxxxxxxxxxxxfailed, reason: [-] FetchError: request to https://api.openweathermap.org/data/2.5/weather?lat=xxxxxxxxxxx&lon=-xxxxxxxxxxxxxxxxxx&appid=xxxxxxxxxxxxxxxxxxx&units=standard&_r=xxxxxxxxxxxxxxxfailed, reason: at ClientRequest.<anonymous> (/opt/reactor/node_modules/node-fetch/lib/index.js:1501:11) at ClientRequest.emit (node:events:508:28) at ClientRequest.emit (node:domain:489:12) at emitErrorEvent (node:_http_client:108:11) at TLSSocket.socketErrorListener (node:_http_client:575:5) at TLSSocket.emit (node:events:508:28) at TLSSocket.emit (node:domain:489:12) at emitErrorNT (node:internal/streams/destroy:170:8) at emitErrorCloseNT (node:internal/streams/destroy:129:3) at processTicksAndRejections (node:internal/process/task_queues:89:21
Multi-System Reactor
Date/time condition
tunnusT
Topic thumbnail image
Multi-System Reactor
About
Posts
136
Topics
10
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Reactor scope issues
    B Buxton

    @toggledbits @akbooer Sorry, I will try to be clearer.
    " I don't know what "assigning the luup log function to a table" means"

    In many of Patrick's plugins, he uses a global lua table to hold plugin data and functions. He assigns shorthand names that call common luup functions, then stores those truncated names in the table. Then the first class functions are called from the table. I believe it is this abstraction that is contributing to log entries that show nil values, as direct calls of "luup.log" do not show nil values. The technique should work in openluup, and most often it does, but sometimes it doesn't.

    Here's an example from the log where it does not work:

    2022-01-15 14:13:12.551   luup.variable_set:: 258.urn:micasaverde-com:serviceId:HaDevice1.CommFailure was: 0 now: 0 #hooks:0
    2022-01-15 14:13:12.551   luup.variable_set:: 258.urn:micasaverde-com:serviceId:HaDevice1.CommFailureTime was: 0 now: 0 #hooks:0
    2022-01-15 14:13:12.551   luup_log:149: Reactor: Starting nil (#nil)
    2022-01-15 14:13:12.551   luup.variable_set:: 149.urn:toggledbits-com:serviceId:Reactor.Message was: Starting Unused1 now: Starting Basic Functions #hooks:0
    2022-01-15 14:13:12.552   luup.variable_set:: 265.urn:toggledbits-com:serviceId:ReactorSensor.Invert was: nil now:  #hooks:0
    2022-01-15 14:13:12.552   luup.variable_set:: 265.urn:toggledbits-com:serviceId:ReactorSensor.Invert was:  now: nil #hooks:0
    

    In the log entry "luup_log:149: Reactor: Starting nil (#nil)" the text of the log entry is there "Reactor: Starting", but the variable following the text is nil. This is what I meant by "picking up on variables". The log entries are being displayed, but anything that is a variable is showing as nil. The variables themselves are not actually nil because I can see from program execution that they are doing the job that they're supposed to be doing. It is only in the log entries that they show as nil, at least insofar as what is visible to me.

    As for using nil to delete a variable, that seems to be understood and is separate from the log problem.

    I believe that this is a scope problem, thus the title of the post. But I don't believe this is a reactor scope problem in that the same issue does not occur on the Vera itself. So for whatever reason, in openLuup, the scope of the variable being displayed in the log is different from the scope of the log function--that the value of the variable is somehow hidden from the function.

    This is a problem as it relates to the readability of the log, an annoyance more than anything, so I have no expectations to have it fixed. In my original screenshots, you can see multiple log entries that display as nil, so that's why I brought this to your attention as I felt that if there are scope issues at work with the logging function, then it could be happening elsewhere as well.

    The only other thing that I would add is that in my startup lua, I call a module in the _G space so that I can access functions in the lua section of Reactor activities. My call is _G.myStartUpLua = require("myStartUpLua") I don't believe that this should have an effect on the log, but perhaps it does.

    Plugins

  • Reactor scope issues
    B Buxton

    @therealdb Yes, that's where I'm headed too. Agreed that Hass is very stable. It's just that there are real structural changes being made all the time, and before I sink my time into learning the details of the software, I want to be sure that pretty much everything is final in the engine.

    Plugins

  • Reactor scope issues
    B Buxton

    @toggledbits Yes, I think that's a large part of the problem as I'm seeing the same behavior with deleted groups in various sensors. The sensor groups flop between nil and empty in the attempt of trying to delete the variable.

    There seems to be a separate issue of the openLuup log not picking up on variables for your various plugins log entries.

    I'm guessing this has to do with assigning the luup log function to a table and then calling a truncated name ie L(...) when writing to the log. So there is some scope issue going on that is different on openLuup from that of a Vera, brought about by a level of abstraction.

    Plugins

  • Reactor scope issues
    B Buxton

    @therealdb Well that's a shame. One more nail in the coffin. I'll probably move to HA as soon as the various versions of the software are consolidated. It's a great platform, but for my needs, it is still too subject to breaking structural changes.

    Plugins

  • Reactor scope issues
    B Buxton

    @toggledbits OK. Does that mean that the log entries as shown above are expected ie. that the flopping (from nil to empty and back again) for reactor expression variables is routine?

    Plugins

  • Reactor scope issues
    B Buxton

    @akbooer Yes, I tried browser refresh without any change. If you look at the log, you see the variables flopping from nil to empty and then back again to nil.

    @therealdb are you seeing anything like this in your openLuup reactor installation? I'm only seeing this nil behavior with Reactor expression variables.

    Plugins

  • Reactor scope issues
    B Buxton

    Hi Patrick/AK Booer

    I am able to see Reactor expressions in the AltUI UI per the below and the expressions work as they should in my reactor sensors. When an expression changes, the reactor sensor responds accordingly.

    javascript.png

    However, I cannot see the expressions in luup state variables or the luup logs:

    Luup.png

    Log.png

    I tried reinstalling openLuup (latest development) and when that failed to change the noted behavior, I reinstalled lua5.1. There was also no change. Rebooting the machine also produced no change.
    I suspect this is an openLuup issue as I also see nil values for some plugins:

    plugin.png

    And other plugins are fine:

    2022-01-12 20:47:12.027   luup.variable_set:: 63.urn:upnp-micasaverde-com:serviceId:Weather1.CurrentDewPoint was: 32 now: 29.7 #hooks:0
    2022-01-12 20:47:12.028   luup.variable_set:: 63.urn:upnp-micasaverde-com:serviceId:Weather1.WindSpeed was: 1.76 now: 2.8 #hooks:0
    2022-01-12 20:47:12.028   luup.variable_set:: 63.urn:micasaverde-com:serviceId:HumiditySensor1.CurrentLevel was: 30 now: 27 #hooks:0
    2022-01-12 20:47:12.028   luup.variable_set:: 65.urn:micasaverde-com:serviceId:HumiditySensor1.CurrentLevel was: 30 now: 27 #hooks:0
    2022-01-12 20:47:12.028   luup.variable_set:: 63.urn:upnp-micasaverde-com:serviceId:Weather1.LastUpdate was: 1642047430 now: 1642049231 #hooks:0
    
    

    Any ideas on how to troubleshoot this.....

    Plugins

  • luup.variable_watch
    B Buxton

    @akbooer Ok, that's clear enough. Thanks

    openLuup

  • luup.variable_watch
    B Buxton

    @buxton Yeah, running lua within the Reactor plugin/MSR is an incredibly powerful feature that, combined with expressions, pretty much allows you to do whatever you want to do. A wonderful piece of software.

    Now I need to figure out how to construct the closure that will surround the watch callback function. Tricky, because there are so many variables that go into deciding when the routine should branch, and when branching should be avoided.

    openLuup

  • luup.variable_watch
    B Buxton

    @akbooer OK thanks, that's what I needed to know.

    One final question if you could. How does scope affect a watch called from start-up lua? I'm asking because I imagine the scope for a watch is plugin specific, and therefore is confined to the plugin.

    The watch will be created in the initialization code of a global module, that is in turn referenced in start-up lua ie. "_G.myStartUpLua = require("myStartUpLua") "

    This module contains functions that are called from Reactor activities similar to this:
    Reactor Activity.png

    Will the global watch callback function be visible to the watch if both are created within "myStartUpLua".

    openLuup

  • luup.variable_watch
    B Buxton

    @akbooer Yes, I understand the callback and how it is triggered. The question is once a watch is established (in this case during startup lua), can it be removed. If so, how is that done. Secondly, what happens when you re-run the code that places a watch on a specific variable. Do the watches stack up in memory, or is the previous watch simply replaced by the new call. Or perhaps the new watch is ignored. I don't know as I can't find any documentation on how this works.

    I only want the callback triggered under specific conditions ie. there are certain conditions where the watched variable should not trigger the callback routine-- such as when zones are opening and closing when there is no intention to arm the security panel. If I can't remove a watch and then re-add it later, I'm guessing that I have to account for those conditions within callback function. Is that correct?

    openLuup

  • luup.variable_watch
    B Buxton

    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
    end
    

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

    openLuup

  • A couple of suggestions for MSR
    B Buxton

    Allowing the MQTT service to be created as a container, or couple the MQTT service directly with the MSR container would be great. With the exception of openLuup, I don't install anything on my HA server that is not containerized. The reason being that dependencies get corrupted, or changed by another app, or services conflict, etc..... Containers eliminate all that chaos and allow me to take down any software that's not working, all the while not destabilizing the underlying server.

    Also, I use MSR primarily for Vera/openLuup and Home Assistant. It appears that the connection to HA is a websocket, allowing HA to async updates to MSR, whereas the connection to Vera is REST based relying on polling. Due to underlying issues with the Lua socket library, I try to keep polling to an absolute minimum so I have MSR turned off at the moment. What would be really cool is a plugin that would reside on openLuup or a Vera that would catch any and all changed states, and then push those state changes to MSR, perhaps with a synchronous acknowledgement. This complicates MSR of course, as you would need to install two separate pieces of software, however, I think the benefits of a push model, outweigh the downside of maintaining two separate apps. On the other hand, Vera is not long for this world, so perhaps the effort is not worth it.

    Multi-System Reactor

  • TTS in MSR?
    B Buxton

    @fanan Per this topic https://smarthome.community/topic/744/sending-a-service-request-to-home-assistant?_=1638829172919 I couldn't get Alexa tts to work in MSR, but I do have it working in openLuup with the following code that sits inside a simple plugin:

    myEchoDevice = "alexa_media_".. myEchoDevice
    myEchoMessage = table.concat(myEchoMessage)
    	
    local request_body = json.encode {message = myEchoMessage, data = {["type"] = "announce",method = "all"}}
    
    local response_body = {}
    	
    local theURL = 'http://'..HomeAssistantIP..':'..HomeAssistantPort..'/api/services/notify/'..myEchoDevice  
    	
    r, c, h = http.request {
       url = theURL,
       method = "POST",
       headers = {
       ["Content-Type"]   = "application/json",
       ["Authorization"] = "Bearer ".. HomeAssistantToken,
       ["Content-Length"] = request_body:len()
       },
    source = ltn12.source.string(request_body),
    sink   = ltn12.sink.table(response_body)
    }
    

    The variable "myEchoDevice" is the exact name of the specific echo device (or device group) as presented in the Amazon Alexa app. I typically broadcast to all my devices via a group, intercom style, so I catch the message wherever I am in my home. The variable "HomeAssistantToken" needs to be created in HA. "myEchoMessage "is a lua table in the above code, but you could just as easily capture the message as a string, and then trim the string prior to sending it to the HTTP post request.

    Multi-System Reactor

  • Import Vera Rules in Docker Containers?
    B Buxton

    @3rdstng Ha! if you're in the US, I'll take it. I still have a veralite running in my garage that could do with an upgrade.

    Multi-System Reactor

  • Power outage and all the Vera devices were moved to room MiOS-xxxxx. How to fix?
    B Buxton

    @a-lurker Yeah, HA takes a couple of minutes to fully start, so 30 seconds is the bare minimum I could get away with on my system. Not to mention the host server's atom processor, while parsimonious on power use, is a dog when ten containers are starting up from boot. Luckily, power outages here are infrequent. When prices are right, I'll get a home battery/solar setup to eliminate that rare nuisance.

    Place in "/etc/cmh-ludl"

    openLuup_run.sh

    #!/bin/bash
    echo "Starting openLuup server"
    echo "To see tail of logfile: tail -f ./out.log"
    cd /etc/cmh-ludl
    sudo rm /etc/cmh-ludl/logs/out.log
    nohup ./openLuup_reload >> /etc/cmh-ludl/logs/out.log 2>&1 &
    

    openLuup_stop.sh

    #!/bin/bash
    echo "Stopping openLuup server"
    echo "To see tail of logfile: tail -f ./out.log"
    cd /etc/cmh-ludl
    curl http://localhost:3480/data_request?id=exit
    

    Then start the "openluup" service with:

    $ sudo systemctl enable openluup
    $ sudo systemctl start openluup
    

    OLservice.png

    Vera Bridge

  • GE/Jasco Z-wave wall switch
    B Buxton

    @librasun Good to know. I'm only out shipping costs if they don't as there's no way I have the time to de-solder these boards.

    Hardware

  • openLuup: Shelly Bridge plugin
    B Buxton

    @akbooer It's just easier to understand the code/ what's occurring in a plugin as opposed to openLuup, mainly because of the typical plugin structure and its place on top of the openLuup subsystem. That's probably a trivial distinction to you, but for me it's a huge difference in understanding as I'm not in any way fluent with the inside baseball of the OLuup object model.

    Per your MQTT comment, though it can be done (https://github.com/jziolkowski/tdm), it would be difficult to have functional device bridges if you took away MQTT, as you'd have to interrogate a router in some fashion to find out if these devices exist on one's network, and then use http commands to control the devices. So I see MQTT handling as more an innate part of the OL subsystem, like http, than a device profile like tasmota or shelly, device profiles that are typically handled as stand alone plugins.

    Plugins

  • GE/Jasco Z-wave wall switch
    B Buxton

    @librasun This is great to know. I have a box of these switches that failed from power outages. In each case, it seems a capacitor failed after power was turned back on, at least as far as I could tell from looking at the swollen cases. I didn't measure microfarads though as I did not want to start unsoldering components...

    Will they take back switches without a receipt as some of mine are ancient?

    Hardware

  • Power outage and all the Vera devices were moved to room MiOS-xxxxx. How to fix?
    B Buxton

    @a-lurker There's a systemd example in the openLuup user guide. Here's my startup based on those directions

    [Unit]
    Description=openLuup and AltUI Server for Vera 
    After=network-online.target
    After=sockproxy.service
    Wants=network-online.target
    
    [Service]
    Type=forking
    ExecStartPre=/bin/sh -c 'until ping -c1 <VeraIP>; do sleep 1; done;'
    ExecStartPre=/bin/sleep 30
    WorkingDirectory=/etc/cmh-ludl
    ExecStart=/bin/bash /etc/cmh-ludl/openLuup_run.sh
    ExecStop=/bin/bash /etc/cmh-ludl/openLuup_stop.sh
    Restart=on-failure
    RestartSec=5
    
    [Install]
    WantedBy=multi-user.target
    

    "Wants=network-online.target" makes sure the network is up. Then the ping command loops until a response is sent back from the vera. Followed by a 30 second sleep to allow everything else to get up and running. However, no vera up-- no openLuup as the ping does not time out.

    Your router must allow ICMP between the vera and the OL host. Per the OL help file, you then need to create the .sh files and then activate the systemd service. I use Patrick's sock proxy for an app, so that command does not need to be in there if you don't use the proxy.

    Vera Bridge
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Unsolved