How would I make a sensor that stores the text of an attribute of another entity every time it changes? Also could I then log the history of that entity? It’s a device tracker entity created by the life360 Integration.
How do I use the template sensor to do that?
Something like this:
template:
- sensor:
- name: "Some unknown attribute"
unit_of_measurement: "Unknown"
state: "{{ state_attr('sensor.life360', 'unknown_attribute') }}"
But as always, it’s a lot easier to help when you are more specific
So the first thing listed is the device name and the second is the attribute I’m trying to use? So like this?
template:
- sensor:
- name: "location"
unit_of_measurement: "unknown"
state: "{{state_attr('device_tracker.person', 'Place')}}"
Or do I have to put something in the unknown thing for unit of measurement?
You can just delete that line if you don’t need it.
Oh ok. I thought it was some syntax thingymabober
Also do I stick this in the config file or is this a separate thing?
Depends on how your files are set up. But since you ask, I assume you have not split your config files.
So place it in configuration.yaml.
Just make sure you only have one line with template:
or you will get an error.
Gotcha
template:
- sensor:
- name: "location"
state: "{{state_attr('device_tracker.person', 'Place')}}"
Does the Life360 device thing need to change for It to be the correct state? Because it just says unknown now.
The entity says this entity does not have a unique I’d therefore it’s settings cannot be managed from the UI, does that mean I can’t use it’s name for this and is that why it’s not working
because you used “Place” instead of “place”. Case matters.
That’s because it wasn’t configured thru the UI or that the integration that created the entity didn’t provide a unique id. The reason for that is because YOU created the entity yourself.
That was actually created by life360 but I actually figured out I misinterpreted what you said when u said to only use the template domain once, I thought I meant make sure I don’t have template indented two spaces after template not that all entities need to be configured under one template. Also the capital letter thing lol. Which is weird bc place is capitalized in the attribute thing. Thank you though this makes stuff way easier.
Mine isn’t so I doubt yours is either.
They love them capitol letters in mine lol
You’re not looking in the developer tools.
You’re looking at the integration?
Yeah, I have no idea where he is looking to see that.
But for someone who has been here for a year it seems that you are asking for help with, and are confused about, some of the most basic things in HA.