1) Give a description of the problem
What is the best way to implement a “switch statement?” Say I have two presence sensors and want to use a switch statement to determine who is home.
Like:
{whoIsHome}
{
no sensor present = 0
sensor 1 is present = 1
sensor 2 is present = 2
sensor 1 and sensor 2 present = 3
and maybe if it makes sense. I can see needing this maybe if i add more presence sensors
sensor 1 present but not sensor 2 = 4
sensor 2 present but not sensor 1 = 5
}
2) What is the expected behavior?
how do i implement this and then how do I take action? I’m not sure how to populate it and then how to do something with it like something as simple as sending an SMS.
send SMS: "{whoIsHome} is home"
I’d expect the message to report "sensor 1 is home"
I would not want “1 is home”
3) What is happening/not happening?
Just need help learning how to do this. I’ve seen other examples that have dynamic variables and then those variables are added to the switch variable. I’m not sure if this is the way I want to try to make this work and i’m also not fully comprehending it.