App #8: Detect a particular sequence of events

To query the database you will need some SQL. You can create a sensor for InfluxDB like written in the chapter “sensor” of the below page.

Or query the db from AppDaemon directly by using the pymysql library like in this example: