Ik heb zelf deze oplossing in mijn HA:
Daarvoor heb ik via de UI de volgende helpers (Configuration > Automations & Scenes > Helpers) aangemaakt:
Waarbij de
input_datetime.wekker als type 'Time' heeft.
Vervolgens een automation gemaakt die mijn "Zet de radio aan" automation triggert (ook via de UI gedaan, maar hier is de YML output van de configuratie):
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
| alias: Wekker
description: ''
trigger:
- platform: time
at: input_datetime.wekker
id: wekker_time
condition:
- condition: and
conditions:
- condition: state
entity_id: input_boolean.wekker
state: 'on'
- condition: or
conditions:
- condition: and
conditions:
- condition: state
entity_id: input_boolean.wekker_maandag
state: 'on'
- condition: template
value_template: '{{ now().isoweekday() == 1 }}'
- condition: and
conditions:
- condition: state
entity_id: input_boolean.wekker_dinsdag
state: 'on'
- condition: template
value_template: '{{ now().isoweekday() == 2 }}'
- condition: and
conditions:
- condition: state
entity_id: input_boolean.wekker_woensdag
state: 'on'
- condition: template
value_template: '{{ now().isoweekday() == 3 }}'
- condition: and
conditions:
- condition: state
entity_id: input_boolean.wekker_donderdag
state: 'on'
- condition: template
value_template: '{{ now().isoweekday() == 4 }}'
- condition: and
conditions:
- condition: state
entity_id: input_boolean.wekker_vrijdag
state: 'on'
- condition: template
value_template: '{{ now().isoweekday() == 5 }}'
- condition: and
conditions:
- condition: state
entity_id: input_boolean.wekker_zaterdag
state: 'on'
- condition: template
value_template: '{{ now().isoweekday() == 6 }}'
- condition: and
conditions:
- condition: state
entity_id: input_boolean.wekker_zondag
state: 'on'
- condition: template
value_template: '{{ now().isoweekday() == 7 }}'
action:
- service: automation.trigger
target:
entity_id: automation.zet_de_radio_aan
data:
skip_condition: false
mode: single |
Hopelijk heb je er wat aan
[
Voor 0% gewijzigd door
Septillion op 03-05-2022 23:02
. Reden: yaml code tags ]