-
Notifications
You must be signed in to change notification settings - Fork 727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Device Support Request] Matrix Intercom Automator DIY_Zintercom #3763
Comments
So... After looking at the Sonoff examples, at least I got my quirk up and running. The settings appear in the dashboard, but the values are not pulling up. I also don't understand how to get more value from the battery. Quirk
"""Quirk for xyzroe DIY_Zintercom."""
from zigpy.quirks import CustomCluster
from zigpy.quirks.v2 import QuirkBuilder
from zigpy.quirks.v2.homeassistant import UnitOfTime, EntityType
import zigpy.types as t
from zigpy.zcl import ClusterType
from zigpy.zcl.foundation import BaseAttributeDefs, ZCLAttributeDef
from zigpy.zcl.clusters.general import PowerConfiguration
class ZintercomState(t.enum8):
"""Zintercom state enum."""
Idle = 0
Ring = 1
Talk = 2
Open = 3
Drop = 4
class ZintercomMode(t.enum8):
"""Zintercom mode enum."""
Never = 0
Once = 1
Always = 2
Drop = 3
class DIYZintercomDoorLockCluster(CustomCluster):
"""Custom Zintercom cluster."""
cluster_id = 0x0101 # DoorLock cluster ID
class AttributeDefs(BaseAttributeDefs):
"""Attribute definitions."""
state = ZCLAttributeDef(
id=0x0050,
type=ZintercomState,
)
mode = ZCLAttributeDef(
id=0x0051,
type=ZintercomMode,
)
sound = ZCLAttributeDef(
id=0x0052,
type=t.Bool,
)
time_ring = ZCLAttributeDef(
id=0x0053,
type=t.uint16_t,
)
time_talk = ZCLAttributeDef(
id=0x0054,
type=t.uint16_t,
)
time_open = ZCLAttributeDef(
id=0x0055,
type=t.uint16_t,
)
time_report = ZCLAttributeDef(
id=0x0056,
type=t.uint16_t,
)
time_bell = ZCLAttributeDef(
id=0x0057,
type=t.uint16_t,
)
class DIYZintercomPowerConfigurationCluster(PowerConfiguration):
"""Power configuration cluster for DIY Zintercom."""
cluster_id = PowerConfiguration.cluster_id
class AttributeDefs(PowerConfiguration.AttributeDefs):
"""Attribute definitions."""
battery_voltage = PowerConfiguration.AttributeDefs.battery_voltage
battery_percentage_remaining = PowerConfiguration.AttributeDefs.battery_percentage_remaining
(
QuirkBuilder("xyzroe", "DIY_Zintercom")
.replaces(DIYZintercomDoorLockCluster)
.replaces(
DIYZintercomDoorLockCluster,
cluster_type=ClusterType.Client
)
.replaces(DIYZintercomPowerConfigurationCluster)
.enum(
DIYZintercomDoorLockCluster.AttributeDefs.state.name,
ZintercomState,
DIYZintercomDoorLockCluster.cluster_id,
translation_key="state",
fallback_name="Current state",
)
.enum(
DIYZintercomDoorLockCluster.AttributeDefs.mode.name,
ZintercomMode,
DIYZintercomDoorLockCluster.cluster_id,
translation_key="mode",
fallback_name="Mode",
)
.switch(
DIYZintercomDoorLockCluster.AttributeDefs.sound.name,
DIYZintercomDoorLockCluster.cluster_id,
translation_key="sound",
fallback_name="Sound",
)
.number(
DIYZintercomDoorLockCluster.AttributeDefs.time_ring.name,
DIYZintercomDoorLockCluster.cluster_id,
min_value=0,
max_value=65535,
step=1,
unit=UnitOfTime.SECONDS,
multiplier=1,
translation_key="time_ring",
fallback_name="Time to ring",
)
.number(
DIYZintercomDoorLockCluster.AttributeDefs.time_talk.name,
DIYZintercomDoorLockCluster.cluster_id,
min_value=0,
max_value=65535,
step=1,
unit=UnitOfTime.SECONDS,
multiplier=1,
translation_key="time_talk",
fallback_name="Time to talk",
)
.number(
DIYZintercomDoorLockCluster.AttributeDefs.time_open.name,
DIYZintercomDoorLockCluster.cluster_id,
min_value=0,
max_value=65535,
step=1,
unit=UnitOfTime.SECONDS,
multiplier=1,
translation_key="time_open",
fallback_name="Time to open",
)
.number(
DIYZintercomDoorLockCluster.AttributeDefs.time_bell.name,
DIYZintercomDoorLockCluster.cluster_id,
min_value=0,
max_value=65535,
step=1,
unit=UnitOfTime.SECONDS,
multiplier=1,
translation_key="time_bell",
fallback_name="Time bell",
)
.number(
DIYZintercomDoorLockCluster.AttributeDefs.time_report.name,
DIYZintercomDoorLockCluster.cluster_id,
min_value=0,
max_value=65535,
step=1,
unit=UnitOfTime.MINUTES,
multiplier=1,
translation_key="time_report",
fallback_name="Time report",
)
.sensor(
DIYZintercomPowerConfigurationCluster.AttributeDefs.battery_percentage_remaining.name,
DIYZintercomPowerConfigurationCluster.cluster_id,
entity_type=EntityType.DIAGNOSTIC,
multiplier=0.5,
translation_key="battery",
fallback_name="Battery",
)
.sensor(
DIYZintercomPowerConfigurationCluster.AttributeDefs.battery_voltage.name,
DIYZintercomPowerConfigurationCluster.cluster_id,
entity_type=EntityType.DIAGNOSTIC,
multiplier=0.1,
unit="V",
translation_key="battery_voltage",
fallback_name="Battery Voltage",
)
.add_to_registry()
) Signature
{
"node_descriptor": {
"logical_type": 2,
"complex_descriptor_available": 0,
"user_descriptor_available": 0,
"reserved": 0,
"aps_flags": 0,
"frequency_band": 8,
"mac_capability_flags": 128,
"manufacturer_code": 0,
"maximum_buffer_size": 80,
"maximum_incoming_transfer_size": 160,
"server_mask": 0,
"maximum_outgoing_transfer_size": 160,
"descriptor_capability_field": 0
},
"endpoints": {
"1": {
"profile_id": "0x0104",
"device_type": "0x000c",
"input_clusters": [
"0x0000",
"0x0001",
"0x0101"
],
"output_clusters": [
"0x0006",
"0x0101"
]
}
},
"manufacturer": "xyzroe",
"model": "DIY_Zintercom",
"class": "zigpy.quirks.v2.CustomDeviceV2"
} Update: If you request the value directly, it seems to come. But still it is not clear why not all values are not received at once? After some time even manually requesting values is impossible, the device simply does not respond. It is necessary to remove and insert the battery.
|
Problem description
I tried to write a quirk for this device with and without chatgpt, but I still can't start the device. There are no errors in the log, there is only information that my quirk is loaded, but it's not used for my device. The device still doesn't have the necessary sensors and settings in homeassistant. I took a converter for z2m as a basis https://github.com/xyzroe/Zintercom/blob/master/converters/DIYRuZ_Zintercom.js
I tried to remove the device and reconnect it, including constantly overloading the Home Assistant, but nothing helps.
Solution description
I don't know. Use the converter from https://github.com/xyzroe/Zintercom/blob/master/converters/DIYRuZ_Zintercom.js as a basis, write a quirk for ZHA?
Screenshots/Video
Screenshots/Video
[Paste/upload your media here]
Device signature
Device signature
Diagnostic information
Diagnostic information
Logs
Logs
Custom quirk
Custom quirk
Additional information
No response
The text was updated successfully, but these errors were encountered: