You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@TheJulianJES@puddly
Hello, our company's vibration sensor has a set of private clusters, the function is to report the angle of the X, Y, Z axis of the sensor at the moment.
I would like the reported data to be displayed in the red box in the image below. How do I set this up in my code?
Below is a screenshot of the data reported by this private cluster:
The following is my code, please give me some suggestions for modification, thank you!
"""Third Reality vibration sensor devices."""
from typing import Final
from zigpy.quirks import CustomCluster
from zigpy.quirks.v2 import QuirkBuilder
from zigpy.quirks.v2.homeassistant import UnitOfTime
import zigpy.types as t
from zigpy.zcl.clusters.measurement import Cluster
from zigpy.zcl.foundation import BaseAttributeDefs, ZCLAttributeDef
class ThirdRealityVibrationSensorCluster(Cluster):
"""Third Reality's plug private cluster."""
cluster_id: Final[t.uint16_t] = 0xFFF1
name: Final = "Third Reality Vibration Sensor Cluster"
ep_attribute: Final = "vibration_sensor_cluster"
class AttributeDefs(BaseAttributeDefs):
"""Define the attributes of a private cluster."""
cool_down_time: Final = ZCLAttributeDef(
id=0x0004,
type=t.uint16_t,
is_manufacturer_specific=True,
)
angle_x: Final = ZCLAttributeDef(
id=0x0005,
type=t.int16s,
access="p",
mandatory=True,
is_manufacturer_specific=True,
)
angle_y: Final = ZCLAttributeDef(
id=0x0006,
type=t.int16s,
access="p",
mandatory=True,
is_manufacturer_specific=True,
)
angle_z: Final = ZCLAttributeDef(
id=0x0007,
type=t.int16s,
access="p",
mandatory=True,
is_manufacturer_specific=True,
)
(
QuirkBuilder("Third Reality, Inc", "3RVS01031Z")
.replaces(ThirdRealityVibrationSensorCluster)
.number(
attribute_name=ThirdRealityVibrationSensorCluster.AttributeDefs.cool_down_time.name,
min_value=0,
max_value=7200,
step=1,
unit=UnitOfTime.SECONDS,
cluster_id=ThirdRealityVibrationSensorCluster.cluster_id,
translation_key="detection_interval",
fallback_name="Detection interval",
)
.add_to_registry()
)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
@TheJulianJES @puddly

Hello, our company's vibration sensor has a set of private clusters, the function is to report the angle of the X, Y, Z axis of the sensor at the moment.
I would like the reported data to be displayed in the red box in the image below. How do I set this up in my code?
Below is a screenshot of the data reported by this private cluster:

The following is my code, please give me some suggestions for modification, thank you!
Beta Was this translation helpful? Give feedback.
All reactions