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.

Global Moderators

Forum wide moderators

Private

Posts


  • [Reactor] Variables not updating correctly in latest-25201-2aa18550
    toggledbitsT toggledbits

    @tunnus said in [Reactor] Variables not updating correctly in latest-25201-2aa18550:

    this issue of scrolling a long rule

    That is a huge rule. I'm not going to address this now. I may look at it later, but I think this case is a true outlier and the juice may not be worth the squeeze. jQuery determines when to draw the objects on screen, and that's causing the scroll shifts as it adds new objects and the browser adds them to the display. I can't prevent the scroll shift when new objects are added; that's between jQuery and the browser. The only thing I could reasonably do is prevent jQuery drawing anything at all until the entire structure has been created off-screen, then draw it all at once. My desktop is an i9-9900K, so pretty fast even by today's standards, and it takes almost 15 seconds in Brave to create the entire page structure. That means you'd have 15 seconds of a blank page (or maybe a spinner and a "Please wait...") while it works at it. I don't really feel like much is gained by doing that, because your real goal is to be able to start looking through the rule while it's still drawing.

    This rule is begging to be broken up. For what it's worth, I'm also working on changes to support parameterized rules and reactions that could make logic like this more modular and less "verbose" and repetitious in terms of their structure.

    Multi-System Reactor

  • [Reactor] Variables not updating correctly in latest-25201-2aa18550
    toggledbitsT toggledbits

    @tunnus said in [Reactor] Variables not updating correctly in latest-25201-2aa18550:

    But if you want to look at this, I could send you a JSON file of the rule so that you get a better idea?

    Yes, I'd be interested in looking at that. I think you can re-use the link I sent you previously.

    Also, I pushed a 25292 build this morning. One of the two issues addressed therein could be related to what you are seeing, so if you haven't gone to that build yet, you might try it first.

    Multi-System Reactor

  • [Reactor] Variables not updating correctly in latest-25201-2aa18550
    toggledbitsT toggledbits

    @tunnus said in [Reactor] Variables not updating correctly in latest-25201-2aa18550:

    wow, Set Rules widget is now lightning fast!

    Haha! Yeah, I gave it a specialized API endpoint. It's much faster to gather the necessary data on the server side and just push it through.

    Multi-System Reactor

  • [Reactor] Variables not updating correctly in latest-25201-2aa18550
    toggledbitsT toggledbits

    OK. I just pushed 25291 for 64-bit Intel/AMD only (should be correct for your Synology NAS). Give that a try.

    Multi-System Reactor

  • [Reactor] Variables not updating correctly in latest-25201-2aa18550
    toggledbitsT toggledbits

    Got the log files; looking at them. Did you newly create this rule for the test?

    Multi-System Reactor

  • [Reactor] Variables not updating correctly in latest-25201-2aa18550
    toggledbitsT toggledbits

    OK. Follow the instructions from this prior post to set up a log file just for this rule. Restart Reactor and just change the price_array. Then capture that log file. I will send you a link when I get home tonight where you can upload it.

    Multi-System Reactor

  • Do you Matter?
    akbooerA akbooer

    Well, that seems remarkably easy configuration…

    Just added a Shelly 2PM Gen4 (dual switch) to Apple Home. It just required me to scan the QR code from the Home app and wait a short while.

    No other configuration required initially. In particular, no need to set up IP addresses or anything.

    Subsequently, I did enable MQTT and openLuup picked up on it immediately (although as a generic Shelly device, because I haven’t included that as a recognised device, yet.)

    Control seems to work instantly from Apple Home app. Now need to link it to automation and other switches.

    So far, so good.

    General Discussion

  • [Reactor] Variables not updating correctly in latest-25201-2aa18550
    toggledbitsT toggledbits

    Oh that's not horrible, considering the amount of information it has to retrieve. But, I may be able to improve on it slightly. Stay tuned... the changelog is getting long for this release...

    Multi-System Reactor

  • [Reactor] Variables not updating correctly in latest-25201-2aa18550
    toggledbitsT toggledbits

    @tunnus said in [Reactor] Variables not updating correctly in latest-25201-2aa18550:

    Another more cosmetic issue is that there seems to be a quite long delay until "Set Rules" widget gets populated? Using Chrome v141

    Haven't observed anything like that. More detail needed. Proximate to a restart? Is the delay 3 seconds or 30? ...?

    Multi-System Reactor

  • [Reactor] Variables not updating correctly in latest-25201-2aa18550
    toggledbitsT toggledbits

    Wow. That error has been around a while, and I'm surprised nobody noticed and reported it. It's actually a bug in lexpjs, the parser/executor for expressions... it's sorting the array in place rather than sorting a copy that it then returns. That's not consistent with its spec, and I can easily fix that and get it into the next build. That bug causes other expression values to be modified when they should not be (the effect is pretty obvious in the image, for example, the first price is not 0, so the first night_price should not be 0 either).

    If you need to work around it, clone your array before sorting it:

    sorted_array = sort( clone( price_array ), $2 - $1 )
    

    I also added a little shortcut there for the sorting function. You don't specifically need to return +/-1 or 0, the sort will look at anything positive, negative, or zero, so simple subtraction can take the place of the more complex conditional expression.

    The clone() should not be necessary in future builds.

    Here's what it looks like for me now with the lexpjs fix in place (no clone() needed):

    b1bea2ac-0d50-4152-919a-1ad3257ae294-image.png

    Thank you for including a copy of the source array in text form. That was super-helpful and a big time-saver.

    Multi-System Reactor

Member List

CatmanV2C CatmanV2
therealdbT therealdb
toggledbitsT toggledbits
akbooerA akbooer
DesTD DesT
rafale77R rafale77
  • Login

  • Don't have an account? Register

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