#How to make an automation test for a cell phone SSID?
1 messages Β· Page 1 of 1 (latest)
A simple state condition will do it
- condition: state
entity_id: sensor.phone_wifi_connection
state: 'Cogs-n-gears'
Thanks for the reply! ππ I note that you have single quotes around the ssid name. Do you know if that is required? Also, if I use the GUI to create the condition test, it doesn't put single quotes around the name if the name has no spaces in it.. for example, if my WiFi SSID is Homebase and I add it as shown in the screen cap, it creates yaml that looks like this:
conditions:
- condition: state
entity_id: sensor.kyms_iphone14_ssid
state: Homebase
Quotes are not required in yaml unless the thing inside the quotes is not string-like
Now, if my WiFi name were Home base (e.g. with a space), as shown in the screen cap, the yaml created looks like this:
conditions:
- condition: state
entity_id: sensor.kyms_iphone14_ssid
state: Home base
The UI is working correctly, quotes not required
Would it still work if the WiFi SSID was something like If17>2 or some other name that contained 'disallowed" characters like pipes or redirects etc?
I think I recall seeing some SSID names that had special characters like the poop emoji or similar π
The ui should add quotes when required. If you want to learn about how YAML works, I won't try to regurgitate that, but more details here https://www.yaml.info/learn/quote.html
no prob, I appreciate the help π