Skip to content
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] ZLinky_TIC - add more sensors #2583

Open
Xalio opened this issue Sep 14, 2023 · 6 comments
Open

[Device Support Request] ZLinky_TIC - add more sensors #2583

Xalio opened this issue Sep 14, 2023 · 6 comments
Labels
ZHA lib This issue will need changes directly in ZHA.

Comments

@Xalio
Copy link

Xalio commented Sep 14, 2023

Problem description

Current device support doesn't show the entire list of attributes of the device in the sensor.
As per example in my case I need to get the electricity metering for three phases, not just phase 1.

When I try manually, the device gets the values, see screenshot example below:
image

Solution description

I would need to get the information related to phase b & c as sensors so I can use them for graphs.

Screenshots/Video

Screenshots/Video

[Paste/upload your media here]

Device signature

Device signature
{
  "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.Router: 1>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.FullFunctionDevice|MainsPowered|RxOnWhenIdle|AllocateAddress: 142>, manufacturer_code=4151, maximum_buffer_size=127, maximum_incoming_transfer_size=200, server_mask=11264, maximum_outgoing_transfer_size=200, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False)",
  "endpoints": {
    "1": {
      "profile_id": "0x0104",
      "device_type": "0x0053",
      "input_clusters": [
        "0x0000",
        "0x0001",
        "0x0003",
        "0x0702",
        "0x0b01",
        "0x0b04",
        "0xff66"
      ],
      "output_clusters": [
        "0x0019"
      ]
    },
    "242": {
      "profile_id": "0xa1e0",
      "device_type": "0x0061",
      "input_clusters": [
        "0x0021"
      ],
      "output_clusters": [
        "0x0021"
      ]
    }
  },
  "manufacturer": "LiXee",
  "model": "ZLinky_TIC",
  "class": "zhaquirks.lixee.zlinky.ZLinkyTICFWV12"
}

Diagnostic information

Diagnostic information
[Paste the diagnostic information here]

Logs

Logs
[Paste the logs here]

Custom quirk

Custom quirk
[Paste your custom quirk here]

Additional information

Side question, how can we build custom quirk from existing device signature? I can have a look at that if needed.

Thanks!

@TheJulianJES TheJulianJES added the ZHA lib This issue will need changes directly in ZHA. label Sep 17, 2023
@TheJulianJES
Copy link
Collaborator

TheJulianJES commented Sep 17, 2023

This likely needs to be implemented as a sensor in ZHA / HA Core.

how can we build custom quirk from existing device signature?

This can be generated (although the currently uploaded quirk-generator on a branch is outdated) or manually written. Your device already has a quirk though:
https://github.com/zigpy/zha-device-handlers/blob/dev/zhaquirks/lixee/zlinky.py#L202
It's mostly the same as the quirk above those lines.

A generated "stub" quirk for your device would basically look like this: (doesn't do anything -- just applies the quirk).
The manufacturer specific cluster 0xFF66would be replaced byZLinkyTICManufacturerCluster` (like done in the quirk linked above).

Possible STUB quirk for your device
"""Quirk for LiXee ZLinky_TIC."""

from zigpy.profiles import zha, zgp
from zigpy.quirks import CustomDevice
from zigpy.zcl.clusters.general import (
    Basic,
    GreenPowerProxy,
    Identify,
    Ota,
    PowerConfiguration,
)
from zigpy.zcl.clusters.homeautomation import (
    ElectricalMeasurement,
    MeterIdentification,
)
from zigpy.zcl.clusters.smartenergy import (
    Metering,
)
from zhaquirks.const import (
    DEVICE_TYPE,
    ENDPOINTS,
    INPUT_CLUSTERS,
    MODELS_INFO,
    OUTPUT_CLUSTERS,
    PROFILE_ID,
)


class LixeeZlinkyTic(CustomDevice):
    """Lixee ZLinky_TIC custom device implementation."""

    signature = {
        MODELS_INFO: [("LiXee", "ZLinky_TIC")],
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.METER_INTERFACE,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    PowerConfiguration.cluster_id,
                    Identify.cluster_id,
                    Metering.cluster_id,
                    MeterIdentification.cluster_id,
                    ElectricalMeasurement.cluster_id,
                    0xff66,
                ],
                OUTPUT_CLUSTERS: [
                    Ota.cluster_id,
                ],
            },
            242: {
                PROFILE_ID: zgp.PROFILE_ID,
                DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC,
                INPUT_CLUSTERS: [
                    GreenPowerProxy.cluster_id,
                ],
                OUTPUT_CLUSTERS: [
                    GreenPowerProxy.cluster_id,
                ],
            },
        },
    }

    replacement = {
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.METER_INTERFACE,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    PowerConfiguration.cluster_id,
                    Identify.cluster_id,
                    Metering.cluster_id,
                    MeterIdentification.cluster_id,
                    ElectricalMeasurement.cluster_id,
                    0xff66,
                ],
                OUTPUT_CLUSTERS: [
                    Ota.cluster_id,
                ],
            },
            242: {
                PROFILE_ID: zgp.PROFILE_ID,
                DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC,
                INPUT_CLUSTERS: [
                    GreenPowerProxy.cluster_id,
                ],
                OUTPUT_CLUSTERS: [
                    GreenPowerProxy.cluster_id,
                ],
            },
        },
    }

@Hedda
Copy link
Contributor

Hedda commented Dec 20, 2023

Current device support doesn't show the entire list of attributes of the device in the sensor.

This likely needs to be implemented as a sensor in ZHA / HA Core.

FYI, there is a upstream request to the Zlinky TIC product manufacturer/developer (LiXee) here -> fairecasoimeme/Zlinky_TIC#18

@fairecasoimeme Zlinky TIC owners requesting better integration in Home Assistant's built-in ZHA integration component code:

https://github.com/home-assistant/core/tree/dev/homeassistant/components/zha

Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Issue is inactivate and might get closed soon label Jul 30, 2024
@Xalio
Copy link
Author

Xalio commented Jul 30, 2024

Not resolved, still a thing for those who want to use that device.

@github-actions github-actions bot removed the stale Issue is inactivate and might get closed soon label Jul 30, 2024
@superlevure
Copy link

I have the same request to add the following attribute as an entity:

  • Cluster: ZLINKY_MANUFACTURER_CLUSTER_ID (0xff66)
  • Attribute: std_current_supplier_price_description (0x0200)

It's really important for those who subscribed to a TEMPO contract

@Hedda
Copy link
Contributor

Hedda commented Oct 30, 2024

For reference follow these two related discussions and work-in-progress to create a new "Quirk V2" (next-generation quirk) for it:

PS: Again, there is still also an ongoing ZHA support feature request to upstream (Zlinky TIC product firmware developer) here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ZHA lib This issue will need changes directly in ZHA.
Projects
None yet
Development

No branches or pull requests

4 participants