Making one piston to handle all my door sensors


#1

1) Give a description of the problem
This is my attempt at creating one piston that handles all my doors. All of the doors trigger a message when I’m away. During the night, only certain doors will trigger a message and during the day other doors will trigger a message.

2) What is the expected behavior?
The piston works as it should. I’m just not happy with the way I determine whether the particular door is part of the Night List or Day List

3) What is happening/not happening?
I’m converting the device lists (Night_Doors and Day_Doors) to strings (Night_List and Day_List) to test if the currentEventDevice is in the list. Those strings contain the Device Names separated by commas and the last one by the word “and”. (Day_List=“Garage Door, Overhead Door and Side Door”) It would be better to use the device IDs because they aren’t ambiguous. (For instance, if you have one door simply named “Door” and then others named “Front Door”, it will appear that “Door” is part of the list even when it’s not.) Is there a way to convert a device variable to a string of the device IDs?
Is there another way to do this that works more unambiguously?

**5) Attach any logs (not really applicable)