I changed zha_toolkit so that by default it should let the quirk automatically set the manufacturer code.
Arg⊠canât attach a .txt fileâŠ
I am surprised only images are allowed - you can add an issue/discussion on github - they allow more file types.
But all that is really needed is the manufacturer id - I checked one of my scans: the manufacturer id is not mentionned, I checked the device information provided in ZHA, the manufacturer ID is not provided ⊠.
So, Iâll make some updates to zha-toolkit for that as well.
In the mean time, just try the last version like this:
service: zha_toolkit.attr_write
data:
ieee: 54:0f:57:ff:fe:7f:e9:29
cluster: 6
attribute: 0x8002
attr_type: 0x30
attr_val: 1
and probably this works as well (because the endpoint and the attr_type and the manufacturer id should be detected eiher in zha-toolkit or the quirk):
service: zha_toolkit.attr_write
data:
ieee: 54:0f:57:ff:fe:7f:e9:29
cluster: 6
attribute: 0x8002
attr_val: 1
P.S.: I just updated âzha_toolkit.scan_deviceâ and it seems that I also have the 0x8002 attribute on one of them - even though itâs something specific to the manufacturer, the manufacturer id should be be set in my case, so the provided examples above should work.
FYI, I prefer mentioning the entity name rather than the IEEE address which is harder to ge (scan example):
service: zha_toolkit.scan_device
data:
ieee: button.sonoff_01minizb_3f25c224_identify
Hi,
Thx again for trying to help out.
My last try was this one:
No matter what I try, when I try to write I get the same error:
AttributeError("âNoneTypeâ object has no attribute âserializeâ"
2022-02-28 08:41:08 INFO (MainThread) [custom_components.zha_toolkit] Running ZHA Toolkit service: <ServiceCall zha_toolkit.attr_write (c:aa26c934a1966db347494932352b018f): ieee=button.st_droogkast_identify, cluster=6, attribute=32770, attr_type=48, attr_val=1>
2022-02-28 08:41:08 DEBUG (MainThread) [custom_components.zha_toolkit] module is <module âcustom_components.zha_toolkitâ from â/config/custom_components/zha_toolkit/init.pyâ>
2022-02-28 08:41:08 DEBUG (MainThread) [custom_components.zha_toolkit.utils] Parameters â{âieeeâ: âbutton.st_droogkast_identifyâ, âclusterâ: 6, âattributeâ: 32770, âattr_typeâ: 48, âattr_valâ: 1}â
2022-02-28 08:41:08 DEBUG (MainThread) [custom_components.zha_toolkit.utils] registry_entity RegistryEntry(entity_id=âbutton.st_droogkast_identifyâ, unique_id=â54:0f:57:ff:fe:7f:e9:29-1-3â, platform=âzhaâ, area_id=None, capabilities=None, config_entry_id=âf44ffad5582b24ea67bc482e01e785edâ, device_class=âupdateâ, device_id=âfc557ccb7df951f7d5f27bc79a1e45abâ, disabled_by=None, entity_category=<EntityCategory.DIAGNOSTIC: âdiagnosticâ>, icon=None, id=âe4e9542aa2f4aca81977749f5410bc87â, name=None, options={}, original_device_class=âupdateâ, original_icon=None, original_name=â_TZ3000_u5u4cakc TS011F 29e97ffe identifyâ, supported_features=0, unit_of_measurement=None)
2022-02-28 08:41:08 DEBUG (MainThread) [custom_components.zha_toolkit.utils] registry_device DeviceEntry(area_id=âbergingâ, config_entries={âf44ffad5582b24ea67bc482e01e785edâ}, configuration_url=None, connections={(âzigbeeâ, â54:0f:57:ff:fe:7f:e9:29â)}, disabled_by=None, entry_type=None, id=âfc557ccb7df951f7d5f27bc79a1e45abâ, identifiers={(âzhaâ, â54:0f:57:ff:fe:7f:e9:29â)}, manufacturer=â_TZ3000_u5u4cakcâ, model=âTS011Fâ, name_by_user=âstopcontact droogkastâ, name=â_TZ3000_u5u4cakc TS011Fâ, suggested_area=None, sw_version=None, hw_version=None, via_device_id=â05a0302d82a5f9732a855fa9e7a6b2c4â, is_new=False)
2022-02-28 08:41:08 DEBUG (MainThread) [custom_components.zha_toolkit] Key <custom_components.zha_toolkit.params.INTERNAL_PARAMS_consts object at 0x7fc2ab785c40>
2022-02-28 08:41:08 DEBUG (MainThread) [custom_components.zha_toolkit.utils] Type recognition for â<class âzigpy_deconz.zigbee.application.ControllerApplicationâ>â not implemented
2022-02-28 08:41:08 DEBUG (MainThread) [custom_components.zha_toolkit] âieeeâ parameter: âbutton.st_droogkast_identifyâ â IEEE Addr: â54:0f:57:ff:fe:7f:e9:29â
2022-02-28 08:41:08 DEBUG (MainThread) [custom_components.zha_toolkit] Default handler for attr_write
2022-02-28 08:41:08 DEBUG (MainThread) [custom_components.zha_toolkit] Handler: <function command_handler_default at 0x7fc251c293a0>
2022-02-28 08:41:08 DEBUG (MainThread) [custom_components.zha_toolkit] running default command: <ServiceCall zha_toolkit.attr_write (c:aa26c934a1966db347494932352b018f): ieee=button.st_droogkast_identify, cluster=6, attribute=32770, attr_type=48, attr_val=1>
2022-02-28 08:41:08 DEBUG (MainThread) [custom_components.zha_toolkit.default] Trying to import custom_components.zha_toolkit.zcl_attr to call attr_write
2022-02-28 08:41:08 DEBUG (MainThread) [custom_components.zha_toolkit.utils] Endpoint 1 found for cluster â6â
2022-02-28 08:41:08 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Request attr read [32770]
2022-02-28 08:41:08 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Reading attr result (attrs, status): ({32770: <PowerOnState.Off: 0>}, {})
2022-02-28 08:41:08 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Request attr write [Attribute(attrid=32770, value=)]
2022-02-28 08:41:08 DEBUG (MainThread) [custom_components.zha_toolkit] event_data {âzha_toolkit_versionâ: âv0.7.21â, âzigpy_versionâ: â0.43.0â, âzigpy_rf_versionâ: None, âieee_orgâ: âbutton.st_droogkast_identifyâ, âieeeâ: â54:0f:57:ff:fe:7f:e9:29â, âcommandâ: None, âcommand_dataâ: None, âstart_timeâ: â2022-02-28T07:41:08.489814+00:00â, âerrorsâ: [âAttributeError("âNoneTypeâ object has no attribute âserializeâ")â], âparamsâ: {âcluster_idâ: 6, âattr_idâ: 32770, âattr_typeâ: 48, âattr_valâ: 1, âdirâ: 0, âtriesâ: 1, âexpect_replyâ: True, âargsâ: [], âread_before_writeâ: True, âread_after_writeâ: True}, âcompare_valâ: 1, âwrite_is_equalâ: False, âread_beforeâ: ({32770: <PowerOnState.Off: 0>}, {}), âsuccessâ: False}
Reading the same attribute works a charmâŠ
2022-02-28 09:53:25 INFO (MainThread) [custom_components.zha_toolkit] Running ZHA Toolkit service: <ServiceCall zha_toolkit.attr_read (c:8e9a7ee24d4819dd822a08c761d6586e): ieee=button.st_droogkast_identify, cluster=6, attribute=32770, attr_type=48, manufacturer=16536>
2022-02-28 09:53:25 DEBUG (MainThread) [custom_components.zha_toolkit] module is <module âcustom_components.zha_toolkitâ from â/config/custom_components/zha_toolkit/init.pyâ>
2022-02-28 09:53:25 DEBUG (MainThread) [custom_components.zha_toolkit.utils] Parameters â{âieeeâ: âbutton.st_droogkast_identifyâ, âclusterâ: 6, âattributeâ: 32770, âattr_typeâ: 48, âmanufacturerâ: 16536}â
2022-02-28 09:53:25 DEBUG (MainThread) [custom_components.zha_toolkit.utils] registry_entity RegistryEntry(entity_id=âbutton.st_droogkast_identifyâ, unique_id=â54:0f:57:ff:fe:7f:e9:29-1-3â, platform=âzhaâ, area_id=None, capabilities=None, config_entry_id=âf44ffad5582b24ea67bc482e01e785edâ, device_class=âupdateâ, device_id=âfc557ccb7df951f7d5f27bc79a1e45abâ, disabled_by=None, entity_category=<EntityCategory.DIAGNOSTIC: âdiagnosticâ>, icon=None, id=âe4e9542aa2f4aca81977749f5410bc87â, name=None, options={}, original_device_class=âupdateâ, original_icon=None, original_name=â_TZ3000_u5u4cakc TS011F 29e97ffe identifyâ, supported_features=0, unit_of_measurement=None)
2022-02-28 09:53:25 DEBUG (MainThread) [custom_components.zha_toolkit.utils] registry_device DeviceEntry(area_id=âbergingâ, config_entries={âf44ffad5582b24ea67bc482e01e785edâ}, configuration_url=None, connections={(âzigbeeâ, â54:0f:57:ff:fe:7f:e9:29â)}, disabled_by=None, entry_type=None, id=âfc557ccb7df951f7d5f27bc79a1e45abâ, identifiers={(âzhaâ, â54:0f:57:ff:fe:7f:e9:29â)}, manufacturer=â_TZ3000_u5u4cakcâ, model=âTS011Fâ, name_by_user=âstopcontact droogkastâ, name=â_TZ3000_u5u4cakc TS011Fâ, suggested_area=None, sw_version=None, hw_version=None, via_device_id=â05a0302d82a5f9732a855fa9e7a6b2c4â, is_new=False)
2022-02-28 09:53:25 DEBUG (MainThread) [custom_components.zha_toolkit] Key <custom_components.zha_toolkit.params.INTERNAL_PARAMS_consts object at 0x7fc251bda620>
2022-02-28 09:53:25 DEBUG (MainThread) [custom_components.zha_toolkit.utils] Type recognition for â<class âzigpy_deconz.zigbee.application.ControllerApplicationâ>â not implemented
2022-02-28 09:53:25 DEBUG (MainThread) [custom_components.zha_toolkit] âieeeâ parameter: âbutton.st_droogkast_identifyâ â IEEE Addr: â54:0f:57:ff:fe:7f:e9:29â
2022-02-28 09:53:25 DEBUG (MainThread) [custom_components.zha_toolkit] Default handler for attr_read
2022-02-28 09:53:25 DEBUG (MainThread) [custom_components.zha_toolkit] Handler: <function command_handler_default at 0x7fc251f2dd30>
2022-02-28 09:53:25 DEBUG (MainThread) [custom_components.zha_toolkit] running default command: <ServiceCall zha_toolkit.attr_read (c:8e9a7ee24d4819dd822a08c761d6586e): ieee=button.st_droogkast_identify, cluster=6, attribute=32770, attr_type=48, manufacturer=16536>
2022-02-28 09:53:25 DEBUG (MainThread) [custom_components.zha_toolkit.default] Trying to import custom_components.zha_toolkit.zcl_attr to call attr_read
2022-02-28 09:53:25 DEBUG (MainThread) [custom_components.zha_toolkit.utils] Endpoint 1 found for cluster â6â
2022-02-28 09:53:25 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Request attr read [32770]
2022-02-28 09:53:25 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Reading attr result (attrs, status): ({32770: <PowerOnState.Off: 0>}, {})
2022-02-28 09:53:25 DEBUG (MainThread) [custom_components.zha_toolkit] event_data {âzha_toolkit_versionâ: âv0.7.21â, âzigpy_versionâ: â0.43.0â, âzigpy_rf_versionâ: None, âieee_orgâ: âbutton.st_droogkast_identifyâ, âieeeâ: â54:0f:57:ff:fe:7f:e9:29â, âcommandâ: None, âcommand_dataâ: None, âstart_timeâ: â2022-02-28T08:53:25.335969+00:00â, âerrorsâ: [], âparamsâ: {âcluster_idâ: 6, âattr_idâ: 32770, âattr_typeâ: 48, âdirâ: 0, âtriesâ: 1, âexpect_replyâ: True, âargsâ: [], âread_before_writeâ: True, âread_after_writeâ: True}, âwrite_is_equalâ: False, âresult_readâ: ({32770: <PowerOnState.Off: 0>}, {}), âsuccessâ: True}
Ok, I see that type conversion did not work for âenumsâ, so I updated the code & tested it.
It works for me in v0.7.22 - same attribute:
I tested like this:
service: zha_toolkit.attr_write
data:
ieee: switch.prise_bureau_on_off
cluster: 6
attribute: 0x8002
attr_type: 48
attr_val: 2
Hi,
Works perfectly now!
service: zha_toolkit.attr_write
data:
ieee: button.st_droogkast_identify
cluster: 6
attribute: 0x8002
attr_type: 0x30
attr_val: 1
Thx for all the help. Hope you keep up improving a great tool!
Iâm happy I found your HACS custom integration! zha_toolkit does all the stuff I fiddled around with scripts and the integrated ZHA service but so much better! I already replaced (re-factored ) my whole automations and scripts. This makes my zigbee based automations much more resilient and with that (and thatâs the key benefit so far) enhances the WAF (wife acceptance factor) really well!
@le_top Have you by the way tested zha-toolkit with the new radio API for zigpy so that this change does not break your backup blueprints, etc.?
https://github.com/zigpy/zigpy/pull/848
_Originally posted by puddly in New radio API by puddly · Pull Request #848 · zigpy/zigpy · GitHub
Alright, this PR is about as ready as it will ever be. Any final thoughts before I merge this and the corresponding PRs in all of the other radio libraries?
It is noteworthy to watchers of this thread that zha_toolkit/ota_notify now includes an option to request downloading the firmware listed in koenkk/zigbee-OTA used in Z2M. this extends beyond the FW currently downloaded by zha (when configured to do so).
Thank you for UI mode, but I miss here choice to input or see data in hex format.
In HA Manage Zigbee Device all data is in hex format.
Itâs soo annoying to convert cluster/attribute numbers from hex to number.
I agree, but for defining the UI of the service call, I am bound to Selectors - Home Assistant .
This could have been a nice entry for the WTH month - maybe it is still open .
How do you remove this, i moved to Zigbee2mqtt and removed this integration, now i cant restart⊠I reinstalled the HACS integration but still nothing
The system cannot restart because the configuration is not valid: Integration error: zha_toolkit - Integration 'zha_toolkit' not found.
``
You probably have zha_toolkit:
in configuration.yaml which tries to load the component.
Remove/comment that.
I needed to set the time and timezone data (dststart, dstend, dstshift) for several of my objects.
Getting the DST data using templates is at least complex so I implemented âmisc_settimeâ to do that with just one service.
You may also be interested in an âoff topicâ service: ha_set_state which allows you to change any state in ha. I use it to detect same value attribute updates of temperatures.
I need to add reporting on a manufacturer cluster attribute on a ZHA device. Iâve already configured the reporting on the attribute but I canât find the way to activate reporting. Can anybody point me to where I should go to do that activation.
Documentation:
Example where one is written, without the manufacturer id. You just need to add the manufacturer id and change the other values to what you need:
Example where a manufacturer attributeâs reporting configuration is read back:
Iâve done this:
service: zha_toolkit.conf_report
data:
ieee: 50:0b:91:40:00:01:f1:e7
cluster: 65281
attribute: 84
min_interval: 1
max_interval: 300
reportable_change: 1
event_success: my_read_success_trigger_event
event_fail: my_read_fail_trigger_event
event_done: my_read_done_trigger_event
results:
[custom_components.zha_toolkit] Fire my_read_done_trigger_event â {âzha_toolkit_versionâ: âv0.8.29â, âzigpy_versionâ: â0.53.0â, âzigpy_rf_versionâ: â0.19.2â, âieee_orgâ: 50:0b:91:40:00:01:f1:e7, âieeeâ: â50:0b:91:40:00:01:f1:e7â, âcommandâ: âconf_reportâ, âcommand_dataâ: None, âstart_timeâ: â2023-01-31T01:45:43.213733+00:00â, âerrorsâ: [], âparamsâ: {âcluster_idâ: 65281, âattr_idâ: 84, âmin_intervalâ: 1, âmax_intervalâ: 300, âreportable_changeâ: 1, âdirâ: 0, âtriesâ: 1, âexpect_replyâ: True, âargsâ: [], âevent_successâ: âmy_read_success_trigger_eventâ, âevent_failâ: âmy_read_fail_trigger_eventâ, âevent_doneâ: âmy_read_done_trigger_eventâ, âread_before_writeâ: True, âread_after_writeâ: True}, âsuccessâ: True,
âresult_confâ: Configure_Reporting_rsp(status_records=[ConfigureReportingResponseRecord(status=<Status.SUCCESS: 0>)])}
Then Iâve done this:
service: zha_toolkit.conf_report_read
data:
ieee: 50:0b:91:40:00:01:f1:e7
cluster: 65281
attribute: 84
event_success: my_read_success_trigger_event
event_fail: my_read_fail_trigger_event
event_done: my_read_done_trigger_event
results:
2023-01-30 20:51:14.808 DEBUG (MainThread) [custom_components.zha_toolkit] Fire my_read_done_trigger_event â {âzha_toolkit_versionâ: âv0.8.29â, âzigpy_versionâ: â0.53.0â, âzigpy_rf_versionâ: â0.19.2â, âieee_orgâ: 50:0b:91:40:00:01:f1:e7, âieeeâ: â50:0b:91:40:00:01:f1:e7â, âcommandâ: âconf_report_readâ, âcommand_dataâ: None, âstart_timeâ: â2023-01-31T01:51:14.727627+00:00â, âerrorsâ: [], âparamsâ: {âcluster_idâ: 65281, âattr_idâ: 84, âdirâ: 0, âtriesâ: 1, âexpect_replyâ: True, âargsâ: [], âevent_successâ: âmy_read_success_trigger_eventâ, âevent_failâ: âmy_read_fail_trigger_eventâ, âevent_doneâ: âmy_read_done_trigger_eventâ, âread_before_writeâ: True, âread_after_writeâ: True}, âsuccessâ: True,
âresult_confâ: [{âclusterâ: âSinopĂ© Technologies Manufacturer specificâ, âcluster_idâ: â0xFF01â, âepâ: 1, âattr_idâ: â0x0054â, âdirectionâ: <ReportingDirection.SendReports: 0>, âstatusâ: <Status.SUCCESS: 0>, âtypeâ: â0x30â, âmin_intervalâ: (1,), âmax_intervalâ: (300,), âattrâ: âactionReportâ}]}
Still no reporting. Do I need to bind the cluster 0xff01 (65281) to the gateway?
Also what is âdirectionâ: <ReportingDirection.SendReports: 0>