Using ZHA the melody attribute is not exposed. I have found it under clusters - TuyaMCUSiren - melody (id: 0x0466).
I then clicked Read Attribute and it returns a value of NeoAlarmMelody.melody_05.
I changed this to
NeoAlarmMelody.melody_01
and then clicked Write Attribute
Succeeds with a green tick
But the siren melody does not change
Is there something else I need to do?
I have never set a cluster attribute for a ZHA device before.
Hi, do you change the melody under âvalueâ or under âManufacture Code Overrideâ?
i also have a âTuyaMCUSirenâ with the same id 0x0466 and it is working when i cange the paramter under âvalueâ.
i tried it some hours with the âManufacture Code Overrideâ and it also gives me a green tick⊠but it was not working
I tried changing value as well.
What did you put in the value field? An integer like 3 or 4 or 5
Or something else
yes, i just changed the 05 to 04, 03 and so onâŠ
default was:
NeoAlarmMelody.melody_05
changed to:
NeoAlarmMelody.melody_06
and clicked: âwrite attributeâ
So if you are interested in this topic, there is a way to change Tuya settings on the fly. There is a service âzha.set_zigbee_cluster_attributeâ that is very useful. What you need is the Tuya ieee, the end point, the cluster id, and the attribute id. All you can find by going to
- âSettingsâ â âDevices and Servicesâ, clicking on âZigbee Home Automationâ.
- Then click on âx Devicesâ (x depends on the number of devices you have) and
- from the resulting list selecting your Tuya device.
Click on the little down-arrow next to âZigbee infoâ and presto: you have your IEEE. Copy that.
- Click pin the three dots in the âDevice Infoâ box
- Choose âManage Zigbee deviceâ option.
- Click on the âClustersâ list, choose âTuyaMCUsirenâ.
You now have your cluster-id and end point next to âTuyaMCUsirenâ. Cop that. They are in hexadecimal so you need to convert to decimal (lots of websites will do that for you).
Weâre close now, just need the arrtibute id.
- Click on âAttributes of the selected clusterâ and you see what you can set.
Thereâs volume, melody and alarm_duraction. Copy their idâs (in the drop down list) and convert to decimal.
Once you have all that, the service is (with my data):
- service: zha.set_zigbee_cluster_attribute
data:
cluster_type: in
ieee: a4:c1:38:2a:ed:24:14:9c # Yours WILL be different, use yours
endpoint_id: 1 # (probably right but yours may differ)
cluster_id: 6. # (probably right but yours may differ)
attribute: 1126 # (probably right but yours may differ)
value: 6 # melodies 1 to 16 - try them out yourself (10 is dog barking)
A nice way to do this is to make a script, get into YAML mode, delete whatâs there and paste the below (adapt as needed). Then try using it in an automation ⊠too easy really
SCRIPT YAML:
alias: Sound siren
fields:
siren:
description: Siren sound
selector:
select:
options:
- label: warning
value: '8'
- label: pending
value: '16'
- label: alarm
value: '6'
- label: alarm2
value: '11'
- label: dog
value: '10'
name: Siren
default: warning
required: true
volume:
description: Siren volume
name: Volume
default: low
required: true
selector:
select:
options:
- label: low
value: '0'
- label: medium
value: '1'
- label: high
value: '2'
duration:
description: Siren duration (s)
name: Duration
default: 10
required: true
selector:
number:
mode: box
unit_of_measurement: seconds
min: 1
max: 59
sequence:
- service: zha.set_zigbee_cluster_attribute
data:
cluster_type: in
ieee: a4:c1:38:2a:ed:24:14:9c
endpoint_id: 1
cluster_id: 6
attribute: 1126
value: "{{ siren }}"
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 30
- service: zha.set_zigbee_cluster_attribute
data:
cluster_type: in
ieee: a4:c1:38:2a:ed:24:14:9c
endpoint_id: 1
cluster_id: 6
attribute: 1140
value: "{{ volume }}"
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 30
- service: zha.set_zigbee_cluster_attribute
data:
cluster_type: in
ieee: a4:c1:38:2a:ed:24:14:9c
endpoint_id: 1
cluster_id: 6
attribute: 615
value: "{{ duration }}"
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
- service: switch.turn_on
data: {}
target:
entity_id:
- switch.alarm_siren_group
- switch.indoor_siren_switch
mode: single
icon: mdi:bugle