Machine learning for presence detection

Hi,

I am looking at writing a program that is able to determine if someone is home or not. I have concluded the current presence detection in home-assistant is a little unreliable.

My thinking here is to use various inputs from device trackers, sensors, time of day etc fed into a simple tensor flow model to determine if someone is actually home or not.

I would like to build some training data by gathering the sates of every entity in home assistant. Is there an easy way I can do this ? I.e. Take a snapshot of all the states at 1min intervals ?

Thanks

Checkout this thread. You can query the database directly.