#How to make an automation test for a cell phone SSID?

1 messages Β· Page 1 of 1 (latest)

opaque cobalt
#

So I am wanting to have an automation check to see if the SSID is equal to a name as a condition. Can someone tell me how to do this?

split pike
#

A simple state condition will do it

#
  - condition: state
    entity_id: sensor.phone_wifi_connection
    state: 'Cogs-n-gears'
opaque cobalt
#

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
daring flame
#

Quotes are not required in yaml unless the thing inside the quotes is not string-like

opaque cobalt
#

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
daring flame
#

The UI is working correctly, quotes not required

opaque cobalt
#

I think I recall seeing some SSID names that had special characters like the poop emoji or similar 😁

daring flame
opaque cobalt
#

no prob, I appreciate the help πŸ™‚