Skip to content

Multi-System Reactor

751 Topics 7.2k Posts
  • Category Topic Guide -- Read Before Posting

    Pinned Locked
    1
    8 Votes
    1 Posts
    711 Views
    No one has replied
  • Reactor (Multi-System/Multi-Hub) Announcements

    Pinned Locked
    114
    5 Votes
    114 Posts
    16k Views
    toggledbitsT
    Reactor build 24343

    BARE-METAL USERS: Please run npm run deps from your Reactor install directory to upgrade packages. Remove any existing package-lock.json file first if it exists. These steps are only required for bare-metal installs (does not apply to Docker).

    NOTE: Notable UI Change: removing widgets on the Status tab now requires you to drag the widget (by its header) to the top navigation bar and release it there. Previously, moving a widget anywhere outside the content panel would remove it, but this was troublesome for small touch displays (too easy to remove items while scrolling).

    NOTE: If your Current Alerts widget displays two menu icons in its header, remove the widget (by dragging it to the top nav bar and releasing it), and then create a new replacement Current Alerts widget.

    PR 0000389: Improve mobile device compatibility. Although many aspects of the UI have been tweaked for better presentation on small displays, it will continue to be the case that editing of major system objects (Rules, Reactions, Expressions) is a high-interactivity task, and the design goals do not and will not include "mobile first" compatibility for that. PR 0000387: Make VirtualEntityController operation of reactor_system.set_attribute action identical to (and in fact, just an alias for) x_virtualentity.set_attribute. On virtual entities, all attributes are de-facto writable. PR 0000386: Fix an issue with HubitatController where it could attempt to set NaN on an attribute, generating a warning in the log. The Reaction List has been modified to show a spinner while a Reaction is running, rather than holding a green highlight. Fix an issue with the Reaction List not repainting correctly after editing a (global) reaction. Additional hard-coded colors in some CSS styles have been removed in favor of CSS variables (Bootstrap- or Reactor-defined). This should help user making custom themes. Improve the error message given when a script/expression attempts to set a global variable that is not writable (i.e. it's not expressionless). The default action handlers for increasing/decreasing values in dimming, position, and volume capabilities has been updated to more consistently move in increments of the related step value. For example, when the current dimming level is 0.55 (55%), the dimming.up action with a step of 0.1 will move to 0.6 rather than 0.65 as previously implemented. Not all devices/Controllers use the default action handlers for these actions — if the Controller implements its own semantics, this change has no effect. VirtualEntityController can now do HTTP requests in actions. This allows you to create a virtual entity that functions as an interface for a device that is HTTP-controllable without the need to write a custom Controller instance. See the docs for VirtualEntityController for updated section on actions. HassController: Bless Hass to 2024.11.3

    I am working on some bigger structural changes to Reactor, and have been for a while now. In the interest of finishing those changes, the rate of latest builds is going to go down for a bit. I will, of course, address any serious issues that need fixing during that time.

  • Reactor-Editor / Reactor-ui-Status Errors

    7
    0 Votes
    7 Posts
    61 Views
    toggledbitsT

    That's... crazy. You know those things programmers say "should never happen"?

    It's that.

    Digging.

  • every X days field uneditable

    11
    0 Votes
    11 Posts
    65 Views
    G

    @tunnus yes, the rule is working and @toggledbits indicated as such (that it would work) but he raised a potential issue regarding the crossing of midnight that I was asking about there being a better approach.

  • Darker Reactor style

    11
    1 Votes
    11 Posts
    266 Views
    therealdbT

    small update to align to 24343. https://gist.github.com/dbochicchio/825098ac13b7f8cac22012eae37ff7ce

  • Which user to install nodejs as ? Debian Linux

    20
    0 Votes
    20 Posts
    567 Views
    G

    @therealdb I have the hardware, just haven't had the time yet, to do exactly this.

  • OpenAI Controller for Reactor

    2
    1 Votes
    2 Posts
    125 Views
    therealdbT

    Thanks to @toggledbits for guidance and the new option to capture response from actions into variables. It was quite fun to write this controller!

  • Thanksgiving lighting took a holiday

    5
    0 Votes
    5 Posts
    167 Views
    G

    Ok, oddly, the correct lights came on last night. 🤷♂

  • Reference error - null object

    Solved
    4
    0 Votes
    4 Posts
    183 Views
    toggledbitsT

    @tunnus et al, please don't post screen shots of code/expressions or logs. Screen shots often end up displaying at a reduced size that makes them very difficult to read. Just copy-paste the actual text and use a fenced code block.

    To the question, as @therealdb said, judicious use of the coalesce operators will generally help here, particularly if you apply local knowledge of the desired outcome. There's another one that's often helpful when working with sources for numeric values that can be occasionally null:

    The ?# operator will take any left side expression and convert it to a number or the value on the right side, so someexp ?# -1 would produce -1 if the value of someexp can't be converted to a number or is null or NaN. In other words, the general form somexp ?# altval is shorthand for do local t=float(someexp), isvalue(t) ? t : altval done

    You can use this to produce, for example, an "off scale low" value that wouldn't trip a "greater than" operator on a trigger for a temporary missing value on an entity. This would let you write your expression more tightly as:

    round( getEntity( "..." )?.attributes?.current_sensor?.value ?# 0 * getEntity( "..." )?.attributes?.x_hubitat_extra_values?.voltagePhase1 ?# 0, 0 )

    Note that the ?# operator has higher precedence than the math operators (like * and +) so you don't need parentheses around the subexpression in this case.

    That said, if it's specifically zero you're after where there's a null, you may not need to do anything special, because the expression language follows the JavaScript semantics for null in arithmetic: null is treated as zero (e.g. null * 8 = 0 * 8 = 0 and null + 8 = 0 + 8 = 8). So this could be written even shorter as:

    round( getEntity( "..." )?.attributes?.current_sensor?.value * getEntity( "..." )?.attributes?.x_hubitat_extra_values?.voltagePhase1, 0 )
  • Trouble Configuring Multi-System Reactor Logic Across Devices

    4
    0 Votes
    4 Posts
    178 Views
    therealdbT

    @gwp1 I removed the link. Let's see if @gregbowers is a bot or not 🙂

  • MSR UI on a mobile browser

    7
    0 Votes
    7 Posts
    254 Views
    toggledbitsT

    @mrFarmer said in MSR UI on a mobile browser:

    Toggling the hamburger menu shows most pages except status. That rarely shows a widget especially in landscape mode. I would not think about making or changing rules on a small screen, but being able to look at the status would be nice.

    Found and fixed for next build. That sent me on a bit of a mission to try to improve the general appearance on the UI, even if editing will never really be fully supported (it may work, but I'm not going to approach it as a "mobile first" redesign, because I don't think that makes sense for this project). Here are some examples of work so far.

    Screenshot_20241125_123614_Brave.jpg Screenshot_20241125_123645_Brave.jpg

    This is a Samsung Galaxy S24 phone. Reduced top (nav)bar, menu moved from left margin to top and stripped of text. Columns removed from lists at this size.

    Screenshot_20241125-123742.png Screenshot_20241125-123711.png

    This is Samsung Galaxy S2 tablet. At this size, the menu returns to the left side, but still without text.

    The Status widget problem is fixed, and in addition, there was an issue where the Status widgets would drag if you touched anywhere in them -- they're only supposed to drag from their headers. Touch is still not working great on the phone (smallest size), but I'm still chipping at it, trying to find a workaround (the gridstack library controls the touch behavior, so I'm at the mercy of their choices and issues).

  • 0 Votes
    2 Posts
    205 Views
    toggledbitsT

    Harmless. Just a warning. I'll see about quieting it for the next build.

  • 0 Votes
    4 Posts
    274 Views
    toggledbitsT

    The error message will be improved, but for reference for future readers, there are two ways to fix this when it happens:

    Change the name of your local variable.

    Explicitly declare and initialize your local variable at the start of your expression as explicitly local. For example, assuming alpha is the name of a global expression/variable but we want to use it as a local variable name:

    local alpha=0, each e in matchEntities( { capability: 'dimming' } ): alpha = alpha + 1
  • 0 Votes
    5 Posts
    233 Views
    therealdbT

    @toggledbits thanks for the help. I will eventually improve this code and apply capabilities only if the device is somewhat new/changed or at startup. OpenSprinklerController is peculiar, but I think I could manage to achieve this result.

    This code is shared among my controllers, I've modified them to better handle updates. Thanks!

  • Access to log file viewer denied

    6
    0 Votes
    6 Posts
    269 Views
    toggledbitsT

    If you change nothing in the ACL configuration, you can add the username and password for access to the query URL as request parameters. The specifics of this are described in the documentation (under Access Control).

    You can modify the ACL to allow anonymous access but restrict the source IP address to whatever host(s) you use.

  • TTS in MSR?

    Solved
    33
    0 Votes
    33 Posts
    2k Views
    N

    @therealdb said in TTS in MSR?:

    [
    "Bentornato a casa",
    "Casa, dolce casa!",
    "Ciao!",
    ]

    Grazie! and thanks to @toggledbits for the new dark theme, also my eyes are happy!

  • Should MSR import this device type from an Ezlo controller?

    7
    0 Votes
    7 Posts
    191 Views
    cw-kidC

    As for your other comments Gentlemen, I don't disagree with them..

  • This topic is deleted!

    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • A couple of things about Reactor 24293

    3
    0 Votes
    3 Posts
    184 Views
    therealdbT

    @toggledbits said in A couple of things about Reactor 24293:

    Yellow has been dealt with. The remaining coloring is Bootstrap (5.3). I don't specify color directly here, I specify type or usage and it chooses color, and it adjusts color based on theme.

    true, but these could be overridden by CSS variables.

    [data-bs-theme=dark] { --bs-blue: #0b5ed7; /* Darker Blue */ --bs-indigo: #520dc2; /* Darker Indigo */ --bs-purple: #59359e; /* Darker Purple */ --bs-pink: #b02a6b; /* Darker Pink */ --bs-red: #b02a37; /* Darker Red */ --bs-orange: #dc6a0a; /* Darker Orange */ --bs-yellow: #e0a800; /* Darker Yellow */ --bs-green: #146c43; /* Darker Green */ --bs-teal: #169b7e; /* Darker Teal */ }

    Give it a try.

  • Error on start for MSR after update to 24293

    14
    0 Votes
    14 Posts
    245 Views
    G

    @toggledbits ignorance is bliss 🙂

Recent Topics