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

toggledbits

@toggledbits
Reactor Inspect - a small read-only helper panel for MSR
wmarcolinW
Topic thumbnail image
Multi-System Reactor
Reactor Build 26284 stuck at Loading Reactor UI
T
Topic thumbnail image
Multi-System Reactor
MSR with reverse proxy
tunnusT
I'm trying to use MSR via reserve proxy in Synology DSM, but MSR page does not load https://<public ip>:30000/reactor/en-US/ At the same time logging page loads normally https://<public ip>:30000/api/v1/log I thought maybe authentication was messing it up, but there was no deny entries in the log, and also disabling authentication did not make any difference. For this use case VPN is not an option (that works, but as said not an option for this particular use case). Any ideas what could cause this? MSR build latest-26242-28d69aa8, Chrome browser
Multi-System Reactor
Missing attribute after upgrade
3
Topic thumbnail image
Multi-System Reactor
Reactor (Multi-System/Multi-Hub) Announcements
toggledbitsT
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.
Multi-System Reactor
Use of Google Gemini as an MSR and Hubitat configuration aid
R
I may be late to the AI party on this, but I recently ran into difficulty installing and configuring the Nexia Thermostat Manager on my Hubitat C8 Pro. Hoping for some immediate help I performed a Google search on my problem. I was a bit surprised to see Gemini jump into assist. Gemini walked me through the steps to clean up the failed install, followed by a script for successful installation and configuration. I would not have expected Gemini to "know" this much about Hubitat. Next I sought assistance MSR with the Entity Actions needed to set up the desired controls. I was unclear which of the attribute fields I should to set the cooling an heating temperatures. Once again, Gemini came back not with just a link to a possible explanation, but an easy to follow explanation instead. Once again, I did not expect Gemini to provide such detailed assistance with MSR. Gemini will be a key tool in my HA toolkit in the future.
How-To
[MSR] Native fan capabilty
therealdbT
Nothing more to add. I see we have hvac_blower, but, anyway, maybe a native fan on the same assumptions of the fan from HASS could be reasonable. I have a couple of them. ie, this is from ESPHome via HASS. x_hass.domain="fan" x_hass.entity_id="fan.kitchen_seashell_hood_ventilation_fan" x_hass.floor_id=null x_hass.services=["fan","esphome"] x_hass.source="esphome" x_hass.state="off" x_hass_attr.friendly_name="Seashell Hood Ventilation Fan" x_hass_attr.percentage=50 x_hass_attr.percentage_step=25 x_hass_attr.preset_mode="" x_hass_attr.preset_modes=[] x_hass_attr.supported_features=49 Thanks.
Multi-System Reactor
[MSR] Rule do not fire
therealdbT
Topic thumbnail image
Multi-System Reactor
Rule condition shows TRUE in UI but Rule never transitions to SET — survives full restart
N
Build: latest-26221-b25bb3e3, Docker on Synology. Hi, I have a Rule whose Trigger/Constraints reference other Rules via Rule State ... is TRUE. At some point it stops firing. Expanding the rule's condition tree in the UI shows every Trigger and Constraint condition green/TRUE — confirmed live by walking into the room and watching Motion go true in real time. Rule History shows no new SET, just old reset entries. Tried, on the same rule, same evening: recreating the trigger conditions with fresh IDs, recreating the constraint conditions with fresh IDs (flat and wrapped in a new Group — wrapping in a Group produced one SET, but it didn't reproduce on repeat attempts with the same structure), and finally a full container restart with a verified-correct saved rule. Still no SET, even with a fresh live motion event right after the restart. Separately, I found that this rule (and its 10 per-room clones) share identical internal condition/group IDs with each other — leftover from a batch clone done months ago, never regenerated. Not sure if that's related, since fixing the IDs didn't reliably fix the symptom either. Has anyone seen a Rule State condition show TRUE in the UI without the Rule ever producing a SET, surviving a clean restart? Thanks in advance
Multi-System Reactor
DynamicGroupController and attributes
therealdbT
Hey @toggledbits I'm back to trying to optimize a couple of things based on dynamic group. First of all, I think I found a typo in the doc: primary_attribute: "binary_sensor.state" primary_attribute_value: | d = false; each id in members: d = getEntity(id)?.attributes?.power_switch?.state or d, d I think the correct code snippet is d = false, All that said, my use case for dynamic groups is to group 3 different climate devices, so I could easily command them at the same time. Commands are good, but sometimes I want to check if any of the devices are on, and that's easily done with a similar snippet as the one you have in the docs. But this is limited to the primary attribute, while I want to have any of the attributes in the group to be driven by a similar logic (while all are null in the group). ie, access hvac_control.mode and see if any of the unit is set to cool, or heat. Is that possible, without re-defining an expression in each of my rules? Thanks!
Multi-System Reactor
Unofficial thread for compatibility
tunnusT
As there are statements about compatibility for home assistant versions in MSR new version announcements (e.g. "HassController: Bless Hass to 2025.7.3"), I thought it would be good idea to track other controllers as well. As an example, I can confirm that build "latest-25208-c53e8513" works with Hubitat Elevation C-8 platform version 2.4.2.134 using Maker API. Updates: (the latest versions first in the list) OK: build "latest-25264-2fbe9217" with Hubitat C-8 platform v. 2.4.3.123
Multi-System Reactor
Ooops - Deleted Reactor Ex Machina II
R
I accidentally deleted Reactor Ex Machina II (REM II) from my Reactor rules. I tried to recover it by deleting the .json and .dval in the Rules subdirectory and then recreating it from Togglebits original posting, but that did not work. Does anyone know how to recover REM ll ?
Multi-System Reactor
Bail out of failed reaction?
T
Topic thumbnail image
Multi-System Reactor
Arming Envisalink panel from MSR
T
Topic thumbnail image
Multi-System Reactor
[Solved] DynamicGroupController updating members issue
CrilleC
Edit: Solved in latest-26221. Bare-metal latest-26193 I have this group: "OKforLarm": name: OK för Larm select: - include_controller: vera - include_capability: door_sensor filter_expression: entity.attributes.door_sensor.state It contains the entities I expect but behaves a bit odd. When I open vera>device_10097 the entity attribute door_sensor.state changes to true but it won't show up as member in the group, when I also open vera>device_10095 they both shows as members and when I close vera>device_10095 it disappear from the group but when I close vera>device_10097 it lingers in the group until I restart Reactor.
Multi-System Reactor
Upgrade Issues
T
Topic thumbnail image
Multi-System Reactor
[SOLVED] Conflicting Set Reaction Groups Appear to Fire Simultaneously in Single Rule Evaluation
G
Topic thumbnail image
Multi-System Reactor
[SOLVED] Question regarding "in" vs "contains" vs contents of the string
G
Topic thumbnail image
Multi-System Reactor
openLuup console disappeared - 500 - Internal Server Error
A
Love openLuup - it just keeps working perfectly. I started looking at trying to add a gen4 Shelly device to the Shelly plugin via L_ShellyBridge.lua. The plugin is a little uncooked (no rudeness intended), so a bit of a rabbit hole for me. All of a sudden no console pages available in either Firefox or Chrome. AltUI works perfectly and all the log files indicate no errors. openLuup still running everything works as it should - just no console pages. I possibly screwed something up but any recently changes files show no problems. The original/ backup of L_ShellyBridge.lua was reinstated but still no console. Bit stumped on this one. Not sure how to debug. Any ideas?
Plugins
Logon screen timeout
G
Noticing since 170 that the lock screen doesn't switch to the logon prompt but, rather, stays on the active UI until such time as you go to click something within it. Then it jumps to the login screen. Brave browser Brave 1.92.139 (Official Build) (arm64) Chromium: 150.0.7871.114
Multi-System Reactor
About
Posts
3.1k
Topics
49
Shares
0
Groups
1
Followers
18
Following
0

Posts

Recent Best Controversial

  • Reactor Build 26284 stuck at Loading Reactor UI
    toggledbitsT toggledbits

    OK. Please do this: make the httpapi section of config/logging.yaml look like below (or add if not present):

      httpapi:
        level: 5
        streams:
          - type: file
            name: "httpapi.log"
            recycle: true
            keep: 4
            maxsize: 2
            level: 999
    

    Also add trusted_proxy: "127.0.0.2" to your config/reactor.yaml (after the baseurls is a good spot).

    Restart Reactor. Launch a request from the remote side of the tunnel. There should be messages logged in httpapi.log for that request that say either httpapi#1 starting request from <ip> for... or httpapi#1 starting proxied request from <ip> via <ip> for....

    If the logged message is the first form, or it's the second form and the two IP addresses logged ("from" and "via") are identical, there is no stable internal (CloudFlare) address seen on the request from your tunnel. This means you can't use allowed_ips (at all) unless your external request address is stable and can be listed in it.

    If the logged message is the second form (<ip> via <ip>), and the two IP addresses are different, then the second address is the (detectable) inside address of the tunnel. In that case, you would replace the 127.0.0.2 in trusted_proxy with that ("via") IP address, and add pass_all_proxy: true to config/reactor.yaml.

    Since your tunnel is not a reverse proxy, I suspect you're going to be in the former situation. I'm just hoping to be surprised.

    Multi-System Reactor

  • Reactor Build 26284 stuck at Loading Reactor UI
    toggledbitsT toggledbits

    There's a reason that I ask that log data is always posted with context (lots of preceding lines): often there are messages before that provide hints or additional data that are important to troubleshooting. There is a line logged for httpapi prior to one you included that would be useful to see. I'd also like to see all of the related configuration settings as you have them right now.

    Multi-System Reactor

  • Reactor Build 26284 stuck at Loading Reactor UI
    toggledbitsT toggledbits

    @tamorgen said in Reactor Build 26284 stuck at Loading Reactor UI:

    proxy_baselurl: https://reactor.xyz.com #not xyz.com

    Must include port number

    @tamorgen said in Reactor Build 26284 stuck at Loading Reactor UI:

    Edit: I also tried it with quotes around the URL. I'm not sure why, but in your documentation you have quotes around the baseurl URL and the proxy_baseurl with an IP, but in the next section with a FQDN, there is no quotes. Is that intentional, or does it matter?

    Best practice to quote it. Makes no difference to Reactor as long as the YAML parser accepts it (the quotes assure that).

    Multi-System Reactor

  • Missing attribute after upgrade
    toggledbitsT toggledbits

    The attributes in x_hubitat_extra are created from whatever the hub sends to Reactor that isn't handled, to preserve a full view of the data. If the hub stops sending that attribute at some point, the attribute lives on in Reactor, it just isn't touched. At some point, an update (build) that causes Reactor to rebuild the entity will start over with a clean slate of attributes.

    So the short answer is, if the attribute isn't there after an upgrade with entity rebuild, the hub no longer provides it (or it got renamed to something else).

    It's generally not unusual to get a few errors when a build forces a rebuild of entities, either for a single controller or for all of them (depends on the nature of the upgrade). These usually vanish on a second restart of Reactor, or even just a restart of one controller (if it's limited to just one). If you get a persistent error, post as usual with the logs per the posting guidelines and I'm happy to dig in a bit, but always make sure you've done at least two restarts before reporting, and that the hub and its apps are fully up and running.

    There are definitely timing issues at play here. Reactor cannot wait for every controller to start before firing up the Engine and letting Rules go to work, because there's no guarantee every controller will, in fact, start. It would be a huge problem if Reactor waited for every controller to start and be fully initialized. The trade-off is rebuilds of entities can cause temporarily inconsistent states.

    Multi-System Reactor

  • Reactor (Multi-System/Multi-Hub) Announcements
    toggledbitsT toggledbits

    Reactor build 26287

    • Tighten tests for proxied requests so that proxy-handling behavior isn't triggered when proxy configuration has not been established.
    Multi-System Reactor announcements

  • Reactor Build 26284 stuck at Loading Reactor UI
    toggledbitsT toggledbits

    I found two cases where proxy-handling behavior can be triggered even though Reactor isn't configured with proxy info. Build 26287 contains fixes for those.

    Multi-System Reactor

  • Reactor Build 26284 stuck at Loading Reactor UI
    toggledbitsT toggledbits

    Have you set any of the new proxy configs?

    Multi-System Reactor

  • Reactor (Multi-System/Multi-Hub) Announcements
    toggledbitsT toggledbits

    Reactor build 26284

    NOTE: Your first startup on this build may log some odd-looking errors while rebuilding entities from various controllers, and that's expected. A second restart should be noticeably cleaner.

    • New Access Control settings for operation behind reverse proxies. These new settings should enable easier reverse proxy configuration while maintaining local access (i.e. access UI via LAN). DISCLAIMER: Opening your system/network to a public IP address is not something to be trifled with, and if you don't know what you're doing, you will likely regret it at some point. Proceed entirely at your own risk. See further discussion here.
    • HassController: now recognizes HA's fan service with capabilities (including new capabilities: preset_mode, speed, direction and oscillate) extended by matching the source device's advertised supported features (i.e. not all capabilities will be present on all devices).
    • HassController: extend media_source capability to media_player devices that support it.
    • HubitatController: Improve behavior when new devices are added to the hub and published by Maker API. It should now not be necessary to restart Reactor to have the entity fully configured and responsive.
    • HubitatController: Default polling action is now Refresh (was Poll). On newer firmware, this more reliably produces a device change message when the state has updated (e.g. a switch without instant status was operated manually). Polled devices now allow an action config to override the default action.
    • HassController: Store HA unique_id and platform on extended attributes (e.g. for use in filtering).
    • HassController: Bless HA to 2026.10.1
    Multi-System Reactor announcements

  • MSR with reverse proxy
    toggledbitsT toggledbits

    OK, I had some time in the past couple of weeks to look into this. Build 26284 now contains some changes that should smooth out configuration and use of reverse proxies. Let's see how it goes, and if I need to do more, we can work through that. There are a couple of new configuration keys to be used when a reverse proxy will provide access to Reactor, and a couple of existing keys have small (?) changes in behavior. The keys and behavior are summarized in the documentation for Access Control in the appropriate places, but to streamline the discussion and your efforts, I'll summarize them here. These configuration keys live in the reactor section of reactor.yaml.

    First is trusted_proxy — this tells Reactor the host address of the LAN side of the reverse proxy. This is the address Reactor first sees opening the UI or API connection. The value of this configuration key can be an IPv4 address (e.g. 192.168.0.10). It can also be an array of addresses. I recommend surrounding the address(es) with quotes just to avoid any problems. When Reactor sees a request come in from this address, it looks to see if the request follows the HTTP/1.1 protocol for reverse proxied requests. If so, Reactor knows to track both the request source address (the inside address of the proxy) and the client address (the IP address of the client using the proxy to access Reactor, which may be inside or outside of the LAN). If those two addresses are different, Reactor knows its a proxy request.

    Second is proxy_baseurl. This sets the URL to be used as baseurl when the request is proxied. If Reactor needs to redirect for the UI, it will use baseurl as the base of the redirect if the request is not a proxy request, and proxy_baseurl if it is proxied. Typically, users of reverse proxies will keep baseurl set to the internal (LAN) URL used to access Reactor (e.g. http://192.168.0.66:8111), but set the proxy_baseurl to the externally-resolvable URL for accessing Reactor from outside their network (e.g. https://example.duckdns.org:8554).

    Proxied requests are processed a little differently by allowed_ips and ACL IP matching. When a request is proxied, the IP address matched by allowed_ips is that of the actual client, not the proxy's inside (LAN) address. Therefore, if you use allowed_ips with trusted_proxy, you must list every external/public host address (or network address in CIDR form) that is allowed to access Reactor through the proxy. By default, the proxy is not trusted by allowed_ips. That can be very inconvenient when you are a road warrior (frequent traveler to many places unknown) and want/need to access Reactor from wherever you may be. To help with this, at the expense of some security, you can tell Reactor that the proxy is trusted and all requests from the proxy should bypass allowed_ips filtering. Do this by setting pass_all_proxy: true, but if you do this, you must make sure that the proxy itself provides any and all filtering/authentication/security you might need before allowing access to Reactor. The pass_all_proxy key works only to circumvent the allow_ips list; it does not apply to ACLs.

    Access control ACLs now have from_proxy to provide matching to requests coming from a specific proxy host (or network). The source_ip filter always looks at the client address. An analog for pass_all_proxy in ACLs could therefore be an ACL with from_proxy and allow: true (actual implementation depends on the full set of ACLs and their sequence).

    Proxy configuration does not change any behavior of user access control in Reactor (i.e. Reactor user login). It is highly recommended that user login be configured and used when a reverse proxy is in use, even if the proxy provides access control in front of Reactor. If you choose not to use user login, you may be leaving your Reactor system vulnerable to external access by accidental discovery (e.g. port scans). Using user login with strong passwords provides an additional, necessary layer of deterrance to illicit access. Reactor will warn you if you are configured for proxy access without enabling and using user login.

    The Reactor documentation recommends that you enable/use HTTPS when using user login/auth. You can get away without HTTPS if your access is exclusively on your home network (no external requests or reverse proxies), but it's a different matter when your login requests are going to be through public networks. Therefore, it is also highly recommended that you use HTTPS to access Reactor through your proxy. At the very least, your proxy should receive SSL/TLS-encrypted HTTP requests at its public/external interface. You can keep internal access to Reactor in plain, unencrypted HTTP (including requests from the proxy to Reactor) if you trust your internal network.

    And for clarity, in all above where I say "highly recommended" I mean required unless you want to invite trouble.

    To wrap up, a checklist:

    1. Set trusted_proxy to the inside host/interface address of your reverse proxy;
    2. Set proxy_baseurl to the externally-accessible URL used to reach Reactor through your reverse proxy;
    3. Enable and configure user authentication/login in Reactor if you haven't already;
    4. Make sure your proxy's public interface uses HTTPS (encrypted); HTTPS on the inside (between proxy and Reactor) is up to you.

    Ref: Access Control in Reactor documentation

    And a disclaimer: Opening up any system to the public Internet increases risk. Because the totality of your systems, tools, and needs are unique to you, only you can assess the risks of such access, and the correct and most secure way to provide it. Proceed at your own risk, and know that it is entirely at your own risk and that you accept that risk and its consequences in so doing. I am providing tools, not solutions. How you use these tools is up to you, and the consequences for not using any tool properly can be dire. If you don't know what you are doing in this area, don't do it. You've been warned.

    Multi-System Reactor

  • MSR with reverse proxy
    toggledbitsT toggledbits

    @tunnus said in MSR with reverse proxy:

    if I’d put public IP there, would it still work as expected when UI is used without a proxy?

    That's a routing/firewall issue. Some will do it out of the box, some you have to enable it (it's often called NAT loopback, NAT hairpinning, or NAT reflection).

    @tunnus said in MSR with reverse proxy:

    Also, does it accept dns name or just IPs?

    It should. That may be another path for you -- internal DNS resolution gives the local address, while external give the public address.

    Caution all around, though. I don't build or test this for use in such proxies. I can foresee issues with access control in your scenario, because there's a high probability of extra steps needed to "see through" the proxy to the real original requesting address. If it works for you, fine, but at the moment, I'm not inclined to do more on this.

    Multi-System Reactor

  • MSR with reverse proxy
    toggledbitsT toggledbits

    Yeah, that will likely be a problem. It will try to redirect to that private IP and find itself unable. The API calls to the public IP don't need to do this, but the UI interfaces very much do. You might try putting the public IP there.

    Multi-System Reactor

  • MSR with reverse proxy
    toggledbitsT toggledbits

    Do you have baseurl set in your config?

    Multi-System Reactor

  • [MSR] Native fan capabilty
    toggledbitsT toggledbits

    Can you add the following to your HassController config, restart, and post the contents of the dump file created (named <controllerid>-fan_kitchen_seashell_hood_ventilation_fan.json). Thank you!

        config:
          # other stuff
          dump_entity:
            "fan_kitchen_seashell_hood_ventilation_fan": true
    
    Multi-System Reactor

  • [MSR] Rule do not fire
    toggledbitsT toggledbits

    I'm not sure how I can help here. Your assessment seems correct. Like the other recent post, the displayed states here show the triggers going true substantially before the constraints did, so the constraints prevented the rule from SETting.

    That seems like a logic issue. You need different approach, and I can't really gauge how you want this to work, and what the system limitations and risks are. That's knowledge only you can possess, at least not without a much lengthier explanation/q&a about what all this is meant to do, what you want it to do, etc.

    I can, however, throw out some things based on assumptions (and because they are assumptions, they may be completely useless to your problem and not make any sense)... assuming two key goals: you don't want to start A/C unless solar power is high, and once A/C is running you want to keep it that way, at least for a while. You could move the solar power condition to triggers and latch it. To make sure A/C is stopped if solar drops too low, add a trigger condition requiring solar > whatever minimum, so you basically have solar >= ACthreshold (latched) AND solar > ACminimum in the triggers. If solar momentarily drops below threshold, the latch keeps the A/C running, but when it drops below minimum, that condition going false resets the latch (and presumably allows the A/C to turn off). Additionally, you could add a delay reset on the A/C, to enforce a minimum runtime. This is often recommended to avoid cycling compressors too often, but also helps make sure that the money you spent on the startup inrush gets some useful life. Be careful here, though, because you now introduce the possibility that the A/C could run when the solar is below minimum (held on by the time delay).

    I will also repeat advice I've given previously... sometimes it is easier and, in fact, necessary to separate "turn on" and "turn off" logic into separate rules. I know there's a big temptation to use the SET and RESET reactions of a single rule, but it can make the triggers and constraints excessively complex to support. For example, I have a dehumidifier in my garage (where I live, my tools would rust every summer otherwise). Three garage doors, temperature, humidity, standby generator operation, and other large loads in the space are all considerations for both stop and start, but with varying logic. One aspect perhaps similar to your rule here, is that the dehumidifier isn't stopped when the garage door opens for a short period (e.g. a car pulls in or out of the garage), because of the wear on the compressor starting it, and brief periods of door open don't significantly drag on dehumidification, but long periods definitely do. I have one rule with just the start conditions, and those conditions include (a) the dehumidifier hasn't been running for at least ten minutes (prevent short cycling; it doesn't have smart controls), (b) the doors are all closed, (c) the humidity has been above threshold for 30 minutes (via a "sustained for" option on that condition). If those are met, the unit is started (via the SET reaction). In the rule with stop conditions that turns the unit off, the triggers are (a) dehumidifier has been on for at least five minutes, and (b) the start rule isn't SET (i.e. the conditions that call for it to be on are no longer met), also sustained for at least five minutes. SET reactions only; no RESET reactions. While the basic logic isn't complicated, it would be very difficult to get the independent timing of the two (on and off) processes to work in a single rule. By the way, I have a separate rule to detect if doors are open; I don't look at each individual entity in every rule, because...

    More general advice to the community: many (most?) posts lately have had huge monolithic rules posted. I don't recommend it. I don't do this to myself, and I wrote the darned thing. I make liberal use of the Rule State condition and separate out chunks of logic into small, easy to define, easy to debug, easy to test condition-only (no reaction) rules that are tested by other (action-oriented) rules. Modular design. Using the overrides on the UI makes it easier to test, because you can SET and RESET your input rules at will and in any order. When devices fail or change, there are then a lot fewer rules to update. I always start with this approach on anything new. If I later find it's overkill for the task, I can always import the input (condition-only) rules into the action rule and get rid of them.

    Again, just some thoughts/rambling without deeper knowledge of the task...

    Multi-System Reactor

  • Rule condition shows TRUE in UI but Rule never transitions to SET — survives full restart
    toggledbitsT toggledbits

    In the first image, the triggers show true as of 9:42:09. The constraints show true 10 seconds later. That's a not pass. The constraints have to be true at the instant the triggers are also true (or before), or the rule does not SET. If the constraints become true later, that doesn't matter, the rule does not SET.

    Your third image shows the same. Triggers true at 10:31:53, but constraints didn't go true until 10:32:12 (19 seconds later).

    From the docs:

    c1035d81-2187-46c4-ab50-3c14d2f4dbd8-image.png

    Multi-System Reactor

  • DynamicGroupController and attributes
    toggledbitsT toggledbits

    This is now available in build 26242. The config has changed slightly, so review the final documentation for correct usage and examples.

    Multi-System Reactor

  • Reactor (Multi-System/Multi-Hub) Announcements
    toggledbitsT toggledbits

    Reactor build 26242

    • DynamicGroupController: Custom attributes (calculated) see docs;
    • Expressions: new map() and reduce() array functions see docs;
    • HassController: Bless HA to 2026.8.3
    Multi-System Reactor announcements

  • Rule condition shows TRUE in UI but Rule never transitions to SET — survives full restart
    toggledbitsT toggledbits

    A couple of things here...

    • Editing the rule will cause re-evaluation, which is likely why you have repeated RESETs in the history with no SETs between.
    • As hard as I try, and I keep looking, finding, and fixing, the UI can get out of sync with the running engine/service, so always hard-refresh when the UI isn't making sense.
    • If a Rule has been edited, especially multiple times, and it's not performing as expected, reset the Rule. There's button for that: 43f46006-5e40-4dd8-a7a3-82fffc3e5849-image.png Even restarting Reactor doesn't do what this button does.
    • Beyond that, it would also be handy to see the top part of the screen shot that has been cut off (the Triggers group heading and stuff above it).
    Multi-System Reactor

  • Ooops - Deleted Reactor Ex Machina II
    toggledbitsT toggledbits

    No backup? Restore from backup (recommended) is the best way, of course.

    Beyond that, recreating it should not be difficult, but there have been key changes since that original post. Some detail beyond "did not work" is necessary here. Show your work and tell us about your environment.

    Multi-System Reactor

  • DynamicGroupController and attributes
    toggledbitsT toggledbits

    Here are the docs for what I have built thus far. Comments and suggestions on functionality appreciated!

    Custom Attributes

    In addition to setting the primary attribute for a dynamic group, users may add custom attributes to the group. The values of these custom attributes are typically derived from attribute values of the group's members. For example, a group of temperature sensors can have a calculated average of the readings of all the sensors.

    Custom attributes are defined under the calculate: object in a group's configuration. Here's a possible configuration for the example given above as a group with ID temp_sensors. The select configuration simply selects all entities having the temperature_sensor capability, for illustration purposes (in practice, we'd probably want to include_entity some specific entities for this purpose).

            temp_sensors:
              select:
                - include_capability: temperature_sensor
              calculate:
                - attribute: 'temperature_sensor.value'
                  source:
                    attribute: temperature_sensor.value  # Where to get data values
                  op: average
    

    This is the most basic form of custom attribute configuration. The calculate object is an array of configuration objects. The attribute key is required for each array element and specifies the attribute to be defined and calculated on the group. The source substructure tells DynamicGroupController what attributes on the member entities should be used for calculation. Any member entity that does not have the specified source attribute, or for which the attribute's value is null, is simply ignored. The op tells DGC how to reduce (or aggregate) the multiple values from the member entities down to a single value. Pre-defined operations for op are defined below:

    op Type Description
    average, avg, mean numeric The average (arithmetic mean) of the available values.
    median numeric The median of the available values (i.e. the middle value of the values when sorted).
    min, max numeric The minimum or maximum of the available values.
    sum numeric The sum of the available values.
    count numeric Count of non-null values.
    and, nand boolean Logical AND of available values. All values must be boolean true for the result to be true. If nand is used, the result is inverted (i.e. false when all values are true)
    or, nor boolean Logical OR of available values. If any value is true, the result is true. nor inverts the results (false when any value is true)
    xor, xnor boolean Logical XOR. Since more than two values may be considered, this operation is only true when exactly one of the values is true. If multiple are true, or all are false, the result is false. The xnor inverts the result.
    first string Given a string or an array of strings to match in a value key (at the same level as op), this operation returns the first matching value. That is, each element of value is checked to see if it matches a source value from any of the group's member entities; if so, that element/value is the result; if not, the test moves on to the next element. If no match, null results.

    !!! note "null Member Attribute Values"
    All of the above operations ignore null values from the source, unless otherwise indicated.

    There may be circumstances where the source values require some pre-conditioning or filtering. This is enabled by the value_expr subkey under source. The result of the expression is the value that will be added to the array of values for op or reduce_expr. For example, in our temperature sensor group, some of the sensors return temperatures in Celsius, and others in Fahrenheit. We can use value_expr to convert the values to a consistent unit, so that the resulting reduction operation yields a consistent value in that same unit:

            temp_sensors:
              select:
                - include_capability: temperature_sensor
              calculate:
                - attribute: 'temperature_sensor.value'
                  source:
                    attribute: temperature_sensor.value  # Where to get data values
                    # Convert Celsius temperatures to Fahrenheight
                    value_expr: >
                      local units = entity.attributes.temperature_sensor.units;
                      local d = ( units === 'C' || units === '°C' ) ? value * 1.8 + 32 : value;
                      ( d <= 0 || indexOf( ['C','F','°C','°F'], units ) < 0 ) ? null : d
                  op: average
                  prec: 2  # two decimal digit max result
    

    Step by step, the value_expr above first fetches the member entity's temperature units into a local variable called units. Since the attribute under source is temperature_sensor.value, the context variable value will contain the raw value from that attribute. The second line of the expression then checks if the units are Celsius, and if so, converts them to Fahrenheit (if units are not Celsius, it just takes the current value) and assigns it to a local variable d. Finally (third line of the expression), if the value is in range and the units are known, the value of d is returned, otherwise null. As stated above, most of the predefined operations ignore null values in their computation. So value_expr can function both to condition values and to filter them.

    The prec key allows you to define the number of decimal digits precision for the result value; the result is rounded to comply. For example, a calculated value of 3.14159265 with prec: 4 results in 3.1416.

    If none of the pre-defined operations addresses the need, the op: key can be replaced with an expression defined by reduce_expr:. The result value of the expression will be the value assigned to the custom attribute. The context for reduce_expr includes the following variables: group refers to the group entity being defined; members is an array of canonical IDs of the member entities at the time of evaluation (which may change in a truly dynamic group); and values is an array of the member values (as derived from source).

            temp_sensors:
              select:
                - include_capability: temperature_sensor
              calculate:
                - attribute: 'temperature_sensor.value'
                  source:
                    attribute: temperature_sensor.value  # Where to get data values
                  # Compute harmonic mean (not predefined) using expression (trivialized for illustration)
                  reduce_expr: >
                    local s = 0;
                    each v of values: do
                      s = s + (1.0 / v)
                    done;
                    len(values) / s
                  prec: 2  # two decimal digit max result
    

    Finally, custom attributes that should have fixed values can be defined by simply supplying value: under source:, like this:

                - attribute: 'temperature_sensor.units'
                  source:
                    value: '°F'
    

    Make sure the data type of the value configured matches the expected type of attribute being defined.

    Multi-System Reactor
  • Login

  • Don't have an account? Register

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