Known_devices. yaml deprecated

Hi,

Is there a way to configure known devices in a file instead of in the GUI now that known_devices.yaml is deprecated?

I’d like to be able to save my config in git in case my hdd dies one day.

Thanks
Kiesel

The GUI just writes files to the .storage directory…it can be backed up to git the same exact way.

known_devices.yaml has never been a way to configure devices. At most you could duplicate a subset of the options from customize - pictures and friendly names. All of that can (and should) be done through customize.

As long as you’re backing up everything in your config folder, you’re backing up everything you need.

Thanks for the answers.

Backing up everything in /config will also back up the DB, right? In my case to git, which I’d like to avoid.

Maybe I should explain what I am trying to do and what I did:

I set up an nmap-scanner:

device_tracker:
  - platform: nmap_tracker
    hosts:
     - 192.168.178.193  
     - 192.168.178.57 
     - 192.168.178.144  
    home_interval: 60
    consider_home: 600

This adds three entities in the “Overview”-tab (I hope entity is the right word here), but the name is the hosts MAC-address. I tried to change that using known_devices.yaml:

24_18_1d_37_fb_37:
  name: MyName
  hide_if_away: false
  icon:
  mac: 24:18:1D:37:FB:37
  name: 24 18 1d 35 fb 36
  picture:
  track: true

But it’s ignored in the GUI (I restarted HA) and I can’t see the entries in the entry registry either.

I am happy about any pointers.

Use customize to change the name. You really don’t need to configure anything in known devices.

pretty sure you can ignore specific files from being uploaded

so use .gitignore

1 Like

Where in the GUI do we now configure tracked devices since known_devices.yaml is deprecated? I can’t find it and the docs don’t shed any light on the matter.

I have a bunch of Yeelights that have been configured manually using fixed IP addresses setup in YAML. They don’t show up anywhere in the GUI menus other than the Customize one… so how do I create / configure a tracker for them?

I have a bunch of old tracked devices working in known_devices.yaml but new entries to the list don’t seem to work…

It’s only depreciated for some trackers that have moved to storage - it’s not depreciated for everything yet.

How do you have a device tracker for a Yeelight?

I did them over a year ago… but they are simply listed in my known_devices.yaml

bedroom_lamp:
  hide_if_away: false
  icon: mdi:floor-lamp
  mac:
  name: bedroom lamp
  picture:
  track: true

to be honest it’s been so long that this is all I can remember being in the config for it other than the actual device setup:

yeelight:
  devices:
    192.168.0.42:
      name: Bedroom Lamp

device_tracker.yaml

#device_tracker:
  - platform: nmap_tracker
    track_new_devices: yes
    consider_home: 180

My issue is that I recently added another Yeelight to HA, manually similar to the above code for my Bedroom Lamp but can’t see how to get it tracked. I added extra code to known_devices.yaml in the same concept as the Bedroom Lamp but it doesn’t seem to work…

EDIT (again): maybe I will have to try adding the MAC addresses or something, but it seems odd that those aren’t required for my other Yeelights. The new devices show up as device_tracker entities, but only ever show as ‘not_home’

I don’t understand the purpose of tracking a light - is it ever not home? I don’t get why you would track it.

2 Likes

Well I originally did it when I was renting so that an automation could send a TTS out when my landlord would annoyingly turn my light switches off during a rent inspection to tell her to turn them back on. This was because I work away and it would mess with my occupancy simulator. I guess now this isn’t a problem because I don’t rent anymore, and my girlfriend is pretty good at leaving the switches on… it’s just nice to see that all my IoT devices are happily on the network, that’s all.

Nice Dave - that’s an application I would never have thought of.

You replied (long time ago) to someone saying… “but known_devices.yaml is deprecated”
by saying “It’s only deprecated for some trackers that have moved to storage”

I found that to be both very helpful AND utterly confusing. When you look at the device_tracker page, there is a WARNING somewhere half way the page that does say deprecated…
but when I add the “device_tracker” code in configurations.yaml, the file known_devices.yaml is automatically created and populated with the hosts I specified.

I am very new to home assistant. It is possible the versions update faster than the documentation… or, the people who write the documentation are experts who cannot imagine that newbies are easily confused.

You didn’t say which device tracker you configured, but that’s clearly one that pre-dates the deprecation of known_devices.yaml and that hasn’t been updated since.

Deprecated means no new integrations will use it, and that old integrations that are updated will stop using it. It doesn’t mean that every integration has been updated yet.

Hi Tinkerer, thanks for your response.
I didn’t say which device tracker I configured BECAUSE I have no way to know that there are more than one since they are al “device_tracker”

I have installed the newest and glossiest home assistant OS on a NUC and started playing.
I have not bought any devices specifically to work with home assistant, was surprised how many home assistant just found around the home. (chromecast, SonyTV, TP-Link switches)
I am just getting my feet wet before deciding what else to add on. (Somewhat favor the route of ESP-home, I think, eventually)
Tracking who is home seems to me a very basic principle to base automations on. So that’s what I tried to set up.
When I see “deprecated” it seems to me that I should not use it in a new setup.
I did not expect adding key words “device_tracker” to the configuration.yaml file, would start a new “known_devices.yaml” file by itself.

In short, please tell me how to properly track devices, based on their name, their IP-address, their Mac address for a new installation. Or where can I find documentation or examples that do this?
The official documentation I have found through google mentions “deprecated” several times with no indication or link to what has replaced it.

If the integration you want to use, still uses known_devices.yaml, then don’t worry about it, it’ll create the relevant entries in the file and maybe, one day, be updated to work without it.

You might want to take a look here

Integrations - Home Assistant (home-assistant.io)

These are the official integrations for presence detection. Some work by using your router to check what devices are on your network, others use GPS, others poll BLE devices etc. There are also the various phone apps for Home Assistant which will update using the phone’s location.

You’ll need to see what fits your purposes best. That probably depends on what you already have available (e.g. is there an integration for your router, do you already use an app).

1 Like

Very interesting (spider web of options) LoL

I just have a relatively new Router (TP-Link) that unfortunately doesn’t have an integration for HA.
So I just tried whatever google presented me, which is the “ping” platform and the home-assistant app for my phone.
Still looking for other ways, because I can’t expect all of my family members to install the app to be trackable.

Thanks for the link. Looking at bluetooth, IBeacon , Nmap.
Hope I can find one that picks up Mac adresses or names. If possible I would like to prevent giving devices a fixed IP address from the router.

Oh my… I find the nMap-tracker integration provides TONS of information about the devices on my network.
Home assistant had previously found a “Tuya_smart” device, which disabled because I didn’t know what device that could possibly be.
nMap shows it again and provides the last 3 numbers of the mac-address, from which I can trace it to be my vacuum cleaner robot. :slight_smile:

1 Like

nmap is great if your devices have a fixed MAC address, but a lot of phones don’t do that these days (to make tracking hard). Plus phones will turn off WiFi to save battery life.

Bluetooth is generally reliable, and I use monitor, which has an add-on version too, for that - but you can also use the built in Bluetooth LE tracker.