-
Notifications
You must be signed in to change notification settings - Fork 36
/
script_read_basic_cluster.yaml
49 lines (49 loc) · 1.36 KB
/
script_read_basic_cluster.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
---
alias: Read Basic Cluster
description:
Read main attributes of cluster to CSV file and 'sensor.basic_cluster'
state.
fields:
entity_name:
name: entity_name
description: A Zigbee Entity (all entities of the device resolve to the same address)
required: true
selector:
entity:
integration: zha
csv:
name: csv
description: >-
Csv filename '../www/basic.csv' can be downloaded from
YOURINSTANCEURL/local/basic.csv .
example: ../www/basic.csv
required: true
selector:
text:
sequence:
- repeat:
count: "7"
sequence:
- variables:
current: "{{ ( repeat.index - 1 ) }}"
- service: system_log.write
data:
logger: entity_name.read_basic_cluster_script
level: warning
message: "{{ 'Read Attribute %u' % (repeat.index, ) }}"
- service: zha_toolkit.attr_read
data:
ieee: "{{ entity_name }}"
cluster: 0
attribute: "{{ current }}"
tries: 3
state_id: sensor.basic_cluster
state_attr: '{{ "%s%04X" % (entity_name, current|int) }}'
allow_create: true
csvout: "{{ csv }}"
- service: system_log.write
data:
logger: entity_name.basic_cluster_read
level: warning
message: Basic cluster read done
mode: restart