Testing HA for first time what am I missing?

Hi all,

So I’m giving HA a trial with a view to maybe getting a Pi4 to run it in the future. For now I’m running it via Virtual Box and I’m getting on with it pretty well. I have an Ikea Tradfri Gateway and a couple of lights which I can control via HA fine and also via my Android Phone using the app so I’ve got past the first hurdle. I’ve been trying for a couple of hours now to set up an Automation so that when my phone joins my home WiFi it turns my Front Room Light on. I’ve set the Phone on a Static IP and also used Nmap to poll it and I can see the device status switch between Home and Away and Home as I turn off and then turn on the WiFi. I’ve set the trigger to look for the Status to change on the Nmap entity from Away to Home but when it changes nothing happens! If I go into the Automation set up screen and click Run Actions the light comes on fine. So I must be missing something obvious (well not obvious yet) in the trigger.

I believe it changes from away to home, and not Away to Home.
See the difference.
I would say that in 99% of the cases the states is in lower case. Look in developer tools to see the correct states. Lovelace does not always show the correct states, but a “prettier” version of it.

And nmap is not a suggested method of doing home presence detection.
If you have the app, then use the app as the trigger.
It has sensors for wifi which is much better than nmap.

it is not_home and home, with small caps.

You can see the correct states in Developer Tools → States


See I knew I was missing the obvious. That sorted it.

Thanks for the help and it’s onwards and upwards from here.