@toggledbits Since I have upgraded ZWaveJSController to 24293 from 24257 I am seeing entries related to registering action set_volume, but action is not defined by the capability 143 every time I restart Reactor.
The Siren seems to be doing what it is supposed to do. The volume levels are fine. Should I worry about it?
Reactor version 24302
ZWaveJSController version 24293
Z-Wave JS UI version 9.27.4
zwave-js version 14.3.4
18481340-4d9c-4d0c-8027-49adfa28f32a-image.png
e0e1c895-a830-48d5-8346-cbae551b441d-image.png
This has been working flawlessly each year incl this year until... Tonight... nada.
Is this due to the holiday being late this year ie because today is the 22nd, not after the 22nd?
I've managed to use MSR UI on iOS devices to some degree*, so that although UI elements (e.g. rule sets) are not visible in portrait mode, you've seen them in landscape. Now with recents builds (24302) this does not work anymore, elements (rule sets, entities) are not anymore visible in landscape mode.
Does anyone have similar experiences? Using iOS 18 and Safari/Chrome browser.
( *Drag & drop of rule conditions have never worked on a mobile)
Hi @toggledbits,
I have lots of logs with this:
<Engine:ERR> Assignment to alarm ignored -- expression-driven global cannot be set by assignmentAny hints to where look at to avoid this? Thanks.
Hi @toggledbits
I'd like to update my controllers with these new features, but I'm struggling to find any guidance in the docs - and in general to understand the context.
Could you please elaborate more? Thanks.
I have the following ACL defined:
groups: admin: users: - admin applications: true api_acls: # This ACL allows users in the "admin" group to access the API - url: "/api" group: admin allow: true log: true # This ACL allows anyone/thing to access the /api/v1/alive API endpoint - url: "/api/v1/alive" allow: trueAnd I have authenticated to MSR as "admin" user. However, I'm getting "access denied" when trying to access http://*******:8111/api/v1/log
So what I'm missing, is my ACL incorrectly defined?
Using build 24302 on Docker.
Thanks to @toggledbits for adding a custom CSS. I've started doing a darker Reactor style.
Here's the file: https://gist.github.com/dbochicchio/825098ac13b7f8cac22012eae37ff7ce
A couple of things are still too bright and I'll eventually catch-up. Just place it under your /config directory, naming the file as customstyles.css. Hard refresh your browser.
Hi!
In Home Assistant I sometimes uses the TTS, either to my Sonos or Google speakers. With reactor in Vera I also use TTS.
But in MSR I can't select the TTS-service. It's simply not there. Am I missing something, or is this the case, so far?
Thanks!
/Fanan
Hi
I have just connected a bunch of EzloPi controllers to MSR to import some ESP based devices etc.
They all seemed to have worked and imported in to MSR apart from I have one missing device. It is a Digital Gas Sensor device.
This is how that device looks in the Ezlo API.
Devices Info:
_id: "10696001" deviceTypeId: "ezlopi" parentDeviceId: "10696000" category: "level_sensor" subcategory: "" gatewayId: "457a5069" batteryPowered: false name: "Gas Sensor Digital" type: "sensor" reachable: true persistent: true serviceNotification: false armed: false roomId: "" security: "no" ready: true status: "idle" parentRoom: true protectConfig: "default"Items Info:
_id: "20696001" deviceId: "10696001" hasGetter: true hasSetter: false name: "smoke_density" show: true valueType: "substance_amount" scale: "parts_per_million" value: 2.7472610473632812 valueFormatted: "2.75" status: "idle"There is also an Analog Gas sensor that one did import in to MSR OK.
68d63dab-b871-4f44-912b-cf6e0b9eb4c6-image.png
Devices Info:
_id: "10696000" deviceTypeId: "ezlopi" parentDeviceId: "10696000" category: "security_sensor" subcategory: "gas" gatewayId: "457a5069" batteryPowered: false name: "Gas Sensor Analog" type: "sensor" reachable: true persistent: true serviceNotification: false armed: false roomId: "" security: "no" ready: true status: "idle" parentRoom: true protectConfig: "default"Items Info:
_id: "20696000" deviceId: "10696000" hasGetter: true hasSetter: false name: "gas_alarm" show: true valueType: "token" enum: 0: "no_gas" 1: "combustible_gas_detected" 2: "toxic_gas_detected" 3: "unknown" valueFormatted: "no_gas" value: "no_gas" status: "idle"And this is how this MQ2 Gas Sensor looks like on their dashboard:
Digital
cb77dfa3-4af5-4d06-9635-89207a716a89-image.png
Analog
4fb4da1b-e946-4b89-876c-bcd9f5699b6c-image.png
They have an EzloPi website here you can create your own sensor projects using ESP boards, which is very interesting stuff!
And I just wrote on the Ezlo forum here, how to connect an EzloPi controller to MSR.
THANKS.
Build 21228 has been released. Docker images available from DockerHub as usual, and bare-metal packages here.
Home Assistant up to version 2021.8.6 supported; the online version of the manual will now state the current supported versions; Fix an error in OWMWeatherController that could cause it to stop updating; Unify the approach to entity filtering on all hub interface classes (controllers); this works for device entities only; it may be extended to other entities later; Improve error detail in messages for EzloController during auth phase; Add isRuleSet() and isRuleEnabled() functions to expressions extensions; Implement set action for lock and passage capabilities (makes them more easily scriptable in some cases); Fix a place in the UI where 24-hour time was not being displayed.A couple of things for you @toggledbits, since you mentioned that this release has new features and some tweaks are expected.
Local expressions cannot be deleted. Pushing the X button has no effect for me.
When cloning an entity action, the result is strange (first is cloned one, second is the original action):
a92ea094-9e2c-4aaa-bf47-2d07a6ffdbd0-image.png
When changing the action on the cloned element, the params are added to the original one. See screenshot:
92ac3011-83c8-466b-bd23-47d483ad7a52-image.png
Dark theme has a couple of strange contrasts. One is visible in the previous screenshots (white text on yellow background). Another one is in groups (blue text on blue background):
9b3c4988-53ef-44e6-9672-30e744cacb75-image.png
Overall, I found blue, yellow, red and green (in buttons and forms) to be too bright.
On the bright side:
I love the new script action: thank you! The dark theme is a great start to avoid getting blinded at night I promise I'll try very soon the new features around actions. Thanks!@toggledbits
I just upgraded to version MSR 24293, bare metal running on Fedora. Upon restart, I am getting a error banner:
I followed the new directions about npm
npm i --no-save --no-package-lock --omit dev
Any idea what the issue is?
Seems like switching the UI to the newly added dark mode (thank you for this) does nothing. The UI stays in light mode and only a few buttons turn into dark mode (see screenshot)
Things I have tried:
Hard refresh
Different browser
Different computer
Restarting Reactor
Failed troubleshooting attempts:
No errors in Chrome console
No relevant errors in Reactor log (can still PM the full log file)
Reactor version: latest-24293-ea42a81d
Hardware: Odroid N2+
Linux version: Ubuntu 24.04.1 LTS
3df2806f-9146-485b-9ec1-d056e91cefe5-image.png Dark mode enabled
ff823023-c079-4684-b01f-d6ac6527d31a-image.png Light mode enabled
Good morning,
I have a service MQTT service that needs a restart occasionally. The add-on (Smartbed MQTT) is for the smart bed base for my bed. It has a "safety light" that I can control from HAAS & MSR as a light entity, and also moves the head of the bed to a preset at bedtime, and then lies it back flat in the morning The problem is, from time to time, the light becomes "unavailable" Restarting from the Add-ons tab in HAAS always fixes it, but I should be able to detect when it happens when "light.tempur_pedic_safety_lights" is not true or false, i.e., unavailable.
What I don't know how to do is how to restart that service. Does anybody have experience in restarting add-ons from MSR?
Running:
Reactor (Multi-hub) latest-24212-3ce15e25 ZWaveJSController [0.1.24232]HAAS:
RPi5-64 (8GB) Core 2024.7.3 Supervisor 2024.08.0 Operating System 13.0 Frontend 20240710.0Hi!
Is it possible to generate two additional log files, the first being the replica of what is displayed on screen by the Rule History widgets and the other with Recently Changed Entities?
And could I configure the generation of one file per day, and delete the older ones? For example, store the last 5 days?
And being more ambitious, does Windget have an icon to open these TXT files in the navigated?
Well, we're approaching Christmas, so here's my request to Santa Claus @toggledbits 🙂
Hi @toggledbits
I'm working on a controller to generate llm response from a prompt in reactor. I have http response coming thru an http request action at the moment, capturing the response inside a local variable. So, it's practically sync.
I want to create a controller, so I don't have to rely on a proxy (and have a simpler architecture), and duplicate absurd http actions, but AFAIK in the current implementation, actions are async only. But if I have multiple requests going on, I cannot be sure what it's really inside an attribute. I also thought that something like a correlation id when sending the request could be used to identity multiple responses, but I wanted to double check with you before starting with something too complicated. I also noticed that some actions in home assistant (ie forecast) are sync and I'm wondering if you have any plan or hint to address this situation. Thanks.
Thanks.
@togglebits I am curious as to why the tilt_sensor.state (primary) = NULL. I believe it should show true or false. I have to use binary_sensor.state instead in my rules.
Again, not sure if this is related to Reactor/ZwaveJSController implementation or the actual Z-Wave JS UI docker version. I have copied, below, the attributes of the tilt sensor in hopes it can help.
Thanks in advance.
Reactor version 23302
ZWaveJSController version 23254
Z-Wave JS UI version 9.3.0.724519f
zwave-js version 12.2.3
Approach to Rulesets, a philosophic question
-
Having just embarrassed myself to @toggledbits by asserting that the latest release somehow had a bug when in reality it was surfacing underlying issues with my approach to building out my rulesets and automations I wanted to ask the collective for their feedback on how they've designed their rulesets.
For me, I built out a list of Global Reactions that I commonly use. For instance, for mode changes I typically change the mode entity and write that mode to a variable for some future use. When building out a ruleset I just pull in that Global Reaction vs manually recreating the entity list as my ruleset Reaction. Example, for lighting:
Each of these contains the appropriate group of lights to turn on/off, etc.
I also have what I've dubbed my "Armed for..." rulesets. These are rulesets that can be referenced as true or false in other rulesets. Example, for my various lighting configurations in and out of the house I have these:
I think this is resulting in reactions stomping on other reactions creating race conditions that result in things looking like they're working when, in reality, they're one restart away from disaster.
So how are you all designing your superstructure, if you will, at a high level?
-
I'm pretty much doing the same thing you are. Where these "Armed For" rules and the global reactions are used, I try to keep things as simple as possible. One trap I think people (myself included) get into is this notion that all actions have to done in one place for a specific event. For me, I like to spread the logic out in a lot of small rules, particularly because Reactor lets me enable and disable rules, so when rules are small and well-defined, if something is acting up during my implementation of some logic, I can turn a rule off (particularly if its causing problems for a device, like turning it on and off rapidly). It's easy for me to have a clear picture of conditions for each circumstance, as well.
Another thing that arose of the other discussion is that Reactor (MSR) is highly concurrent, meaning it can do a lot of things at once. This is unlike R4V, where things were pretty much single-threaded by the constraints of the OS and its plugin framework. That means a rule reaction that starts a global reaction will cause the two reactions to run concurrently. If one reaction has to wait for an action to complete (i.e. hub to tell it the command was received), the other action runs. And in fact, it's also possible that the action(s) completed thus far can cause a rule to be triggered -- rule evaluation is also eligible to be started in the "idle" time. That introduces the possibility that a rule could run during an interstitial state of another rule's actions -- work isn't done, but another rule kicks in. I think this was part of your problem -- rules need to be very tightly defined in these circumstances to prevent mis-firing in the interstitial states when another rule's actions haven't yet finished. One way to do this is to put conditions in a group, and use a stabilizing delay ("sustained for" on the enclosing group), to ensure that not only are the rule's conditions met, but they've stayed met and other pending changes didn't exclude the rule during the delay.
Example: I have a set of rules that when any primary kitchen light is turned on, the undercabinet and in-cabinet LEDs on MiLight controllers (secondary lights) are also turned on at 100%. When all kitchen lights are turned off, the LEDs are then turned off as well, unless it's Evening (defined by time in another rule set), where the undercabinet LEDs are set to 50%, and the in-cabinet LEDs are turned off. When Night is activated (we're all asleep), the LEDs are turned off, unless the house is in Guest Mode (a guest is spending the night) in which case the undercabinet LEDs on one side of the kitchen (the most-used/most-useful strip) go to 25%, and everything else is turned off (making an illuminated pathway to snacks and water if our guest gets up during the night). And when Party Mode is active, all automatic off actions are disabled (no "Last Call" effect that kills the party). And during Day mode, motion turns on the undercabinet LEDs for ambience. And of course, lack of motion in the kitchen for 10 minutes turns off all main lights (but not LEDs, and never in Party Mode). This is all a fairly intertwined set of requirements, but broken down it relies on mutually-exclusive states that are easy to test (Day vs Evening vs Night), overriding tests (Guest and Party modes), and transitive states (the conditions of the primary lighting devices). The transitive tests have stabilizing delays, because, for example, the rule and reaction that turns off the primary lights for lack of motion, if it occurs in the Evening, will turn off the LEDs and also trigger the rule and reaction that turns them on to 50%, and those two reactions will try to execute concurrently -- not good. Without the delay, I would very reliably get a mix of the undercabinet lights being on or off, rather than all on at 50%. But it's simple: the "Undercab Evening" rule just makes sure that all primary lights, as a group, have been off for a few seconds before it triggers and starts turning the LEDs on.
That may seem a bit complex, but the set of rules is actually pretty simple (I think). Here's how I've structured all that (typed-out since screen shots would be horribly large and long):
- Rule
Any Key Light On
is an OR group that is true when any of the three primary lights is on: sink, island, and main. This is an "Armed For" rule in your parlance (i.e. it has no reactions/actions of its own; its state is used by other rules). - Rule
Kitchen Recent Motion
is true when (triggers) the motion sensor trips; delay reset for 300 seconds. This is another rule that is only used by other rules, it doesn't have any reactions. - There are "global" rules for
Day
,Night
andEvening
periods as mutually-exclusive modes, andGuest Mode
andParty Mode
(just virtual switches). - Rule
Undercab Follower - On
turns on the LEDs to 100% whenAny Key Light On
is true. Just that simple. - Rule
Undercab Follower - Off
turns off the LEDs whenAny Key Light On
is false for a sustained two seconds. - Rule
Motionless Kitchen Off
turns off all primary lights and LED strips when (triggers) there has been no motion for ten minutes (Kitchen Recent Motion
is false sustained for 600 seconds) and Party Mode is false, and (constraints) whenAny Key Light On
is true on OR the always-used undercabinet LED strip is on. - Rule
Undercab Day Default
turns on the undercabinet LEDs (not in-cabinet) when (triggers) it'sDay
andKitchen Recent Motion
is true, and (constraints)Any Key Light On
is false (no primary lights are on); - Rule
Undercab Evening Default
turns on the undercabinet and in-cabinet LEDs at 50% when (triggers) it'sEvening
andAny Key Light On
has been false for at least 10 seconds (sustained for delay), and the always-used LED strip is not on. - Rule
Undercab Normal Night
turns off the LEDs when (triggers) Night is true and Party Mode is false and Guest Mode is false andAny Key Light On
is false. - Rule
Guest Mode Night
(should be calledUndercab Guest Night
for consistency, I suppose) turns on the always-used LED strip at 25%, all others off, when (triggers) Night is true and Guest Mode is true and the always-used LED strip has been off for at least 10 seconds.
Notice, for example, that I didn't make the effort to make a monolithic rule for
Motionless Kitchen Off
that figures out if it'sDay
,Evening
, orNight
, and ifParty Mode
orGuest Mode
were in effect, and set the LEDs accordingly. Rather, MKO just turns the lights off, and the other rules turn things back on after a small delay. This serves two masters: it keeps the complexity low, and it allows recovery from a manual operation (i.e. all the lights are turned off manually rather than by the rule) without the need for an additional rule to detect and act on that manual change. Sure, it's a little "flashy" (LEDs turn off, then may come back on shortly after, rather than just going directly to the new terminal state), but it's also very easy to understand and maintain, and spouse-approved. I have no love or desire for any more complexity than is required by my own sensibilities and the WAF. Anyway, I think a lot of people get bogged down thinking they have to handle everything on one condition (i.e. when the lights are turned off, I need to implement every possible terminal state right there in the rule where that's detected), and that's not the case. I was also able to develop these rules incrementally and without the complexity going non-linear with every new requirement I added.In computing we would say Reactor's rules and reactions are not "atomic." Atomic, in the computing sense, generally means an indivisible part — an operation that will be done without interruption. Rules and reactions in MSR aren't atomic. A reaction does not take over the CPU and run until the reaction is done. The reaction may give up the CPU at any step to allow other things to happen, as I said. This can affect how you write conditions for rules, particularly when the conditions involve devices you are modifying in the rule's reactions. For example, if you have two devices A and B that are always in opposite states by your requirements (A-on/B-off or A-off/B-on), and you use two reactions to set them to one state or another, there is always a period where they are in an interstitial state, where one has been modified and the other is about to be, therefore both are on or both are off. It is in the space between those two actions that things can go wrong. If you think in your mind that A and B are always opposite and therefore it's safe in a rule to just test A's state alone before launching into some other action(s), that rule may trigger in that interstitial state and cause who-knows-what problem, perhaps even something disastrous. The key here is don't assume the computer works the way your brain wants to think about it. Even though you may think A and B are always in opposite states, make sure your rules enforce that expectation as well -- both devices tested for their expected state.
Also, leave yourself a lot of comments in your rules and reactions, and if there are special conditions or actions, make sure to mention them. I think a lot of missteps occur when, for example, a reaction is written for a rule that only executes the reaction at night. Six months later, you have some need to do a similar thing during the day, so you decide to invoke that reaction to do your day work as well, but it does something else that you don't want, maybe something subtle that you don't notice right away, and a week or more later you start noticing and wondering why the landscape lights are on in the middle of the day. At that point, you've forgotten that you've re-used that reaction, and you've long-since forgotten that that reaction also turns on the landscape lights. Leave comments, and when reusing a rule or reaction, look at it and review what it does. Oh, and in this case, remember that the logs are your friend. Pretty much all device actions are logged at this point, so it's easy to spot the sequence of events leading up to a device being manipulated.
One thing I can do to make things a little easier with regard to the concurrency is give you the option of making reactions started from other reactions wait for completion. That's already in the Engine, it's just not exposed in the UI. That would keep a single reaction from lighting off too many concurrent reactions; it would not, however, eliminate the possibility of other rules evaluating while those reactions are in mid-stride. That's a completely different problem (and for the moment, best handled with those "sustained for" delays). But I'll make sure the wait option is in the next release.
Sorry for the firehose/text wall...
- Rule
-
@toggledbits This. This is exactly the response I was hoping to evoke from not just yourself but others who have been using the system for a while now.
What works for you?
What would you do differently?
What was a horribly wrong path?Your lighting example makes me think of my living room curtain and the TV. I prefer the curtain to be open during the day because of the view, but once it's dark outside and the lights are on inside then I'm the view lol
So, at sunset I want the curtain to close halfway. Once the TV goes on, close all the way down to the cat door (still allowing him access to his precious screened room.) But what if I was already watching TV before sunset. I still wanted the curtain open since it was daylight out but now I want it to close all the way down to the cat door at sunset. But once the TV goes off I don't want the curtain opening back up again.
And what about that blind to the right of the TV - the one that allows the neighbors to look right in as you watch TV? Nice people but I still don't need them watching ME watching TV. So the blinds get tilted whilst the TV is on... but it's after sunset... I could go on but you get the idea.
-
I have a similar approach (smaller rules, global reactions with groups and lots of comments). But I used a very complex one (dozen of triggers and constraints) on a couple of other situations, that I regret now.
I over complicated things because I was porting code, but when I have free time (an exceedingly rare event nowadays), I'll try to break them. I usually write simpler rulesets to get the state, and a reaction to execute the logic, that's invoked by other reactions (or even MQTT, as I documented previously). What attracted me to a single ruleset was the ability to write local variables (I use them a lot, being a programmer at heart), but you'll end up pretty soon with conflicting logic and problems in debugging the state.
What convinced me to move my logic to MSR was the multi-threading capabilities, because I'm mixing lot of things together and I'm comfortable with multiple actions/rulesets being execute simultaneous, but I agree it's tricky if you're not used to concurrency. I agree virtual switches are the best help and I hope to see native virtual devices in MSR soon.
-
I wanna answer your question so badly, but fear my input at this juncture would be invalid since I no longer have a use-case for MSR. Oh, it's still running 24/7 in a Docker container over on my Synology NAS... but once I finalized the transition from Vera over to Hubitat (THANK YOU 1000x @toggledbits !), and ported all my my old logic into my new C7 hub, my "fiddling" days abruptly ended.
Do I still have Rulesets in place (but disabled) on MSR Reactor (Multi-hub) latest-21307-1746e27? Yep. Are the Rules they contain worth mentioning, since 49% involved Vera and 49% were extremely/overly experimental in nature, with 2% marked for "Testing"? Nope.
And did I ever try to Register another username on the old long-forgotten ezlo Forum after being excommunicated 4x? AW HELL NAW!
But I will mention that MSR comes to mind periodically, such as earlier today, when I realized Hubitat lacks a native way to generate and send email messages to its users. And at other times when I delve into heavyweight plug-ins (the HE community calls them User Apps) like WebCore, I think to myself, "Hot damn, this would be waaaay easier to accomplish over in MSR."
Mostly, I'm posting this reply just to SAY HI TO THE GANG, whom I miss, and to let you guys know that all of the time (Vera tweaking) and headaches (ezlo PTSD) I've spared myself over the past year was invested in buying and riding a new electric bike (the Priority Current with Enviolo CVT), so now I know what the outdoors looks like.
PEACE and lemme know if my answer here raised more questions.
- Libra
-
Hear hear. Always good to "see" you, @LibraSun
-
@toggledbits said in Approach to Rulesets, a philosophic question:
spouse-approved
It is the best comment
-
I think there should be almost a unanimity to build small Reactions that are triggered by Rules, great practice for maintenance, and repetition of tasks.
What I've been doing is using delay in the calls when I want to have a sequencing of execution, i.e., in @toggledbits 's example of A and B being opposite, I know that there will be the interval of the two being equal, but managing the delay, I try to have greater control of the execution.
Another reason to use delay in the shots is as I have already reported in other posts, I see that shooting many simultaneous actions, generates failures, and some devices are not being triggered. Again @toggledbits intervened and improved a lot the communication between MSR and HE, but I ended up keeping the delay to a few seconds that I control in Rule.
What works for you? Use of delay to control the sequence;
What would you do differently? I think the path is very similar for everyone, I follow most of the simplification and many small rules;
What was a horribly wrong path? In my case, not having execution control on simultaneous executions. -
A short summary of my rulesets; first of all I'm using quite many rulesets (e.g. "lights outside", "lights inside", "sonos alerts", "statistics & alerts") that themselves contain a lot of rules ("statistics & alerts" contain 47 rules, that mainly send telegram messages when certain event happens). But one aspect of MSR that I haven't quite figured out yet is the use of global reactions. I have none of those.
-
@tunnus I use global reactions in situations wherein, for instance, I'm triggering the color-changing smart lights I have for landscape lighting. I've created global reactions for each light and each color I typically use. The global reaction contains four different settings (which would be a pita to add to five lights) that make up each color. I then just call that global reaction when I need that color at a specific light.
-
@therealdb said in Approach to Rulesets, a philosophic question:
I agree virtual switches are the best help and I hope to see native virtual devices in MSR soon.
You've now got your wish (22258)!
-
@toggledbits I’ll try them soon. I’m quite busy at work, but I hope to remove a couple of virtual devices from my Vera and move ha bridge and my dashboard to native MSR http commands. Thanks for the addition!
-