I was trying to wrap my head around this for quite some time, as the Default Value Local and Remote were not exposed in ZHA and I didn’t quite understand cluster commands. I was finally able to figure out what values I needed to enter to send the correct cluster command after playing with it a bit.
Sorry if any of this is obvious to others, still learning myself. Please let me know if you find any issues or have suggestions for improving my flow.
Attributes needed for call service “zha.set_zigbee_cluster_attribute”:
YAML:
service: zha.set_zigbee_cluster_attribute
data:
ieee: 04:0d:84:ff:fe:02:a8:d3
endpoint_id: 1
cluster_id: 64561
attribute: 13
manufacturer: "4655"
value: "255"
UI Mode:
Gotchas:
- You would need to change the IEEE to an IEEE from your own devices. This can be found on the device page, under Device info > Zigbee Info
- Set value from 1-254 for a brightness value and 255 for it to remember it’s last state, the default setting for this attribute.
I’m using this in node-red like this:
An example flow:
- Inject Node, repeats at a specific time of day, creates msg named value, and assign value to it:
- Change node, creates msg named IEEE, set to one of my switches IEEE value
- One output goes to a Call service node for local level and another to remote:
Example of Local level settings:
expression:
{"ieee":ieee,"cluster_id":64561,"attribute":13,"manufacturer":4655,"endpoint_id":1,"value":value}
- For the Remote value setting, it’s expression just needs it’s “attribute” value to be set to 14 instead of 13.
- I’m using the msg values “ieee” and “value” in the data expression, this way I only need two Call Service nodes rather then one for each light and time of day.
Full Flow Example:
[{"id":"6e39d33a2cfa1247","type":"inject","z":"c26113a3.aa95","name":"6 am","props":[{"p":"payload"},{"p":"value","v":"127","vt":"str"}],"repeat":"","crontab":"00 06 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":610,"y":1980,"wires":[["475ebc9924e017dd","7a24f33c6ed0f844"]]},{"id":"d2e31579605eeb2d","type":"api-call-service","z":"c26113a3.aa95","name":"Set Local","server":"d66b167d.4338d8","version":5,"debugenabled":false,"domain":"zha","service":"set_zigbee_cluster_attribute","areaId":[],"deviceId":[],"entityId":[],"data":"{\"ieee\":ieee,\"cluster_id\":64561,\"attribute\":13,\"manufacturer\":4655,\"endpoint_id\":1,\"value\":value}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1640,"y":2240,"wires":[[]]},{"id":"e9fd08db259dcc3c","type":"api-call-service","z":"c26113a3.aa95","name":"Set Remote","server":"d66b167d.4338d8","version":5,"debugenabled":false,"domain":"zha","service":"set_zigbee_cluster_attribute","areaId":[],"deviceId":[],"entityId":[],"data":"{\"ieee\":ieee,\"cluster_id\":64561,\"attribute\":14,\"manufacturer\":4655,\"endpoint_id\":1,\"value\":value}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1650,"y":2340,"wires":[[]]},{"id":"475ebc9924e017dd","type":"change","z":"c26113a3.aa95","name":"Office Main Lights","rules":[{"t":"set","p":"ieee","pt":"msg","to":"04:0d:84:ff:fe:02:a8:d3","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":930,"y":1940,"wires":[["4cd06a56a2b7e428"]]},{"id":"7a24f33c6ed0f844","type":"change","z":"c26113a3.aa95","name":"Living Room Lights","rules":[{"t":"set","p":"ieee","pt":"msg","to":"94:de:b8:ff:fe:f4:c0:4d","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":930,"y":2020,"wires":[["4cd06a56a2b7e428"]]},{"id":"69302902f67d96ce","type":"inject","z":"c26113a3.aa95","name":"4 pm","props":[{"p":"payload"},{"p":"value","v":"254","vt":"str"}],"repeat":"","crontab":"00 16 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":610,"y":2180,"wires":[["a2313ac7c712daa0","e69d00536e6465ce"]]},{"id":"a2313ac7c712daa0","type":"change","z":"c26113a3.aa95","name":"Office Main Lights","rules":[{"t":"set","p":"ieee","pt":"msg","to":"04:0d:84:ff:fe:02:a8:d3","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":910,"y":2140,"wires":[["2c21f4de242cc6a2"]]},{"id":"e69d00536e6465ce","type":"change","z":"c26113a3.aa95","name":"Living Room Lights","rules":[{"t":"set","p":"ieee","pt":"msg","to":"94:de:b8:ff:fe:f4:c0:4d","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":910,"y":2220,"wires":[["2c21f4de242cc6a2"]]},{"id":"9a36e40f5b513a7e","type":"inject","z":"c26113a3.aa95","name":"9 pm","props":[{"p":"payload"},{"p":"value","v":"35","vt":"str"}],"repeat":"","crontab":"00 21 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":610,"y":2380,"wires":[["23322a41d2596d58","8950273162bd1a12"]]},{"id":"23322a41d2596d58","type":"change","z":"c26113a3.aa95","name":"Office Main Lights","rules":[{"t":"set","p":"ieee","pt":"msg","to":"04:0d:84:ff:fe:02:a8:d3","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":910,"y":2340,"wires":[["81b2b3ece02a2a13"]]},{"id":"8950273162bd1a12","type":"change","z":"c26113a3.aa95","name":"Living Room Lights","rules":[{"t":"set","p":"ieee","pt":"msg","to":"94:de:b8:ff:fe:f4:c0:4d","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":910,"y":2420,"wires":[["81b2b3ece02a2a13"]]},{"id":"1f8a1b6ca72e5946","type":"inject","z":"c26113a3.aa95","name":"11 pm","props":[{"p":"payload"},{"p":"value","v":"1","vt":"str"}],"repeat":"","crontab":"00 23 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":620,"y":2580,"wires":[["9fecf9f6751712b7","5831e3ae3c7cb3af"]]},{"id":"9fecf9f6751712b7","type":"change","z":"c26113a3.aa95","name":"Office Main Lights","rules":[{"t":"set","p":"ieee","pt":"msg","to":"04:0d:84:ff:fe:02:a8:d3","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":910,"y":2540,"wires":[["5fc3088a59d37d7d"]]},{"id":"5831e3ae3c7cb3af","type":"change","z":"c26113a3.aa95","name":"Living Room Lights","rules":[{"t":"set","p":"ieee","pt":"msg","to":"94:de:b8:ff:fe:f4:c0:4d","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":910,"y":2620,"wires":[["5fc3088a59d37d7d"]]},{"id":"2e0bc4cdfb5d9a43","type":"comment","z":"c26113a3.aa95","name":"Most Lights","info":"","x":630,"y":1880,"wires":[]},{"id":"e40a7a6a37313ee0","type":"junction","z":"c26113a3.aa95","x":1240,"y":2280,"wires":[["cf257bc9c3e66217"]]},{"id":"4cd06a56a2b7e428","type":"junction","z":"c26113a3.aa95","x":1100,"y":1980,"wires":[["e40a7a6a37313ee0"]]},{"id":"2c21f4de242cc6a2","type":"junction","z":"c26113a3.aa95","x":1100,"y":2180,"wires":[["e40a7a6a37313ee0"]]},{"id":"81b2b3ece02a2a13","type":"junction","z":"c26113a3.aa95","x":1100,"y":2380,"wires":[["e40a7a6a37313ee0"]]},{"id":"5fc3088a59d37d7d","type":"junction","z":"c26113a3.aa95","x":1100,"y":2580,"wires":[["e40a7a6a37313ee0"]]},{"id":"cf257bc9c3e66217","type":"junction","z":"c26113a3.aa95","x":1440,"y":2280,"wires":[["d2e31579605eeb2d","e9fd08db259dcc3c"]]},{"id":"d66b167d.4338d8","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]```