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. #####################
|
### Building out some Historical stats for tweeting. #####################
|
||||||
sensor:
|
sensor:
|
||||||
|
|
||||||
- platform: sql
|
# - platform: sql
|
||||||
db_url: sqlite:///config/home-assistant_v2.db
|
# db_url: sqlite:///home-assistant_v2.db
|
||||||
queries:
|
# queries:
|
||||||
- name: "Solar 24h"
|
# - name: "Solar 24h"
|
||||||
column: 'solar_kwh'
|
# column: 'solar_kwh'
|
||||||
unit_of_measurement: 'kWh'
|
# unit_of_measurement: 'kWh'
|
||||||
query: >-
|
# query: >-
|
||||||
SELECT ROUND(SUM(solar_kwh), 2) AS solar_kwh
|
# SELECT ROUND(SUM(solar_kwh), 2) AS solar_kwh
|
||||||
FROM (
|
# FROM (
|
||||||
SELECT AVG(state) AS solar_kwh
|
# SELECT AVG(state) AS solar_kwh
|
||||||
FROM states
|
# FROM states
|
||||||
WHERE entity_id = 'sensor.solar_now'
|
# WHERE entity_id = 'sensor.solar_now'
|
||||||
AND state != 'unknown'
|
# AND state != 'unknown'
|
||||||
AND last_updated >= DATE_SUB(UTC_TIMESTAMP(), INTERVAL 24 HOUR)
|
# AND last_updated >= DATE_SUB(UTC_TIMESTAMP(), INTERVAL 24 HOUR)
|
||||||
GROUP BY HOUR(last_updated)
|
# GROUP BY HOUR(last_updated)
|
||||||
) AS total_kwh;
|
# ) AS total_kwh;
|
||||||
|
|
||||||
- platform: history_stats
|
- platform: history_stats
|
||||||
name: Doorbell Presses
|
name: Doorbell Presses
|
||||||
|
|
Loading…
Reference in New Issue