For any experienced SmartThings coders, I am new to this so excuse this if it is simplistic.
I have some modes and Hello, home phrases that contain punctuation. For example “Asleep, Sleep In” or “Good Bye, going out of town”.
When I have an input that allows for multiple entries of modes, then I go to the event and try to determine if the current mode is within the selection. I am using the ‘contains’ and ‘find’ options with the mode string, but this always seems to fail when there is this punctuation in the mode name. This makes sense in some respects; when I look at the ‘settings’ that are put forth, it appears to comma delimit the list. My obvious solution is to remove the punctuation, but if I want to publish this for others that seems like a hack work around…Any idea what I am doing wrong?
Sorry I wasn’t clear…when I remove them everything works great…using the code above, here is where I run into issues:
Modes:
Home
Away
Asleep
Asleep, Sleep in
On the input, I select Asleep, sleep in and Away,
When I change modes to Away, the conditions are met and everything is good. When I choose Asleep, sleep in the conditions ACT as they are not met, but if I do a debug it does show evt.value=Asleep, Sleep In. Removing the comma in the name works fine.
Now, I THINK this used to work in other code, and that the update done by ST in the last week changed this…I would be interested if you tested similar code (and modes with commas). This also seems to affect phases, but I am betting it is either HOW I am determining the mode is contained in the list.
Well, kinda…I encountered this the other day with Hello, Home phrases (in the IDE when using the simulator), and now today (in the IDE) when developing an app dealing with modes…so when I am in the simulator using my modes or Hello Home phrases, it doesn’t seem to work with commas in the name…however, when I publish them and test is SEEMS to work with any of them. No one has confirmed what I am seeing, but assume there is an issue with the IDE in the recent platform updates that changed this behavior.
I think you’re right that the comma is being used as a hard stop, but I’m also seeing it on my phone, so I wanted to see why yours was appearing correct.
Sorry just a few follow up questions:
How many modes were added to the SA?
Would you be comfortable messaging me your code privately so I can look at it?