Change boolean value dependent on phone connection

Hello,

I want to have an automation that changes the value of a boolean to ‘on’ if im connected to my wifi (thus i want an ‘off’ value if my phone is not connected).
I splitted this into 2 automations, namely Home and Not Home.
It’s not working and i don’t know what is wrong.

alias: Jeremy Home
description: 'Jeremy Home true if connected to Wifi: FH-Home'
trigger:
  - platform: state
    entity_id: sensor.jeremys_iphone_ssid
    from: Not Connected
    to: FH-Home
condition: []
action:
  - service: input_boolean.turn_on
    target:
      entity_id: input_boolean.jeremy_home
mode: single
alias: Jeremy NOT Home
description: ''
trigger:
  - platform: state
    entity_id: sensor.jeremys_iphone_ssid
    to: Not Connected
    from: FH-Home
condition: []
action:
  - service: input_boolean.turn_off
    target:
      entity_id: input_boolean.jeremy_home
mode: single

I don’t know I made a mistake in my automations or if its a mistake with HA not updating the value of the sensor.

Check the exact state under Developer Tools → States, it’s probably different than Not Connected.

1 Like

I think its a different problem.
Even if i put my phone into airplane mode, HA still says its connected to my WiFi. Could it be a problem with the updating cycle of the sensor entity?

Mine updates pretty fast, but I’m not using it. I rather use the gps presence for detecting home/not_home, why don’t use the device tracker entity?

Are you sure?

All my Android phones have the following state when not connected:

<not connected>

It’s case sensitive and all characters have to bed included.

Mine update in less than a second if WiFi is switched on/off.

1 Like