What is the easiest/best way to switch a device on/off based on how long a device has been on (running) for during the current day (since 00 hours) or the last 7 days?
I have been the time at which the device is turned on and off in SQLite. I have had great difficulties determining the required queries to find the required information. I figure this must be something that many people want to do, so hopefully there is a node or example I can work from.
Any help would be appreciated.