State image

For a long time I had a code like this :

          - type: picture-entity
            entity: device_tracker.44_91_60_8d_76_44

            show_state: False
            show_name: False
            state_image:
              home: '/local/images/person_at_home.jpg'
              not_home: '/local/images/person_not_at_home.jpg'  

Because I got another router it is not possible anymore to use it like this, I now want to use the ping-platform .
Works fine to and the state of the binary sensor changes to connected or not connected.
It looks like I cannot use this state in the previous code, the picture that should be loaded does not display. Something seems to keep loading but I don’t kow what . Don’t know the english word for this thing: image
So what should I use for state_image now ?

What is the entity and states you have now?

This is what I have now:

          - type: picture-entity
            entity: binary_sensor.galaxy_a72
            show_state: Off  
            show_name: Off
            state_image:
              connected: '/local/images/person_at_home.jpg'
              off: '/local/images/person_not_a_home.jpg'

But that does not work.
But other options like On and off or connected and not_connected do no work either

I think you need to use “on” and “off” and also wrap them in double quotes like this:

state_image:
  "on": '/local/images/person_at_home.jpg'
  "off": '/local/images/person_not_a_home.jpg'

Just keep in mind, you can’t use this sensor as a presence detection.
It will not be accurate enough

That worked indeed, thank you for that. I do not understand why on and off have to be between double quotes while that is not necessary for home and not home.

It is the only option I have. Because I installed home assistant on Synology docker I cannot use bluetooth either.

GPS or apps wifi tracker is much better choice.
Ping will not work on phones.

Correct me if I am wrong but:
1.For a wifi tracker I need data from my modem/router which is not possible with my current router.
2. For GPS sharing location is needed, and I don’t want my family to ask for that. Besides that I only want to know whether they are in my residence, not where they hangout when they are not (allthough :slight_smile: )
3. I can ping their local-ip address

1 no not really.
The HA app reports what wifi SSID you are connected to and even if the phone goes to sleep then it doesn’t change, meaning HA will still report “home”.

2 ok.

3 yes you can ping it, but only when the phone is on/wake. As soon as it sleeps the device will stop responding and HA will believe you are not home.

ad1. I am sorry, but I don’t understand what you are saying. How can Home assistant read to which SSID the phone of someone is connected to ?

Install the app and everything will be clear.
That is the best answer I can give you.

I appreciate your help and hope you are still willing to answer my questions :slight_smile:
You mean the home assistant app (aka companion app?). But that should be installed on the phone of the other person’s ?
I allready have it on my phone, but don’t see an option to track other devices then ? And if it has that option, what happens when I am away from home myself ?

If you “manage sensors” then there are a long list of sensors you can add.
But yes each phone you want to track would need the app.

When you walk out of your local network then you need a remote connection back home, either with Nabu casa, duckdns or fixed IP (or other method).

I was afraid of that, They don’t have a problem with that I suppose, but I have to change a lot of other settings to prevent they switch my lights etc.:slight_smile: I think I have to stick to the ping option for this moment.