General question about automation and entities

Hy
I apologize in advance for my English, I am not French speaking…
I’m relatively new to the Home Assistant ecosystem; and I have a few questions that I haven’t found the answer to.
- Concerning automations, I only have access to a history of 2 days or 5 executions.
is there a way to access more history? for long term analysis this is really important…
- Regarding entities (sensors, binary_sensors…) is it possible to know (have a sort of summary) everything that uses a given entity? For example: sensor.something_mysensor is used in this script, this automation or in this template. This could be very useful when you want to change the name of an entity for example, or replace it.

Thanking you in advance!

Regarding history

RE entities yes it tracks what called an entity. Sometimes it’s a little esoteric…

But as to ‘change an entity’

Give your entities meaningful names. You won’t want to change them often - in fact, quite the opposite. if you replace a device you’ll want to change the new device to use the old entity id’s if they’re compatible - because if you’re using entities instead of devices to reference your automation… You just rename the new to match the old and everything just works no rewriting necessary.

Thank you for your reply.
Actually, that wasn’t exactly my question;
There were actually 2 differents questions.

-For automations, I would like to know if we can have access to an automation execution history older than 2 days. I only have access to 2 days of history when I would need to have access to an older history?

  • Regarding entities, my question was not about their history but about a more general question. The old home automation system I used allowed me to have a page or a kind of summary on which you could see at a glance wherever an entity (or a sensor…) was used. Is this kind of function possible on HA? For devices, on the summary page, you could see all the automations in which the device or an entity of the device is used, but what about a template sensor for example?

As I understand it, it’s better to use a device in an automation than directly the entities? I didn’t know that…

Thanks

The answer was in that link to History. It stores 10 days by default and had instructions how to change it.

No. For the reason already stated.

Ok, understood now.
And what about how to Know all the places where an entity is used ? Is it possible ?

Not really there’s no central registry.

HA notes what the caller was when a call is made but it doesn’t keep track of all the places you call from. That helps for scripts and the like but not for what I think you’re asking.

Instead, theres two good community integrations - Spook and Watchman that both can help you Identify in automations, dashboards and scripts when your referring to an entity that no longer exist. They work by scanning the various files and testing if the entity is ‘unknown’.

While both are great, neither is 100%. I have stuff spook misses that Watchtower sees and vice versa all the time - so I check both occasionally (usually when I sit to update HA to the current build.)

So I don’t think you’ll know ALL but you can have enough info for good maintenance.

So by using entity id’s instead of devices you can replace a device with impunity just rename new to match old. For the odd item you’re referring to that you miss, watchtower and Spook.

Ok.
Thank you for this detailed answer, which helps me a lot.
It’s a pity that there isn’t a central registry that can give all the scripts, automations or even yaml files in which an entity or device is used.
This came in very handy on my old home automation system!
Never mind, I’ll go ahead without…HA is so powerful that it’s easy to overlook some of its shortcomings!
Thanks for your time.

1 Like