@
Aikon Denk nog een flaw erin zo. Want je lockt
het nu niet op de eerste keer
heter dan. Als nu de temperatuur weer lager zakt en weet
heten wordt dan oversc
hrijf je de input_datetime. Vandaar dat ik timestamp == 1 als 'nog niet gebeurd' state gebruikte.
Dat erin krijg je:
YAML:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
| alias: DHW >64'C > datetime_sterilization
description: ""
trigger:
- platform: numeric_state
entity_id: sensor.hp_dhw_temp
above: 64
condition:
- condition: not
conditions:
- condition: state
entity_id: input_datetime.datetime_sterilization
state: "1"
attribute: timestamp
action:
- service: input_datetime.set_datetime
data:
datetime: "{{ now() }}"
target:
entity_id: input_datetime.datetime_sterilization
mode: single |
En:
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
| alias: DHW + Sterilization 10 days
description: ""
trigger:
- platform: time
at: "11:00:00"
condition:
- condition: numeric_state
entity_id: sensor.hp_heatpump_state
above: 0
- condition: numeric_state
entity_id: sensor.hp_operating_mode_state
below: 1
- condition: numeric_state
entity_id: sensor.hp_dhw_temp
below: 37
action:
- if:
- condition: template
value_template: >-
{{ state_attr('input_datetime.datetime_sterilization', 'timestamp') !=
1 }}
- condition: template
value_template: >-
{{ now() - state_attr('input_datetime.datetime_sterilization',
'timestamp')|as_datetime >
timedelta(days=10) }}
then:
- service: switch.turn_on
data: {}
target:
entity_id: switch.hp_heishamon_setoperationmode
- delay:
hours: 0
minutes: 0
seconds: 30
milliseconds: 0
- service: switch.turn_on
data: {}
target:
entity_id: switch.hp_heishamon_setforcesterilization
else:
- service: switch.turn_on
data: {}
target:
entity_id: switch.hp_heishamon_setoperationmode
- delay:
hours: 0
minutes: 15
seconds: 0
milliseconds: 0
- if:
- condition: numeric_state
entity_id: sensor.hp_dhw_energy_consumption
below: 10
then:
- service: switch.turn_off
data: {}
target:
entity_id: switch.hp_heishamon_setoperationmode
- service: input_datetime.set_datetime
data:
timestamp: 1
target:
entity_id: input_datetime.datetime_sterilization
mode: single |
Wel zou ik zelf de delay van 15 minuten vervangen door een timer. Als je nu
HA
herstart of de automations
herlaad (dat gebeurd ook bij een edit van een van je automations) dan worden alle lopende automations gestopt en zal dus zal
het niet uitsc
hakelen.
Ook dat
het
hele uitsc
hakelen in een tweede if staat lijkt me niet zo
handig. En wat als '
hp_d
hw_energy_consumption' nog niet onder de 10 watt is gezakt aan
het einde? En wat zet 'switc
h.
hp_
heis
hamon_setforcesterilization' weer uit?