Hope someone can help and give some ideas on a way I can do what I am trying to achieve
Basically I have a floorplan and on that plan I have home and away sensors (Using Samsung Presence Sensors) and these display home and away depending on sensor state which work perfectly. What I also want to do is display underneath the last time that person left or arrived home so that is says “Home since yesterday at 9:59 PM” for example.
Now I found some code and got it to work by using the “last_changed” attribute of the presence sensor/binary sensor and it does work perfectly and shows the correct time someone left or arrived back home. The problem is though that if I restart home assistant it also changes the last changed attribute and therefore throws off the time that I am trying to display.
Anyone have an idea of how I can get around this? In a perfect world restarting home assistant would not affect the last changed attribute but I don’t believe this is possible