Help with rule to De-ice hose

I agree with @aaiyar (without actually testing)

Define Required Expression: will only allow the rule to run with the temperature is 34 Ā° or above.

Trigger: will only allow the actions to run if the temp is less than 34Ā°

So these cases:

Temp = 34Ā° (or anything > 34)

  • Require expression is satisfied and will allow the Rule to proceed to Trigger events

  • Trigger Events: will not trigger because the temperature is NOT < 34Ā°

Temp = 33Ā° ( or anything below 33Ā°)

  • Require expression is not satisfied and will NOT allow the Rule to proceed to Trigger events

So if this somehow works as a Rule then the operation of the Rules does not follow the verbiage of the logical statements.

Please see the documentation I linked to. This is not how the feature works.

(What you describe is more similar to a conditional trigger, another feature that is also described there.)

1 Like

No, as @johnwill1 demonstrated, it works.

Now, I can say that when I tested something similar probably 2 years ago, it didn't work. But my rule was likely setup differently.

Except for the logs entries, why do you care if it turns on (or off) every 7 minutes? You could use a private Boolean to ignore an ON command if the heater is always ON

or
You could add a simple condition something like "if on don't turn on" or similar logic.

Fair point. In general, I like my rules to be as clean as possible and not lead to unnecessary overhead. It didnā€™t freeze last night, so I didnā€™t get to test it.

A related thought...

If the hose is insulated and I assume kind of small, do you need the heating tape on 100% of the time when @ low temp? Not knowing the tape wattage, would it be worth the time to have the tape go on and off at some slow rate?

Thanks for the link,

I'm assuming, since it works, that the sequence of evaluation is not what I was thinking. I may be wrong here but it seems the "Required Expression" would have to be evaluated BEFORE the trigger, such that it represents the "old" temp (in this case).

If this is the case, what controls the evaluation of the "Required Expression"?

Thanks
John

Yes, that is consistent with the description you read in the documentation.

Event subscriptions to the device attributes (or time, hub variable, etc.) used in the required expression itself.

I'm still missing something.

The steps as I think they are sequenced: (using the value of temp referenced in this thread"

  1. temp = 34Ā°
  2. The Required Expression (RE) is evaluated by what occurrence?
  3. The temp changes to 33Ā° (driven by the device driver)
  4. The "RE" is still "true" as whatever causes it the be re-evaluated didn't yet happen.
  5. The actions are triggered as you suggest because the RE is still "true" and the temp = 33Ā°

The key to me understanding is what causes the RE to be evaluated.

Am I on the right track?

Thanks

I think it would be more helpful to think of the required expression evaluation at the moment just before triggering as being what matters. This makes it useful to capture specific state changes -- and was the very reason it was introduced, as with the modes example in the docs (not a device, but same idea: different event values for the same thing). The rule above is the same, capturing the transition from >= 34 to < 34 (rather than all readings below 34 as it would without the required expression; as with the example in the docs, this use of required expression captures one particular state change). If it didn't work this way, the very use case that prompted the addition of this feature would not be applicable.

As a consequence of this, you can also think of it this way: if the required expression and trigger event refer to the same attribute/event, the resulting value from the trigger event is not yet taken into account in the evaluation of the required expression. Of course, there is no reason a trigger event and required expression need to have anything in common, and some users do just use required expression more generally to restrict triggering of rules under whatever unrelated conditions. In this case, while the above is still true, it doesn't really matter since there are no overlapping concerns.

1 Like

Makes perfect sense. Could be just me (being dense) but you might add the above statement in the documentation.

Thanks
John

Good thought. Iā€™d need a lot of data to answer that question: ā€œwhat is the volume and temperature of water that transits the pipe every minute, and how does that temperature change with the tape on.ā€ However the time below 34 degrees where I live is on average 3 hours A YEAR. Assuming a worst case scenario, we are talking about 5.4 kW per year. So very little energy overall even running it constantly.

1 Like

I don't have any experience with heat tape, but you don't want any fires, etc. Are they rated for constant duty? Did it come with a built in thermostat controller?

Again, I don't have any experience with heat tape.

No built in thermostat. They are rated for long term use.

1 Like

Update: Rule is working. I'm still getting some "wobble." The only way I can get the device to work is to set it as a dimmer. Not sure why it gives a command to "set to 29" or "70" instead of just "on." Also the PB doesn't seem to be protecting the rule while it's running.


You'd have to post a screenshot of the current version of the rule so we could try to figure out why the PB isn't stopping the rule from re-firing. You do have the PB in the required expression?

What device driver is being used for the Ice Maker Drain Hose Deice device? It's odd that it's acting as a dimmer. I just assumed you had something plugged into a smart outlet.

I still think the rule format that I posted above makes this simpler. Get rid of the PB (which can get stuck in the wrong state, causing your rule NOT to fire when it should) and just use "under House Z Wave ice maker drain hose deice switch = OFF" as your required expression. The rule will run, turn the switch on, and then not trigger again until the switch is turned off.

Thank you. Old rule is the first screen shot which resulted in the previous logs. Second Screen shot is rule rewritten as you suggested. It's supposed to freeze again tonight, so I'll post new logs if the rule triggers.


I mentioned further up the post - the PB wasnā€™t actually needed, it was something Iā€™d added to one of my own rules (for a reason I canā€™t remember). Just removing it from the required expression and actions is all that was needed as I showed in a later post.

As always with RM there are multiple ways to achieve the same end and the method you're trying now will also work. It's probably a bit 'safer' as if somehow the de-ice was switched off accidentally, it'll be checked at the next temperature report (whereas in my example there would be no re-trigger until the temperature had risen again to satisfy the required expression)

Rule appears to be running very well. The log is showing the power going up because the device is listed as a dimmer. When I put the device on the network, it came in as a dimmer and any attempts I have made to change it to a switch made it not work. Thoughts?

I also got this warning yesterday which I've never gotten before. It has not since repeated.



What attempts have you made to change it to a switch?

Under Devices, device info tab, what is listed in the "Type" field? You could try changing it to 'generic z-wave plus outlet' and see if that works.