Skip to content
  • Announcements regarding our smart home community

    8 9
    8 Topics
    9 Posts
    A
    Mios dashboard isn't displaying anything. Anyone know what is going on?
  • A place to talk about whatever you want

    176 2k
    176 Topics
    2k Posts
    CatmanV2C
    @akbooer indeed so C
  • A place to put some How-To documentations

    23 57
    23 Topics
    57 Posts
    CatmanV2C
    What is the trigger for the Apple Home automation? Any screen shots might help C
  • Share and discuss your lua creations here

    39 230
    39 Topics
    230 Posts
    akbooerA
    Why use any individual scene code at all? Per the reference docs you cited, if you define a scene_prolog global (presumably with the exact same code as your existing executeSceneNumber) that should work directly.
  • Hardware related - Small board computer to IP Camera and technologies like Zigbee or Zwave!

    186 2k
    186 Topics
    2k Posts
    akbooerA
    What’s the difficulty? Does your switch wiring have a neutral? What country are you in?
  • 899 Topics
    9k Posts
    toggledbitsT
    @3rdStng said in [Reactor] Variables not updating correctly in latest-25201-2aa18550: EDIT: Updated to 25260 and I'm still not seeing the HumidityRise expression change. I kept my global expressions since they update and refresh on the page, where the local expressons don't appear to do so within the rule. Watching these two expressions, as soon as the prevHumidity sensor updates, the expression turns green. But the Rise expression didn't and still showed 0. In this screen grab, the humidity went from 46 to 45. I would have expected the top expression to show a -1. OK. So let's start with the Global Expressions. The rise is always going to be zero, because it will evaluate prevHumidity to the current value of the sensor whenever it changes, and then cause HumidityRise to be re-evaluated subtracting the current value of the sensor taken from the sensor via getEntity() with the current value of the sensor stored in prevHumidity, and that will always be zero. This is as it ever was. Rule-based expressions have changed and now operate the same way on the recent builds, so the result is going to be the same. The difference will always be zero. And when I look at your "old" way, I'm kind of surprised that worked on the older builds, too. The fact that it may have is, to me, an indicator of the kind of problems reported on this thread, a problem which you just happened to use to your advantage previously. In working on a new approach for you, I also found another use case not handled correctly, so you'll need to update to 25261 to continue with the instructions below. Here's a new approach going forward (requires build 25261) : First, tie the Rule's trigger condition to any change in the device entity's humidity_sensor.value attribute. Like this: [image: 1758215663086-bfa7a03f-f9ac-4512-9ad8-2c9c37c56ab0-image.png] Tip: because we're using the changes operator, when the entity's humidity value changes, the trigger condition (and therefore the Rule) will issue a very quick pulse that activates the SET reaction. That pulse is often too quick to see in the UI (its milliseconds), so setting the condition (in condition options) for pulse output with a delay of a few seconds (e.g. 5) will delay the reset so you can more clearly see the distinct phases of handling in the UI. In this case, that delay makes no impact operationally, it's just for your convenience visually. Then, the new set of local expressions: [image: 1758215691289-45720c19-889d-42c1-9799-049fd33bb6bf-image.png] Only humidity_rise has an expression. In text (for copy-paste), it is: getEntity( "mqtt>shelly_handt3" ).attributes.humidity_sensor.value - humidity_last The humidity_last and rise_last variables are expressionless, used as storage for the Rule's logic. First operating principle: when an entity referred to by a Rule-based expression or trigger condition is modified, the rule is re-evaluated, and that process begins with three steps: (1) re-evaluate its Rule-based expressions (recompute them); (2) evaluate and update the state of all trigger conditions; (3) set the Rule state from trigger conditions result. This is how Rules have always worked, and they still work this way. Finally, the SET reaction for this rule would look like this: [image: 1758215733410-b7e5f40d-6f53-434d-b507-683e86e697ab-image.png] That script in text for copy-paste is: humidity_last = getEntity( "mqtt>shelly_handt3" ).attributes.humidity_sensor.value, rise_last = humidity_rise The conditional group in that Reaction is where you turn on your dehumidifer/exhaust fan, etc. The Script Action updates the local humidity_last and rise_last variables. The rise_last variable is new, and I'll explain why I chose to have two rise variables below. Theory of operation: whenever the device reports a new humidity value, the difference variable humidity_rise is calculated and then the trigger condition is evaluated and will be true (because the change in humidity caused the Rule to self-evaluate), so the SET reaction runs. In the SET reaction, if the rise is >= 3%, the actions inside the conditional group will be run. To finish, the Script action stores the last humidity and rise in their respective variables. Because it does this unconditionally (outside the conditional group), the last humidity is always recorded and the rule will therefore handle rising and falling humidity values correctly. Why add rise_last? When the trigger condition's pulse time expires (either from your condition options or the native timing of the changes pulse), the Rule is re-evaluated, and again, the first step of that is to evaluate its rule-based variables (i.e. first operating principle in effect). This is going to cause humidity_rise to go to 0, because the SET reaction made humidity_last match the entity's current humidity value (therefore the difference is now zero). I added the rise_last variable, the value of which is set only during the SET reaction, to store the humidity rise from that phase of evaluation, so you can see what it was. It is normal and you should expect humidity_rise to be 0 except when the SET reaction is running; it's now a scratch variable. The rise_last variable is your go-to reference for the last difference that was or was not acted upon by the Rule. Also... your original expressions wrapped attribute values in int(), which truncates them (e.g. int(2.99) results in 2, but it's really almost 3). You might want to use round() instead (e.g. round(2.2) is 2, and round(2.99) is 3). And finally, you might consider looking at the time series capabilities of VirtualEntityController. That can directly produce a change rate value (using the rate aggregator) that makes it pretty easy to determine when there's a sudden upward change in humidity.
  • The goodness of vera without the bad. Discuss installation problems and improvements.

    186 3k
    186 Topics
    3k Posts
    A
    "AK: Your best bet would surely be to register a callback handler to listen for messages on a specific address?" Yep - that seems the most obvious method - just wanted to make sure I hadn't missed some other turn of events. With your own callback handler, you can clearly sort out any email encodings, etc. On the Doco - Goggle doesn't seem to index github io pages. Seems to me you need to have some sort of URL redirect, that looks like say https://smarthome.community/openluup, that would get indexed? ie via the web server set up or similar.
  • Got a question, a comment about the community or the forum? Ask away!

    13 145
    13 Topics
    145 Posts
    toggledbitsT
    That's the beauty of community support!
  • Blog posts from individual members. Feel free to talk about your project, your smart home setup!

    12 280
    12 Topics
    280 Posts
    G
    The locksmith is trying to persuade me to purchase the BE-TECH K35 touchscreen lock with both Wi-Fi and Bluetooth, claiming it's better than the Yale Assure Lock 2. What are your thoughts on this? Which one would you recommend? Here is the link to the Chinese brand BE-TECH: BE-TECH Smart Deadbolt K3S. The other smart lock I am considering is the Schlage Encode Plus. Thank you!

Recent Topics