-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsensor_pge.yaml
68 lines (67 loc) · 2.46 KB
/
sensor_pge.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Uncomment and include the following line in configuration.yaml:
# sensor more: !include sensors_pge.yaml
- platform: influxdb
api_version: 2
ssl: false
host: !secret influxdb2_ip
port: !secret influxdb2_port
organization: !secret influxdb2_org_id_number_not_name
token: !secret influxdb2_homeassistant_token
bucket: !secret influxdb2_pge_usage_bucket
queries_flux:
- name: "pge_elec_hourly_usage"
range_start: "-3d"
range_stop: "now()"
group_function: last
query: >
filter(fn: (r) => r["_measurement"] == "pge_elec_hourly_meas")
|> filter(fn: (r) => r["_field"] == "elec_usage_kWh")
- name: "pge_weather_hourly_temp"
range_start: "-3d"
range_stop: "now()"
group_function: last
query: >
filter(fn: (r) => r["_measurement"] == "pge_elec_hourly_meas")
|> filter(fn: (r) => r["_field"] == "weather_temp")
- name: "pge_elec_daily_usage"
range_start: "-3d"
range_stop: "now()"
group_function: last
query: >
filter(fn: (r) => r["_measurement"] == "pge_elec_gas_daily_meas")
|> filter(fn: (r) => r["_field"] == "elec_usage_kWh")
- name: "pge_gas_daily_usage"
range_start: "-3d"
range_stop: "now()"
group_function: last
query: >
filter(fn: (r) => r["_measurement"] == "pge_elec_gas_daily_meas")
|> filter(fn: (r) => r["_field"] == "gas_usage_therms")
- name: "pge_combined_daily_usage"
range_start: "-3d"
range_stop: "now()"
group_function: last
query: >
filter(fn: (r) => r["_measurement"] == "pge_elec_gas_daily_meas")
|> filter(fn: (r) => r["_field"] == "combined_usage_units")
- name: "pge_weather_daily_temp_avg"
range_start: "-3d"
range_stop: "now()"
group_function: last
query: >
filter(fn: (r) => r["_measurement"] == "pge_elec_gas_daily_meas")
|> filter(fn: (r) => r["_field"] == "weather_temp_avg")
- name: "pge_weather_daily_temp_hi"
range_start: "-3d"
range_stop: "now()"
group_function: last
query: >
filter(fn: (r) => r["_measurement"] == "pge_elec_gas_daily_meas")
|> filter(fn: (r) => r["_field"] == "weather_temp_hi")
- name: "pge_weather_daily_temp_lo"
range_start: "-3d"
range_stop: "now()"
group_function: last
query: >
filter(fn: (r) => r["_measurement"] == "pge_elec_gas_daily_meas")
|> filter(fn: (r) => r["_field"] == "weather_temp_lo")