Mohlsson / ReplayLightsHistory

AppDaemon App for Home Assistant to replay light switch history when no one is home.
Apache License 2.0
29 stars 5 forks source link

DB changes kill this code #15

Closed 0n3man closed 3 years ago

0n3man commented 4 years ago

I did an update to the lastest HA version yesterday and noticed that nothing was being schedule any longer. Turns out the data this tool uses from the HA database was being replicated in two locations, the events and states tables. At some recent version the HA team decided to remove the redundant data. They removed the information from the events table, which is the table ReplayLightsHistory was using. The data now needs to be pulled from the states table. I've modified the code to address this and will submit a pull request shortly.

Mohlsson commented 4 years ago

Thank you Brian, I'm travelling at the moment but will be back in another two weeks so I can't do any coding but I can still accept pull request. Alternatively I can add you as a collaborator, as you have contributed so much, if you like so you have full access to the repo.

0n3man commented 4 years ago

I submitted the pull request. It would be idea if you could get the individual that added the MariaDB changes to test it on their system. While I think the change I made should work with either sqlite3 or MariaDB, it'd be good to get that verified. The note I added to the readme is to address the outstanding issue "Unexpected error loading module".

slesinger commented 4 years ago

I am testing with MySQL now. From the first run I can see scheduling is being done. Looks good. There is blog post about the HA change here: https://www.home-assistant.io/blog/2020/07/01/release-112/