Hello,
I ran into the same issue with the ZLinky TIC, and have a solution to share.
Objective: I wanted to retrieve attributes IINST1, IINST2, IINST3 from the device (see here for documentation: GitHub - fairecasoimeme/Zlinky_TIC: Téléinformation Linky autoalimenté ZigBee 3.0). These attributes can be queried manually through the Zigbee device management window in Home Assistant, but are unfortunately not exposed as sensors by the zha integration - as per the above post.
Resolution steps below.
Step 1: install zha toolkit, if not already present on your system.
Plenty of documentation available on how to do this… Don’t forget adding “zha_toolkit:” to your HA yaml configuration.
Step 2: Create Template sensors, for each attribute you need to expose as a sensor
Templates are added in Settings → Devices & services → Helpers:
Make sure to set an identity ID that is meaningful to you, and the appropriate options for the value you want to read.For example:
- Device class: current
- Unit of measurement: A
- State class: measurement
Step 3: Create an automation to read the device attributes at a regular interval
For this step, you need to know the appropriate Cluster and Attribute IDs, for the attributes you want to read. Refer to the documentation of your device, or explore your device directly from zha with the “Manage Zigbee device” option.
Retrieve the values through automation, by calling the “attr_read” service of the zha toolkit, at the interval you need:
In my case, the resulting yaml for the automation looks like:
alias: Update Zlinky TIC sensors
description: ""
trigger:
- platform: time_pattern
minutes: /1
condition: []
action:
- service: zha_toolkit.attr_read
metadata: {}
data:
ieee: sensor.lixee_zlinky_tic_current
state_id: sensor.lixee_zlinky_tic_puissance_instantanee_phase_1
cluster: 2820
attribute: 1288
- service: zha_toolkit.attr_read
metadata: {}
data:
ieee: sensor.lixee_zlinky_tic_current
state_id: sensor.lixee_zlinky_tic_puissance_instantanee_phase_2
cluster: 2820
attribute: 2312
- service: zha_toolkit.attr_read
metadata: {}
data:
ieee: sensor.lixee_zlinky_tic_current
state_id: sensor.lixee_zlinky_tic_puissance_instantanee_phase_3
cluster: 2820
attribute: 2568
mode: single
Reference material: Intégration zha · Issue #18 · fairecasoimeme/Zlinky_TIC (github.com)
Note - technically, as per the documentation, IINST1 = IINST (same Cluster/Attribute ID), which is already natively exposed by zha as a sensor through sensor.lixee_zlinky_tic_current. Only IINST2 and IINST3 are actually missing. - but somehow I prefer the consistency of handling all 3 the same way
I hope this helps!