Closed jerrm closed 2 years ago
Don't know if it helps, but looks like it may be supported in zigbee2mqtt as Neo NAS-AB02B2. https://github.com/Koenkk/zigbee2mqtt/issues/10348
I don't currently have another install to test under z2m to confirm, hopefully will get a spare usb stick this week to play with.
Similar to #1236 but with a GreenPowerProxy cluster.
Can you attach the logs when poweroff&poweron the device?
According to the zigbee2mqtt thread, there could be the following DPs:
// Neo AlarmOnly
neoAOBattPerc: 15,
neoAOMelody: 21,
neoAODuration: 7,
neoAOAlarm: 13,
neoAOVolume: 5,
Can you attach the logs when poweroff&poweron the device?
Requested logs attached. I enabled logging following the HA ZHA page, and then filtered using a simple "grep -i z" to remove most non-zigbee messages. Let me know if there is a better way.
There is no power button, so "poweroff" was simply pulling power from the device. The "power" logs amount to about 1 minute of logging starting immediately before applying/removing power.
According to the zigbee2mqtt thread, there could be the following DPs:
You're above my head on what to do with the info (if anything).
This is the first device that I've had issues with, so ZHA has been firmly in the "it just works" category for me, and I'm not familiar with the underside.
Thanks...
I have implemented the quirk that should work but I can't validate if it works.
You can configure your local quirk in HA according to https://github.com/zigpy/zha-device-handlers/discussions/693#discussioncomment-857274 and put the attached file inside the new folder.
You will need to rename the file to remove the .txt
extension so that the file name becomes ts0601_siren_1.py
.
Restart HA and check the boot traces for possible problems.
Please validate if it works and report the logs if something is not working as it should.
ts0601_siren_1.py.txt
edit: remove bad version
I will test this evening.
Not much luck with the new file. After some tweaks, the new quirk gets used, but device is still not functional. The only control after adding the device is an apparently non-functional on_off control.
At first zha was broken, logs pointed to a tab in line 273 and two undefined names. I added TuyaLocalCluster & ATTR_ON_OFF to the line 31 zhaquirks.tuya import. No idea if that was anywhere close to a proper fix, but it got things running enough to get some logs (attached).
Happy to provide anything else needed.
Seeing the same:
NameError: name 'ATTR_ON_OFF' is not defined
@javicalle - I got my second zigbee stick in and set up with zigbee2mqtt. Device works in z2m, but would still prefer ZHA.
If any z2m logs or info is helpful, I will gladly provide.
Happy to test or provide any info as well.
I'm sorry I didn't respond sooner, but lately I don't have time to dedicate myself to this. I have created a new implementation. I've checked the imports and I think I haven't missed anything. It should be compatible with HA zha-device-handlers version 2022.03. Not sure if it would be compatible with any older version.
~~Please replace the old version with this one. ts0601_siren_1.py.txt~~
The volume
, alarm_duration
, melody
and battery
will be attributes of NeoSirenManufCluster
.
All excepts battery
should be possible to be setted.
edit: remove bad version
Error setting up entry /dev/controller-zigbee for zha
Traceback (most recent call last):
File "/root/homeassistant/lib/python3.9/site-packages/homeassistant/config_entries.py", line 335, in async_setup
result = await component.async_setup_entry(hass, self)
File "/root/homeassistant/lib/python3.9/site-packages/homeassistant/components/zha/__init__.py", line 99, in async_setup_entry
setup_quirks(config)
File "/root/homeassistant/lib/python3.9/site-packages/zhaquirks/__init__.py", line 403, in setup
importer.find_module(modname).load_module(modname)
File "<frozen importlib._bootstrap_external>", line 529, in _check_name_wrapper
File "<frozen importlib._bootstrap_external>", line 1034, in load_module
File "<frozen importlib._bootstrap_external>", line 859, in load_module
File "<frozen importlib._bootstrap>", line 274, in _load_module_shim
File "<frozen importlib._bootstrap>", line 711, in _load
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 851, in exec_module
File "<frozen importlib._bootstrap_external>", line 988, in get_code
File "<frozen importlib._bootstrap_external>", line 918, in source_to_code
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/root/.homeassistant/custom_zha_quirks/ts0601_siren_1.py", line 230
TUYA_ALARM_ATTR: ("alarm", t.uint8_t),
^
SyntaxError: invalid syntax
Ah I see the comma is missing from the previous line for the dict. Line 316 also has a tab instead of spaces, so python is crying.
I'm not so sure about the next one
File "/root/.homeassistant/custom_zha_quirks/ts0601_siren_1.py", line 274, in <module>
class NeoSirenManufCluster(TuyaMCUCluster):
File "/root/.homeassistant/custom_zha_quirks/ts0601_siren_1.py", line 277, in NeoSirenManufCluster
dp_to_attribute: Dict[int, DPToAttributeMapping] = {
NameError: name 'Dict' is not defined
edit:
imported
from typing import Dict
Still didn't work for me with the following changes, but I'll let @javicalle try too:
diff ts0601_siren_1.py.txt ts0601_siren_1.py
1a2,3
> from typing import Dict
>
229c231
< TUYA_BATTERY_ATTR: ("battery", t.uint32_t)
---
> TUYA_BATTERY_ATTR: ("battery", t.uint32_t),
316c318
< signature = {
---
> signature = {
Which error do you have now?
I'm no longer seeing any code errors but the added device does not have the expected controls etc. It says it's using the Quirk: ts0601_siren_1.TuyaSirenGPP_NoSensors
. Is there a guide to adding logs for a specific device?
Is there a guide to adding logs for a specific device?
No, I believe it isn't. Have you checked the cluster attributes? Are there any values?
I see the following:
And it looks like this
Maybe I'm missing something but when I try to use the switch I get the following:
Failed to call service switch/turn_on. name 'TUYA_MCU_COMMAND' is not defined
Are the volume, alarm_duration, melody and battery attributes reporting something?
Argggg! I forget another one.
Please import TUYA_MCU_COMMAND
from package zhaquirks.tuya.mcu
.
Yes for all of the above attributes. Imported, however now I see this in the logs:
Mar 04 00:14:32 hass hass[917654]: 2022-03-04 00:14:32 WARNING (MainThread) [zigpy.zcl] [0x3422:1:0xef00] No cluster_dp found for 1, on_off
Mar 04 00:14:32 hass hass[917654]: 2022-03-04 00:14:32 WARNING (MainThread) [zigpy.zcl] [0x3422:1:0xef00] no MCU command for data TuyaClusterData(endpoint_id=1, cluster_attr='on_off', attr_value=1)
I see where the the problem must be. If you want to try you can modify this part:
dp_to_attribute: Dict[int, DPToAttributeMapping] = {
1: DPToAttributeMapping(
TuyaMCUSiren.ep_attribute,
"on_off",
dp_type=TuyaDPType.BOOL,
),
5: DPToAttributeMapping(
TuyaMCUSiren.ep_attribute,
"volume",
dp_type=TuyaDPType.ENUM,
),
7: DPToAttributeMapping(
TuyaMCUSiren.ep_attribute,
"alarm_duration",
dp_type=TuyaDPType.VALUE,
),
15: DPToAttributeMapping(
TuyaMCUSiren.ep_attribute,
"battery",
dp_type=TuyaDPType.VALUE,
),
21: DPToAttributeMapping(
TuyaMCUSiren.ep_attribute,
"melody",
dp_type=TuyaDPType.ENUM,
),
}
data_point_handlers = {
1: "_dp_2_attr_update",
5: "_dp_2_attr_update",
7: "_dp_2_attr_update",
15: "_dp_2_attr_update",
21: "_dp_2_attr_update",
}
Time to rest for me. I'll continue tomorrow.
No problem, thank you for the help. Now the attributes are no longer reporting, but no error in the logs.
Got home late, downloaded new file and made the listed changes.
I pair without apparent error, but still don't have any new entities for the device.
Let me know what I can do to help.
Hi, I am going to try to explain how I think the device should work and what you can expect from the implementation.
The device have and OnOff
cluster. This will be treated in HA as a switch.
The switch should reflect the state of the alarm (active/not active) and should also be able to activate it by pressing the switch in HA.
That should be the main objective.
But in addition, this alarm makes use of some datapoints (DPs) that allow to configure the alarm (and report the battery level).
These DPs are mapped against attributes of the TuyaMCUSiren
cluster.
As of today, I believe that HA does not render any type of entity for these values and they can only be managed by reading and writing the attributes of the cluster.
This is the way to configure the alarm from HA and is the secondary objective of the quirk.
This is the corrected version of the quirk. It has all the fixes reported by @stephenjamieson (sorry for that) and I've added a trace for when the switch is invoked from HA. ts0601_siren_1.py.txt
Enable debug log for:
logger:
default: warning
logs:
.../...
custom_zha_quirks: debug
zigpy.zcl: debug
More info (and debug packages) in https://www.home-assistant.io/integrations/zha/#debug-logging
Caught this while home for lunch.
The revised file still needs a couple of fixes to load:
--- ts0601_siren_1.py.txt 2022-03-04 13:35:50.000000000 -0500
+++ ts0601_siren_1.py 2022-03-04 14:47:56.558058360 -0500
@@ -34,7 +34,7 @@
TuyaManufClusterAttributes,
TuyaLocalCluster,
)
-from zhaquirks.tuya.mcu import TuyaClusterData, DPToAttributeMapping, TuyaDPType, TuyaMCUCluster
+from zhaquirks.tuya.mcu import TuyaClusterData, DPToAttributeMapping, TuyaDPType, TuyaMCUCluster, TUYA_MCU_COMMAND
TUYA_BATTERY_ATTR = 0x020F # [0, 0, 0, 100] battery percentage
TUYA_ALARM_ATTR = 0x0168 # [0]/[1] Alarm!
@@ -226,7 +226,7 @@
}
manufacturer_attributes = {
- TUYA_BATTERY_ATTR: ("battery", t.uint32_t)
+ TUYA_BATTERY_ATTR: ("battery", t.uint32_t),
TUYA_ALARM_ATTR: ("alarm", t.uint8_t),
TUYA_TEMP_ALARM_ATTR: ("enable_temperature_alarm", t.uint8_t),
TUYA_HUMID_ALARM_ATTR: ("enable_humidity_alarm", t.uint8_t),
After updating and re-pairing, I can set and get attributes, melody, duration, volume, etc under Manage Clusters, but the on_off switch doesn't seem to do anything.
Have to get back to the office right now. Will look closer later.
Thanks!
Thanks to review. I must have confused the files when uploading it. I've corrected. My version includes (or should include) a debug trace.
Here's what I get when I use the on_off switch
2022-03-04 21:11:36 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0x0006] Sending Tuya Cluster Command. Cluster Command is 1, Arguments are ()
2022-03-04 21:11:36 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0xef00] tuya_mcu_command: cluster_data=TuyaClusterData(endpoint_id=1, cluster_attr='on_off', attr_value=1)
2022-03-04 21:11:36 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0xef00] get_dp_mapping --> found DP: 1
2022-03-04 21:11:36 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0xef00] from_cluster_data: 1, DPToAttributeMapping(ep_attribute='on_off', attribute_name='on_off', dp_type=<TuyaDPType.BOOL: 1>, converter=None, dp_converter=None, endpoint_id=None)
2022-03-04 21:11:36 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0xef00] ztype: Bool.true
2022-03-04 21:11:36 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0xef00] from_value: [1, 1]
2022-03-04 21:11:36 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0xef00] raw: b'\x01'
2022-03-04 21:11:36 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0xef00] tuya_command: TuyaCommand(status=0, tsn=35, dp=1, data=TuyaData(dp_type=<TuyaDPType.BOOL: 1>, function=0, raw=b'\x01', *payload=<Bool.true: 1>))
2022-03-04 21:11:36 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=36 command_id=Command.Default_Response>
2022-03-04 21:11:36 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0xef00] ZCL request 0x000b: [0, <Status.UNSUP_MANUF_CLUSTER_COMMAND: 131>]
Can you attach also the logs from setting a siren attribute (volume
, alarm_duration
, melody
)
Also traces from 'power on' the device (like in https://github.com/zigpy/zha-device-handlers/issues/1379#issuecomment-1048425763) can be helpfull.
Are the attribute changes updating the device? For example, after changin the volume
attribute, the device updates the value?
Can you attach also the logs from setting a siren attribute (volume, alarm_duration, melody)
Are the attribute changes updating the device? For example, after changin the volume attribute, the device updates the value?
I can no longer GET or SET the attributes for some reason. No log entries either. see edit
2022-03-04 21:37:21 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0x0000] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=110 command_id=Command.Report_Attributes>
2022-03-04 21:37:21 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0x0000] ZCL request 0x000a: [[Attribute(attrid=1, value=<TypeValue type=uint8_t, value=68>), Attribute(attrid=65506, value=<TypeValue type=uint8_t, value=48>), Attribute(attrid=65508, value=<TypeValue type=uint8_t, value=1>)]]
2022-03-04 21:37:21 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0x0000] Attribute report received: app_version=68, 65506=48, 65508=1
2022-03-04 21:37:21 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=111 command_id=1>
2022-03-04 21:37:21 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0xef00] ZCL request 0x0001: [TuyaCommand(status=0, tsn=2, dp=5, data=TuyaData(dp_type=<TuyaDPType.ENUM: 4>, function=0, raw=b'\x02', *payload=<enum8.undefined_0x02: 2>))]
2022-03-04 21:37:21 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=112 command_id=1>
2022-03-04 21:37:21 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0xef00] ZCL request 0x0001: [TuyaCommand(status=0, tsn=3, dp=7, data=TuyaData(dp_type=<TuyaDPType.VALUE: 2>, function=0, raw=b'\n\x00\x00\x00', *payload=10))]
2022-03-04 21:37:22 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=113 command_id=1>
2022-03-04 21:37:22 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0xef00] ZCL request 0x0001: [TuyaCommand(status=0, tsn=4, dp=15, data=TuyaData(dp_type=<TuyaDPType.VALUE: 2>, function=0, raw=b'd\x00\x00\x00', *payload=100))]
2022-03-04 21:37:22 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=114 command_id=1>
2022-03-04 21:37:22 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0xef00] ZCL request 0x0001: [TuyaCommand(status=0, tsn=5, dp=21, data=TuyaData(dp_type=<TuyaDPType.ENUM: 4>, function=0, raw=b'\x05', *payload=<enum8.undefined_0x05: 5>))]
2022-03-04 21:37:22 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=115 command_id=17>
2022-03-04 21:37:22 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0xef00] ZCL request 0x0011: [MCUVersion(status=0, tsn=7, version_raw=66, *version='1.0.2')]
2022-03-04 21:37:22 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0xef00] MCU version: 1.0.2
2022-03-04 21:37:23 DEBUG (MainThread) [zigpy.zcl] [0xdf41:1:0x0b04] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=23 command_id=Command.Read_Attributes_rsp>
2022-03-04 21:37:32 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0x000a] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=116 command_id=Command.Read_Attributes>
2022-03-04 21:37:32 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0x000a] ZCL request 0x0000: [[7]]
edit: I reloaded the zigbee integration and I can get the attributes again.
GET Melody results in:
2022-03-04 21:43:20 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0x0006] Couldn't normalize 1126 attribute with None value
Traceback (most recent call last):
File "/root/homeassistant/lib/python3.9/site-packages/zigpy/zcl/__init__.py", line 307, in read_attributes
value = self.attributes[record.attrid][1](record.value.value)
File "/root/homeassistant/lib/python3.9/site-packages/zigpy/types/basic.py", line 59, in __new__
n = super().__new__(cls, *args, **kwargs)
ValueError: invalid literal for int() with base 10: 'None'
Set does nothing
GET Volume works and so does SET with no logs, is there another DEBUG I need to set? Getting the value again shows that it was changed as expected.
ALARM_DURATION works the same as Volume.
All attribute values seems to function OK.
GET Melody results in:
Can you try to SET a melody
value? I believe that 1-5 values are allowed. Perform a GET after setting to verify it works.
And for the switch, could you change the NeoSirenManufCluster
with this one (just change the 1
keys for 13
):
class NeoSirenManufCluster(TuyaMCUCluster):
"""Tuya with NEO Siren data points."""
dp_to_attribute: Dict[int, DPToAttributeMapping] = {
13: DPToAttributeMapping(
TuyaMCUSiren.ep_attribute,
"on_off",
dp_type=TuyaDPType.BOOL,
),
5: DPToAttributeMapping(
TuyaMCUSiren.ep_attribute,
"volume",
dp_type=TuyaDPType.ENUM,
),
7: DPToAttributeMapping(
TuyaMCUSiren.ep_attribute,
"alarm_duration",
dp_type=TuyaDPType.VALUE,
),
15: DPToAttributeMapping(
TuyaMCUSiren.ep_attribute,
"battery",
dp_type=TuyaDPType.VALUE,
),
21: DPToAttributeMapping(
TuyaMCUSiren.ep_attribute,
"melody",
dp_type=TuyaDPType.ENUM,
),
}
data_point_handlers = {
13: "_dp_2_attr_update",
5: "_dp_2_attr_update",
7: "_dp_2_attr_update",
15: "_dp_2_attr_update",
21: "_dp_2_attr_update",
}
Can you try to SET a melody value? I believe that 1-5 values are allowed. Perform a GET after setting to verify it works.
Yep, it works after I set it
2022-03-04 22:31:17 DEBUG (MainThread) [zigpy.zcl] [0x6d04:1:0x0402] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=114 command_id=Command.Report_Attributes>
2022-03-04 22:31:17 DEBUG (MainThread) [zigpy.zcl] [0x6d04:1:0x0402] ZCL request 0x000a: [[Attribute(attrid=0, value=<TypeValue type=int16s, value=1970>)]]
2022-03-04 22:31:17 DEBUG (MainThread) [zigpy.zcl] [0x6d04:1:0x0402] Attribute report received: measured_value=1970
2022-03-04 22:31:23 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0x0006] Sending Tuya Cluster Command. Cluster Command is 1, Arguments are ()
2022-03-04 22:31:23 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0xef00] tuya_mcu_command: cluster_data=TuyaClusterData(endpoint_id=1, cluster_attr='on_off', attr_value=1)
2022-03-04 22:31:23 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0xef00] get_dp_mapping --> found DP: 13
2022-03-04 22:31:23 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0xef00] from_cluster_data: 13, DPToAttributeMapping(ep_attribute='on_off', attribute_name='on_off', dp_type=<TuyaDPType.BOOL: 1>, converter=None, dp_converter=None, endpoint_id=None)
2022-03-04 22:31:23 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0xef00] ztype: Bool.true
2022-03-04 22:31:23 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0xef00] from_value: [1, 1]
2022-03-04 22:31:23 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0xef00] raw: b'\x01'
2022-03-04 22:31:23 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0xef00] tuya_command: TuyaCommand(status=0, tsn=47, dp=13, data=TuyaData(dp_type=<TuyaDPType.BOOL: 1>, function=0, raw=b'\x01', *payload=<Bool.true: 1>))
2022-03-04 22:31:23 DEBUG (MainThread) [zigpy.zcl] [0x3422:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=48 command_id=Command.Default_Response>
Nothing happening still when I use the on_off switch, logs above
Can you confirm that no UNSUP_MANUF_CLUSTER_COMMAND
traces now?
There is any way you can activate the siren and get the traces?
Yeah I do not see any UNSUP_MANUF_CLUSTER_COMMAND
. AFAIK there's no way to trigger the alarm.
If any z2m logs or info is helpful, I will gladly provide.
@jerrm I have no knowledge about z2m, but if you can provide traces from the working operation of the device I will take a look to see if something can be usefull. I am interested in the Zigbee message format.
@stephenjamieson can you catch a trace (if there is some) when you update an attribute? I expect a trace with a tuya_mcu_command: ...
message.
@javicalle, will see what I can get from z2m.
Meanwhile, I was preparing logs from zha (attached). Included is the exact version of the quirk file in use. It should be your last version with the 1->13 edits.
neo.get_volume.log neo.join.log neo.on_from_device_page.log neo.powerup.log neo.set_alarm_duration_to_5.log neo.set_melody_to_2.log neo.set_volume_to_1.log ts0601_siren_1.py.log neo.get_alarm_duration.log neo.get_melody.log
@jerrm Sorry, but these logs doesn't seem to be from the same device.
This tupla [0x4edd:1:0x0406]
are [device:endpoint:cluster] values.
The expected traces must be something like [0x3422:1:0xef00]
. The device part can (and will) be diferent. But the endpoint:cluster will not, must be :1:0xef00 (for this device).
Maybe more traces are needed.
Can you enable also the zhaquirks.tuya.mcu: debug)
level?
I am not sure why you don't get traces from attribute update. There must be something that I can't see.
Time to rest here. I will continue tomorrow.
See if the attached z2m log helps at all: neo.z2m.set_alarm_true.log.
The log covers the time immediately before toggling the "alarm" boolean through the completion of the 5 second duration.
Will make zha debug log changes and post as well.
For reference, the device presents in z2m as:
And in HA as:
I was controlling directly from the z2m page.
Additional logs for other settings: neo.z2m.set_melody_to_6.log neo.z2m.set_volume_to_medium.log neo.z2m.set_duration_to_20.log
@javicalle & @stephenjamieson:
I'm still not getting any zha logging for the device when setting/getting attributes from the "manage clusters" page. Even tried bumping the default level to debug as well.
Do you?
My current log settings:
logger:
default: debug
logs:
homeassistant.core: debug
homeassistant.components.zha: debug
bellows.zigbee.application: debug
bellows.ezsp: debug
zigpy: debug
zigpy_deconz.zigbee.application: debug
zigpy_deconz.api: debug
zigpy_xbee.zigbee.application: debug
zigpy_xbee.api: debug
zigpy_zigate: debug
zigpy_znp: debug
zhaquirks: debug
custom_zha_quirks: debug
zigpy.zcl: debug
zhaquirks.tuya.mcu: debug
I don't have any similar device to check. Are you in HA 2022.03?
The write_attributes method have a debug log: https://github.com/zigpy/zha-device-handlers/blob/83057c45b3e5f757fa2b05f3951ad51d584a551e/zhaquirks/tuya/mcu/__init__.py#L103-L111
If you get logs from tuya.mcu.__init__.py
(the tuya_mcu_command: ...
messages) you should also get logs from the write_attributes
. 🤷🏻♂️
Which zigbee controller/ZHA library are you using?
My current log settings:
logger: default: debug logs: homeassistant.core: debug homeassistant.components.zha: debug bellows.zigbee.application: debug bellows.ezsp: debug zigpy: debug zigpy_deconz.zigbee.application: debug zigpy_deconz.api: debug zigpy_xbee.zigbee.application: debug zigpy_xbee.api: debug zigpy_zigate: debug zigpy_znp: debug zhaquirks: debug custom_zha_quirks: debug zigpy.zcl: debug zhaquirks.tuya.mcu: debug
Have you restarted HA?
If not, you can also modify the log level (without restar) from HA developer-tools
--> service
--> logger.set_level
--> 'YAML mode':
service: logger.set_level
data: {
homeassistant.core: debug
homeassistant.components.zha: debug
bellows.zigbee.application: debug
bellows.ezsp: debug
zigpy: debug
zigpy_deconz.zigbee.application: debug
zigpy_deconz.api: debug
zigpy_xbee.zigbee.application: debug
zigpy_xbee.api: debug
zigpy_zigate: debug
zigpy_znp: debug
zhaquirks: debug
custom_zha_quirks: debug
zigpy.zcl: debug
zhaquirks.tuya.mcu: debug
}
Have you restarted HA?
Many times, I'm definitely getting the debug output when I have the settings enabled. They've been commented/uncommented in configuration.yaml multiple times now.
The service call option will be a big help.
Which zigbee controller/ZHA library are you using?
Stick is the Sonoff 3.0 Dongle Plus/CC2652 based - so znp correct?
If you get logs from tuya.mcu.init.py (the tuya_mcu_command: ... messages) you should also get logs from the write_attributes.
With tail -f home-assistant.log | grep tuya_mcu_command
, toggling the on_off control from the UI gives me
2022-03-05 18:21:50 DEBUG (MainThread) [zigpy.zcl] [0x2a72:1:0xef00] tuya_mcu_command: cluster_data=TuyaClusterData(endpoint_id=1, cluster_attr='on_off', attr_value=0)
Setting attributes from the "Manage Clusters" page doesn't report anything.
Neither the control nor manage cluster page give anything with tail -f home-assistant.log | grep write_
Seeing the same behavior on my end, nothing logged for set or get on 2022.3.0
Stick is the Sonoff 3.0 Dongle Plus/CC2652 based - so znp correct?
I think that will be bellows:
So now there are 2 situations to fix:
For point 2 I have a possible test:
If they match, it means that we can really communicate with the device and interact with it. Then we can focus in why isn't working the switch part. If it doesn't match, surely HA is not able to communicate with the device and what we see is some kind of local cache in HA. This will address us to undestand why Z2M can talk to device but ZHA not.
💡 Can you check that you don't have any local quirk (other than ts0601_siren_1.py
) that could affect to this device. Any local tuya or tuya.mcu quirk maybe?
I have compared the ZHA messages with those of Z2M and what I have found has been more or less what I expected:
TuyaCommand(
status=0,
tsn=27,
dp=13,
data=TuyaData(
dp_type=<TuyaDPType.BOOL: 1>,
function=0,
raw=b'\x01',
*payload=<Bool.true: 1>
)
)
manuSpecificTuya.dataRequest(
{
"seq":7,
"dpValues":[
{"dp":13,"datatype":1,"data":[1]}
]
},
.../...
)
(tsn
& seq
are not relevant here)
I'm curious about the headers attributes (the manufacturer
ones), but as we don't get logs in HA from this part I can't compare.
Hello,
Can you check that you don't have any local quirk (other than ts0601_siren_1.py) that could affect to this device. Any local tuya or tuya.mcu quirk maybe?
As far as I know there are no other quirks, at least not in the custom directory. There's in fact only this one in the issue. Wondering if there's a debug issue since even enabling debug for all logs shows nothing.
This is a Neo/Tuya Siren without sensors.
Using Home Assistant 2022.2.8, no controls some in other than
Signature after adding:
Logs: