Override device state

Hello,
I used nmap_tracker to get the connected devices.I got the connected phones and also a smart tv.
For the phones te state is home/not_home witch is perfect but the tv can’t leave and i would like to set the state to on/off.
Example:
history
Tried to use a template value but didin’t work.
Tried to add this:
snapshot
Any advice?
Thank you!

You tried to add that to what?

You can create a Template Binary Sensor that creates a new sensor entity that can be based on other entities, such as the device_tracker entity for the smart TV.

binary_sensor:
  - platform: template
    sensors:
      smart_tv:
        friendly_name: Livingroom TV
        value_template: "{{ is_state('device_tracker.XXX', 'home') }}"

I tired to add:

device_tracker.xxx:
  friendly_name: Living room TV
  templates:
    state: if (state === 'home') return 'On'; else return 'Off';

Your solution worker, i just needed to hide the devices that i needed to override

I was asking which file did you try to add that to. The reason I asked is because that type of entry does not look familiar to me. Where did you see that type of entry documented? At the very least I’m curious. :slightly_smiling_face:

Glad you got it working.

Tried to add to the customize.yaml file
Found something that i thought would help here: Person, home and not_home

That seems to be based on some custom add-on to HA. It’s not stock functionality. The standard functionality (that goes into customize.yaml) is documented here.