%device% is different than I had hoped

Poor title but %device% refers to the trigger device rather than the acted upon device. Is there a way to refer to one or of the devices acted upon as in the following:


In this case %device% returns "trigger" which is what the RM indicates it should. I was hoping it would refer to the contact sensors. Is there any other way to have a variable that would refer to the indiidual contacts.

I'm still a HE newbie and read through here for ideas how to make rules more efficient to input. For each .or. condition in your .if. statement you could have an elseif that sets a local var. But of course this would take a lot longer to input the rule than what you presently have, which is more compact. I often find I spend more time trying to find a way to accomplish such things efficiently (as you are apparently seeking to do here) than it ever takes to actually input the form I finally decide on.

If there were a way to input text-based rules which allow copy/paste, inputting such rules would be much faster and I often lament there is no text-based method to input rules. But I have learned to appreciate that the system /does/ work well once you bother to write out all the rules however necessary to execute as desired. At least you can count on it working correctly once you bother to click through making all the rules :slight_smile:

Thanks, I had just resigned myself to setting a variable for each. Oh well.

Yep the GUI inefficiency is currently what is preventing me from having much more interesting rules set up. I have 22 motion sensors and around 50 switches around the house just waiting to do something next-level with. I can't wait for a better interface to show up one day, but in current form it takes me 20 minutes just to click through a single rule or 60 mins if I have to edit a few times, which is outside the bounds of fully automating a house as far as I can tell.

Couldn't you accomplish this by using HSM and configuring a custom monitoring rule? If you are using contact sensors for these it should work the way you want, and be very easy to set up using %device% to indicate which is left open. I have this set for my doors this way.

1 Like

So why not write apps to do some of your automations?

Here is how I handle this in RM, it is a bit long, but it works.

I would set up a dashboard with the sensors you are concerned with and have Alexa tell you there are problems and then check the dashboard. This rule is triggered every time the Operating State changes? That is going to be very frequently. And this is a very, VERY long rule that is going to tie up huge amounts of resources when 99% of the time it won't actually do anything.

I'm not sure I understand your response. This rule is only triggered at 10 at night. Are you saying that this gets evaluated over and over even outside that one time?

Very frequently is perhaps 3 times per hour... I think the hub can handle it... The OP wants to do it at one time, so theirs is even less.

I was responding to @napalmcsr.

That is still too much overhead for me for something that is not going to actually happen 99% of the time. Which would you rather have, this announcement running or motion lights turning on instantly rather than two or three seconds delayed? That's the choice we're talking about here.

Yeah, this is probably the right answer. I was assuming RM4 was the place to 'do everything' but that is probably wrong. I /should/ write an app for the house, I'll look into that. Thanks, I just hadn't arrived here with my thinking yet. Now I just need to figure out how to do that. Cheers.

I checked. It took 1 sec to run... I'll take it :grinning:. Compared to leaving a window open in AZ, I think it is my priority. Also, assuming that the rule rubs on one core, there should be many other resources open for running...

How often do you open your windows in AZ?

Can't let it go, can you😀...

2 Likes

Some users don't use many / any rules. They just write apps. I have been trying to get something going in groovy but I just don't have enough brain left. You have helped me get where I am though.

Nope. Not when everyone is complaining that the hub doesn't run fast enough. When you have automations that run hundreds of times a day and do absolutely nothing, that's just wasted. Also, your count was off. If your AC run 3 times an hour, that's 9 triggers, cooling, fan-only and idle will each trigger your rule. :slight_smile:

Oh no! 9 sec every 3600. The sky is falling!
I use RM for the precise reason of the hub showing down complaints. The less I use custom code the more stability I should have and support I can get from HE.

@he_bp why not just write drivers/apps in groovy? That's essentially the next level.

True. The thing is, I already have technical problems to solve (not retired yet) so it literally costs me in terms of not working to write custom code for this. I could likely figure it out, but it would be cheaper for me to hire an engineer to do it. I was looking for an HA solution that doesn't take that level of input, and hopefully will get to it one day. Thus far, I haven't tried to figure out what groovy actually is yet. Where would you recommend starting, wikipedia?

Cheers.

1 Like