Want to use local variable as trigger (time)

Hello:

Using C7 Hub and Rule Machine 5.0, how can I use a local time variable as a trigger for a rule?

I can create a global time variable and use that to both trigger the rule, and also within the actions section to decide what to do.

However, it seems I cannot use a local variable as a trigger event. Only within actions.

I'd like to not have my global variables polluted with all those tiny time and temp variables, instead use local variables.

I read I need something called a "connector" but I cannot seem to create these.

Thanks, Mark.

Correct. This is by design, as local variables, by definition, can be changed only by the rule itself -- meaning you should be able to come up with some other way to trigger the rule or do whatever it is you want.

If you want to use a variable as a trigger, you'll need a hub variable (not global variable, a legacy feature -- and not a connector, which never existed within Rule 5.x, are a legacy 4.x feature, and still exist for hub variables but won't change anything about what you're doing here) instead; or if you describe what you're doing, someone might be able to come up with a different approach.

Thanks bertabcd1234: for clarifying the non existence of connectors, and, I kinda thought it would be the case that local variables couldn't be used as triggers.

Also, I was using the term global variables and Hub variables interchangeably. I didn't know about global variables in previous iterations. Sorry.

Just to chat, (all of this I can do myself, I just thought it'd be an interesting topic for people with nothing else to do, LOL)

I want to control the temperature in my bedroom by a profile:
Specifically, at
07:30 set to 70 degrees,
10:00 set to 55, and
23:00 set to 66.

I can (and am now) using hub variables for the times. Some examples are
GV_time_master_bed_awake,
GV_time_master_bed away, and
GV_time_master_bed_sleep.

This is kinda the wrong place for these as I have 5 rooms that go on and off at different times, like the theater room, guest bedroom, office, and living room.

That's a lot of variables I'd rather store in the rules themselves vs having them in the Hub Variables list.

I am looking into using files in File Manager, I see there is a device that can read files into variables, that opens up a plethora of possibilities.

And to add a level of complication, I want to use mode settings Summer, Winter, and Spring and fall to modify the temperatures and times. I'm still working on how to handle that.

But for now, I have to go Mow the lawn, Finish the window sills, Clean the garage, Change the oil in the truck, Reseed the lawn, Get the patio furniture out of storage, Set up the robomow, setup the irrigation, Trim some trees, Power wash the deck, Replace the banister on the deck, Fix the door to the shed, Insulate the shed, Ready the pool for summer,...

Aggghh. Maybe I'll go watch some TV.

Mark.

1 Like

Connectors definitely exist on their own, just not in Rules 5.x. They are useful for some things still. You just click "create" under the Connector column in Hub Variables, and choose what the attribute will be (just variable, or one of the other types from the drop-down type selections).

1 Like

And that is why you can't help Dad figure out why the Christmas lights won't light.