Need to move to MariaDB.
This commit is contained in:
parent
5c68565758
commit
52097a9705
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue