-
Notifications
You must be signed in to change notification settings - Fork 1
/
d1.2.yaml
41 lines (41 loc) · 1.14 KB
/
d1.2.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
template:
- sensor:
- name: "D1.2 Inflow"
unit_of_measurement: "USD/kWh"
device_class: monetary
state: >
{% set month = now().month %}
{% set hour = now().hour %}
{% if month in [11, 12, 1, 2, 3, 4, 5] %}
{% if hour >= 11 and hour < 19 %}
0.234531
{% else %}
0.144221
{% endif %}
{% elif month in [6, 7, 8, 9, 10] %}
{% if hour >= 11 and hour < 19 %}
0.261451
{% else %}
0.146501
{% endif %}
{% endif %}
- sensor:
- name: "D1.2 Outflow"
unit_of_measurement: "USD/kWh"
device_class: monetary
state: >
{% set month = now().month %}
{% set hour = now().hour %}
{% if month in [11, 12, 1, 2, 3, 4, 5] %}
{% if hour >= 11 and hour < 19 %}
0.1321
{% else %}
0.05059
{% endif %}
{% elif month in [6, 7, 8, 9, 10] %}
{% if hour >= 11 and hour < 19 %}
0.15369
{% else %}
0.05265
{% endif %}
{% endif %}