Why are we unable to use %device%, %value%...in a Conditional Actions?
Something like
IF %device% = "somedevice" THEN ...
The only way to achieve this is to set a global var to %device% and then test the global var.
Set GlobVar to %device%
IF (Variable GlobVar() = "somedevice" THEN ...
Also do you expect to permit the use of "AND" "OR"... in IF Statement in the near future.
IF this=that OR that=this THEN ...
Thanks and keep up the excellent work!
1 Like
I'm confused...why are you trying to do it like that? Why not simply use the capability of %device% and check that. If you are trying to check which door is open, just directly check the contact's status rather than using %devcie%. The %device% variable is always the triggering device but not necessarily the one you would want to use in the conditional action.
The thing is, that's exactly what I want to know...which device triggered my rule amoung the 2 or 3 I've selected as triggering devices. And sometimes it's a device that only turns on for a millisecond or so.
If triggered device=a then
Do this
Else if triggered device=b then
Do that
...
The new If then/else if/end if of Rules 3.0 is a dream come true for lil old me. It makes everything so much easier
Then put them in separate rules. They're free you know.
I want to keep things simple.
The exact same rule apply to 3 devices.
And you think trying to do it with a global variable is simpler than just having 3 rules? Well, I guess we're all entitled to our opinions. But i guarantee you, you would have had it working days ago if you'd done it in 3 rules.
Trust me,
I've been a Software engineer/Programmer for almost 30 years.
Between having to modified 3 "rules" with the exact same codes, when needed, efficiency taught me that simply having to modify one is way much better...and fa$$$ter.
So again, simpler is better
2 Likes