Need to move to MariaDB.

This commit is contained in:
ccostan 2018-03-25 12:35:32 -04:00
parent 5c68565758
commit 52097a9705
1 changed files with 16 additions and 16 deletions

View File

@ -23,22 +23,22 @@ notify:
### Building out some Historical stats for tweeting. #####################
sensor:
- platform: sql
db_url: sqlite:///config/home-assistant_v2.db
queries:
- name: "Solar 24h"
column: 'solar_kwh'
unit_of_measurement: 'kWh'
query: >-
SELECT ROUND(SUM(solar_kwh), 2) AS solar_kwh
FROM (
SELECT AVG(state) AS solar_kwh
FROM states
WHERE entity_id = 'sensor.solar_now'
AND state != 'unknown'
AND last_updated >= DATE_SUB(UTC_TIMESTAMP(), INTERVAL 24 HOUR)
GROUP BY HOUR(last_updated)
) AS total_kwh;
# - platform: sql
# db_url: sqlite:///home-assistant_v2.db
# queries:
# - name: "Solar 24h"
# column: 'solar_kwh'
# unit_of_measurement: 'kWh'
# query: >-
# SELECT ROUND(SUM(solar_kwh), 2) AS solar_kwh
# FROM (
# SELECT AVG(state) AS solar_kwh
# FROM states
# WHERE entity_id = 'sensor.solar_now'
# AND state != 'unknown'
# AND last_updated >= DATE_SUB(UTC_TIMESTAMP(), INTERVAL 24 HOUR)
# GROUP BY HOUR(last_updated)
# ) AS total_kwh;
- platform: history_stats
name: Doorbell Presses