How to check a actual Switch state in rule #23968
Replies: 1 comment 2 replies
-
The general way is doing it without needing a In a rule, you can also use When it comes to your first two rules, the correct format (if you want to use The last two rules lack the Beware that if you issue the As you did not explain your "problem", hard to say if there would be other ways. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
I'm once again struggling to solve a rule problem.
I want to use a rule to query the current status of a switch at any given time.
Not the message when it's turned on or off.
As a trigger event, I use the command Status 10, which returns the JSON string StatusSNS.
I've tried evaluating this in different ways, but nothing has worked.
I tried the following:
On StatusSNS#Switch1 do If %value%=="ON" tmsend blabla Endif endon
On StatusSNS#Switch1 do If %value%==ON tmsend blabla Endif endon
On StatusSNS#Switch1="ON" tmsend blabla Endif endon
On StatusSNS#Switch1=ON tmsend blabla Endif endon
The first two examples are always true, even when OFF.
The other two don't even work.
I don't work with MQTT; everything should work via rules.
Where am I making a mistake?
Or is there perhaps a completely different approach to solving the problem?
Beta Was this translation helpful? Give feedback.
All reactions