Change status value device tracker Ubiquiti device trackers

I have Ubiquity implemented in HA, and notices that all my network devices show up in HA.

However I noticed that de devices have the state home/not home. I would like to change this to online/offline. Is there an easy way to do this for all the device trackers that are added by the integration?

That is because those sensors are set up as device trackers. home/not_home are the default states for device trackers. Can I ask why you want to change it?

If you are going to use them for automation it’s best to use the default states. If it’s to just display the sensor on your dashboard, you can customize the card.

I want to change it in the ui. I have a network devices tab and want to show the state of the devices on the tab. So if they are online or offline.

The devices are all at home, so it doesn’t make sense that is shows that it’s home or away. That’s why. :slight_smile:

The unifi integration isn’t the best one to use to see the status of devices thsst are permanently connected to your home network.

That is best used for devices that are expected to come and go regularly.

It’s best to set up something like the ping sensor integration for the devices you want to see the status of.

Ok, thanks. Then I will look at the ping option. :slight_smile:

You could try a template sensor for this:

sensor: 
  - platform: template
    sensors: 
      device1: 
        friendly_name: Device1
        value_template: "{% if is_state('device_tracker.device1','home') %}Online {% else %}Offline {% endif %}"
      device2: 
        friendly_name: Device2
        value_template: "{% if is_state('device_tracker.device2','home') %}Online {% else %}Offline {% endif %}"

Thanks for the tip. I tried that, but did not seem to work. Perhaps I did something wrong. Will try again later this weekend.

Works for me here:

image

What error are you getting? Are you changing the device_tracker identifier appropriately for the device?

Value templates also work in lovelace cards. If you just customize a card it doesn’t create an additional sensor that is tracked and logged.

1 Like

Now that’s cool, no idea you could do that :slight_smile:

Cool, thanks! Sounds like the best option. :slight_smile: