I have been looking everywhere, but maybe not good enough. For a simple way to temporarily override my automations, I want to have a switch on the Lovelace UI to toggle my guest “person” home or away.
Seems simple, but I can’t seem to find anything useful.
I’ve got it working! It might be a little rough around the edges, but it works.
Step 1:
Go to your known_devices.yaml and create a new “fake” device tracker. Just copy one of your other ones for the format and create a new one with a unique MAC adress.
Step 2:
Make a new card in Lovelace, like this one: (with your own tracker details of course)
Did you find a good solution for this? I would also like to have a simple toggle to set my home to “home” or “away” mode. It’s very common in other apps / systems like SmartThings. The way our home operates its best to have a simple manual toggle for most of our use cases for now.
Device trackers and input booleans are different. However, you can make one that will control the other.
Also, for those concerned about the lack of known_devices.yaml, there’s no need to create a fake device tracker anymore. When you call the service device_tracker.see, it will create the device tracker if it isn’t there. Here’s my solution for a Guest boolean and device tracker:
alias: Guest device tracker
description: ''
trigger:
- platform: state
entity_id: input_boolean.guest
condition: []
action:
- service: device_tracker.see
data:
dev_id: guest
location_name: |-
{% if is_state('input_boolean.guest', 'on') -%}
home
{%- else -%}
not_home
{%- endif %}
mode: single
Then, I created a user (that can’t log in) called Guest, assigned device_tracker.guest to it, and created a group with myself and guest:
group:
someone_home:
name: Someone home
entities:
- person.brent
- person.guest
Now group.someone_home is a single source of whether myself or a guest is at my house.
Since I use my own presence detection (by using a BLE scanner coupled with BLE beacon in our cars, over MQTT, with customized FW to handle changing UUIDs for security), I just force the person state into whatever I need by using an external Python script. There are several out there, something like that:
This is probably going to fail in horrible ways if you combine it with an actual HA device tracker. But since I don’t use any, it works like a charm for me.
Hi, I copied that solution but device_tracker.see still creates a known_devices.yaml where the track parameter of the created deveice I have to set to true. After restart, the entity is available.
Is that right? And what happens, if the known_devices file is depricated one time?