-
Notifications
You must be signed in to change notification settings - Fork 0
/
configuration.yaml
88 lines (81 loc) · 3.35 KB
/
configuration.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Loads default set of integrations. Do not remove.
default_config:
# Text to speech
tts:
- platform: google_translate
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
nordpool:
sensor:
- platform: nordpool
currency: "NOK"
region: "Tr.heim"
additional_costs: '{% set s = {
"night": 0.0787,
"day": 0.1574
}
%}
{% if now().hour >=6 and now().hour <23 %}
{{s.day|float}}
{% else %}
{{s.night|float}}
{% endif %}'
- platform: template
sensors:
elspot_daily_avg:
value_template: >
{{ state_attr("sensor.electricity_price_stadsing_dahls_gate_12", "avg_price") }}
unit_of_measurement: "NOK/kWh"
friendly_name: Daily spotprice average
thermostat:
value_template: >
{% set mean=state_attr('sensor.nordpool_kwh_trheim_nok_3_10_025', 'average') %}
{% set min=state_attr('sensor.nordpool_kwh_trheim_nok_3_10_025', 'min') %}
{% set curr=state_attr('sensor.nordpool_kwh_trheim_nok_3_10_025', 'current_price') %}
{% set denom = (mean-min) if mean != min else 1 %}
{{ ((states('input_number.onsket_temperatur') | float + 2) - 2*(curr-min)/denom) | round(1) }}
unit_of_measurement: "C"
friendly_name: Thermostat set point
binary_sensor:
- platform: template
sensors:
nordpool_cheapest_4_hours:
value_template: >-
{% set l=state_attr('sensor.nordpool_kwh_trheim_nok_3_10_025', 'raw_today')|sort(attribute='value') %}
{{ (now() >= l[0].start and now() <= l[0].end)
or (now() >= l[1].start and now() <= l[1].end)
or (now() >= l[2].start and now() <= l[2].end)
or (now() >= l[3].start and now() <= l[3].end) }}
nordpool_cheapest_8_hours:
value_template: >-
{% set l=state_attr('sensor.nordpool_kwh_trheim_nok_3_10_025', 'raw_today')|sort(attribute='value') %}
{{ (now() >= l[0].start and now() <= l[0].end)
or (now() >= l[1].start and now() <= l[1].end)
or (now() >= l[2].start and now() <= l[2].end)
or (now() >= l[3].start and now() <= l[3].end)
or (now() >= l[4].start and now() <= l[4].end)
or (now() >= l[5].start and now() <= l[5].end)
or (now() >= l[6].start and now() <= l[6].end)
or (now() >= l[7].start and now() <= l[7].end) }}
nordpool_cheapest_12_hours:
value_template: >-
{% set l=state_attr('sensor.nordpool_kwh_trheim_nok_3_10_025', 'raw_today')|sort(attribute='value') %}
{{ (now() >= l[0].start and now() <= l[0].end)
or (now() >= l[1].start and now() <= l[1].end)
or (now() >= l[2].start and now() <= l[2].end)
or (now() >= l[3].start and now() <= l[3].end)
or (now() >= l[4].start and now() <= l[4].end)
or (now() >= l[5].start and now() <= l[5].end)
or (now() >= l[6].start and now() <= l[6].end)
or (now() >= l[7].start and now() <= l[7].end)
or (now() >= l[8].start and now() <= l[8].end)
or (now() >= l[9].start and now() <= l[9].end)
or (now() >= l[10].start and now() <= l[10].end)
or (now() >= l[11].start and now() <= l[11].end) }}
proximity:
home:
devices:
- device_tracker.sm_g986b
tolerance: 50
unit_of_measurement: km