-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathupdate_icon_openweathermap_day.yaml
94 lines (88 loc) · 2.43 KB
/
update_icon_openweathermap_day.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
89
90
91
92
93
94
blueprint:
name: thermostat icon update via Openweathermap weather conditions codes, day time period.
description: Change thermostat icon when weather condition code changes. Your Openweathermap icon code source should be set correctly for your location. You need one automation for day time and one for night time. You also need to install integration sun.
domain: automation
source_url: https://github.com/claudegel/sinope-zha/tree/master/automation/blueprints/update_icon_openweathermap_day.yaml
input:
weather_entity:
name: Your City Weather Icon Code source
description: Entity ID of the weather icon code sensor
selector:
entity:
domain: sensor
condition_entity:
name: sun
selector:
entity: sun
domain: sun
climate_target:
name: Thermostat_ieee
description: Target thermostat entity
selector:
target:
entity:
domain: climate
# If weather code change we update the thermostat,
mode: single
triggers:
- trigger: state
entity_id: !input weather_entity
- trigger: sun
event: sunrise
offset: "00:30:00"
variables:
weather_change:
"200": Cloudrainsun2
"201": Cloudlightning
"202": Cloudlightning
"211": Cloudrainsun2
"212": Cloudrainsun2
"300": Cloud3
"301": Cloud3
"311": Cloud3
"500": Cloudrainsun
"501": Cloudrainsun3
"502": Cloudrainsun4
"504": Cloudrain3
"511": Cloudlightning2
"520": Cloudrain
"521": Cloudrain2
"522": Cloudrain3
"600": Cloudsnow2
"601": Cloudsnow4
"602": Cloudsnow3
"613": Cloud
"615": Cloud
"616": Cloud
"621": Cloudsnow3
"622": Cloudsnow5
"701": Cloudfog
"711": Cloudfog
"721": Cloudfog
"731": Cloudfog
"741": Cloudfog
"751": Cloudfog
"761": Cloudfog
"800": Sun
"801": Sun2
"802": Cloudsun
"803": Cloudsun2
"804": Cloud2
thermostats:
- !input climate_target
conditions:
- condition: state
entity_id: !input condition_entity
state: "above_horizon"
actions:
- repeat:
count: "{{thermostats|length}}"
sequence:
- action: zha.set_zigbee_cluster_attribute
data:
cluster_type: in
ieee: "{{ thermostats[repeat.index-1] }}"
endpoint_id: 1
cluster_id: 0xff01
attribute: 0x0013
value: "{{ weather_change.get(states(!input weather_entity), 'Hide') }}"