Skip to content

Quirks V2 use #3343

Answered by TheJulianJES
Ben3094 asked this question in Q&A
Sep 2, 2024 · 2 comments · 6 replies
Discussion options

You must be logged in to vote

With the newer Home Assistant / ZHA versions, you want just this in a file:

(
    QuirkBuilder(IKEA, "model/device name here")
    .replaces(VOCIndex)  # no `cluster_id`, because we want to implement our custom cluster, use `replaces` to replace the existing one
    .sensor(VOCIndex.AttributeDefs.measured_value.name, VOCIndex.cluster_id)
    .add_to_registry()
)

See this as an example: https://github.com/zigpy/zha-device-handlers/blob/5c4e08d94091a4c5f37cea7b21fd918474e98f82/zhaquirks/ikea/plug.py
You do not want to create a new DeviceRegistry, that's only for tests.

There's a bit of (older) info here: https://github.com/zigpy/zha-device-handlers/pull/3019/files

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by Ben3094
Comment options

You must be logged in to vote
6 replies
@TheJulianJES
Comment options

@Ben3094
Comment options

@TheJulianJES
Comment options

@Ben3094
Comment options

@Ben3094
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants