Can we get tVOC index using quirk? I would love to avoid using zha toolkit and a separate automation for polling tVOC.
Hello, my installation is HA on Raspberry Pi, no HACS, IKEA Dirigera and this sensor, hardware version 1 firmware 1.0.11 (ālatestā). I just noticed the strange behaviour of pm2.5 and "air quality"values. The history looks like this:
So temperature and humidity just work, while air quality and PM2 5 work sometimes, then freeze for quite a while (days).
I read through this thread but didnāt quite get if the issue discussed here applies to me, as two out of four values update frequently, so ZigBee works ok. I am not well versed in HA internals, it just works for me. Perhaps someone would care to explain what should be done in this straightforward use case? Or is it a big in my system?
Just got my unit,
After a bit of fiddling I now have TVOC in ZHA.
Hereās a graph card I created to show it.
type: custom:swipe-card
cards:
- type: gauge
entity: sensor.vindstyrka_tvoc
needle: true
segments:
- from: 0
color: green
- from: 51
color: yellow
- from: 101
color: orange
- from: 151
color: red
min: 0
max: 201
- type: gauge
entity: sensor.vindstyrka_tvoc
needle: true
segments:
- from: 0
color: green
- from: 51
color: yellow
- from: 101
color: orange
- from: 151
color: red
- from: 201
color: MediumSlateBlue
- from: 301
color: purple
min: 0
max: 500
As Sensironās TVOC value is proprietary, itās been a bit hard to work out what values I should use. I used this table as a reference:
And it seems to match well with what the VOC Index PDF says for each value (https://sensirion.com/media/documents/02232963/6294E043/Info_Note_VOC_Index.pdf)
Any feedback welcome.
I wanted to set up a shorter and reliable polling interval for the attributes, so I can use them better in derivative sensors. I created an automation, like shown here in the thread, but I kept getting this error message:
<DATETIME> WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Result: {0: <Status.UNSUPPORTED_ATTRIBUTE: 134>} - Attribute 0 not in read ({}, {0: <Status.UNSUPPORTED_ATTRIBUTE: 134>})
After a lot of debugging, eventually I enabled debug logging for ZHA, and manually sent the update request, (Settings > Devices and Services > ZHA > X devices > 3 dots > Manage Zigbee Device > PM25 Endpoint, measured_value (0x000) > Read Attribute), and I found out, that the only difference between the request sent by the ZHA manual update and the ZHA Toolkit automation is, that I specified the manf: 4476
in my automation. After removing it, the polling worked fine.
I had to add the manf: 4476
only to the VOC sensor, as that one would throw the same error without that parameter specified.
Here is my automation YAML (you can add more attributes to poll, like it is shown in the thread):
alias: Zigbee polling
description: ""
trigger:
- platform: time_pattern
minutes: /1
condition: []
action:
- metadata: {}
data:
ieee: <IEEE>
endpoint: 1
cluster: 1066
attribute: 0
state_id: sensor.bathroom_aqi_pm2_5
allow_create: true
action: zha_toolkit.attr_read
mode: single
Hereās an automation I put together to regularly update the Humidity, PM2.5 and Temperature sensor values, as similar to other posts Iāve noticed the values stop updating after a while.
It also has the TVOC reading action.
alias: Read VINDSTYRKA
description: Use ZHA_toolkit
trigger:
- platform: time_pattern
seconds: "0"
minutes: /1
condition: []
action:
- data:
ieee: # put your IEEE here, remove the #
endpoint: 1
cluster: 64638
attribute: 0
manf: 4476
state_id: sensor.VINDSTYRKA_tvoc
action: zha_toolkit.attr_read
- action: zha_toolkit.attr_read
metadata: {}
data:
ieee: sensor.vindstyrka_humidity
attribute: 0
cluster: 1029
- action: zha_toolkit.attr_read
metadata: {}
data:
ieee: sensor.vindstyrka_pm2_5
cluster: 1066
attribute: 0
- action: zha_toolkit.attr_read
metadata: {}
data:
ieee: sensor.vindstyrka_temperature
cluster: 1026
attribute: 0
mode: single
CC: @kadam12g I hadnāt spotted your post above, looks like we had the same idea
I hope this is the right place. I have this VINDSTYRKA sensor attached to Home Assistant via Zigbee2MQTT. I keep getting notifications to upgrade the sensor firmware from version 65552 to 16777233. Can someone point me in the direction of release notes? Iāve searched for the answers, but have been unsuccessful. Thanks.
(Dropping into an old topic here, but ā¦)
Support for editing template sensors in the dashboard/UI was added in the 2023.09 release, and has been expanded since then. You can achieve the same goal by editing the configuration manually, but Iād recommend upgrading. When you originally wrote this, you were on a release over 6 months old.
Have a great day!
I have clicked the update and now when connected to Z2MQTT sensor reboots randomly. It doesnāt reboot when not connected. Strangely the update popped up in Settings->Updates not in Z2M->OTA which shows FW version 1.0.010 from 2022. I am on latest HA core and Z2M. Anyone knows how to solve the reboots? Thanks
Hi All,
I read this thread about 29 times and still canāt get the damned tVOC to read and report. Running latest HA, created template-helper
and automation:
Traces error shows me:
Also experimented with variations of sensor template:
Any help or pointers where my errors are are appreciated.
Thereās a bug in most recent HA Core updated ZHA. This broke ZHA Toolkit (it now needs to be updated to fix the issue):
There is a fix available! I have downloaded and installed the 4 affected PY files and all now works! (I could just wait until it is merged and then update, but I am a bit impatientā¦)
Where did you download these files from ?
The pull request is near the bottom of the linked GitHub issue mentioned in @VACIncās reply.
Youād then need to install by updating the version in your custom_components
. It is a little old school, but one way to do this would be to download a .patch
from GitHub.
https://github.com/mdeweerd/zha-toolkit/pull/263.patch
And then you can apply it using the patch
tool.
apk add -U patch # make sure the `patch` tool is installed
cd /config
curl -L https://github.com/mdeweerd/zha-toolkit/pull/263.patch | patch -p1 --backup
The patch command will not be able to locate the hacs.json
, but you can safely skip this one (just press <enter>
):
checking file custom_components/zha_toolkit/__init__.py
checking file custom_components/zha_toolkit/scan_device.py
checking file custom_components/zha_toolkit/utils.py
checking file custom_components/zha_toolkit/zcl_attr.py
can't find file to patch at input line 140
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|
|From 55f440af55f3b28cb37ed7acb396e14bfa5e72c0 Mon Sep 17 00:00:00 2001
|From: =?UTF-8?q?Micha=C5=82=20Modzelewski?= <[email protected]>
|Date: Tue, 17 Sep 2024 13:09:25 +0200
|Subject: [PATCH 3/3] Require 2024.9.0
|
|---
| hacs.json | 2 +-
| 1 file changed, 1 insertion(+), 1 deletion(-)
|
|diff --git a/hacs.json b/hacs.json
|index b09835a..f43d65d 100644
|--- a/hacs.json
|+++ b/hacs.json
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored
That command should make backups of any files it changes, but Iād still recommend performing a backup and being extra careful. Good luck!
I tried this but it didnāt work for me. Any idea what Iām doing wrong? It doesnāt seem to update the sensor.
alias: "-- Testing Automation --"
description: ""
triggers:
- trigger: time_pattern
minutes: /1
conditions: []
actions:
- action: zha_toolkit.attr_read
metadata: {}
data:
ieee: sensor.ikea_of_sweden_vindstyrka_pm2_5
endpoint: 1
cluster: 1066
force_update: true
attribute: 0
state_id: sensor.ikea_of_sweden_vindstyrka_pm2_5
manf: 4476
mode: restart
Would it be possible to add the tVOC value with a (custom) ZHA Quirk?
I think that I unfortunately donāt have enough knowledge about zigpy to implement this, but maybe someone else has an idea how this situation could be improved, because the solution with ZHA toolkit seems to keep breaking all the time, which is quite annoying.
I got this a little over a year ago and itās been working great,
now suddenly its showing zero 2.5pm value.
Any idea how to fix it?
I opened it up and the fan wasnāt dirtyā¦
Tried reseting + rebooting couple of times but it makes no difference
Kinda dissapointed ikea doesnāt have any warranty at all for thisā¦
Take it back. If youāre anywhere in the EU, UK, Aus or NZ then consumer guarantees apply and youāre entitled to a repair or replacement.
Thank you very much. I can confirm, that the patch works for me on HA Version Core 2024.10.3 / Supervisor 2024.10.3 / Operating System 13.2 / Frontend 20241002.3.
Hello,
I triedā¦ But I have been stuck with this device not reporting its tVOC value as the same time as other values.
If you want to try my implementation, you can find it on zha-device-handlers GitHub.
I would like to do more but I still do not have a good understanding of ZHAā¦
I have the VOC index working after piecing together a few different entries from this thread, so I thought I would assemble them here in a single post.
- You need the zha_toolkit, this was broken in the latest updates to HA, 2024.11, so you need to patch the
zha_toolkit/zcl_attr.py
file. Line 385-387 should be modified to look like this:
found_attr_type = f.DataType.from_python_type(
python_type
).type_id
The from_python_type
and type_id
parts are NEW
-
Restart HA
-
Create an automation that triggers faster reading of values, this also has the added affect of writing the newly read values into an entity. which wasnāt happening for the voc_index
- alias: Read PM2.5
description: ""
trigger:
- platform: time_pattern
minutes: /1
condition: []
action:
- service: zha_toolkit.attr_read
data:
ieee: <mac_addres_of_the_vindstyrka>
use_cache: false
force_update: true
endpoint: 1
cluster: 1066
attribute: 0
- service: zha_toolkit.attr_read
data:
ieee: <mac_addres_of_the_vindstyrka>
endpoint: 1
manf: 4476
cluster: 64638
attribute: 0
state_id: sensor.air_monitor_voc_index
allow_create: true
Now in theory this should create the entity, but I found it did not, or if it did, the name didnāt match, so I created a Helper template sensor called air_monitor_voc_index
.
- Devices & services > Helpers > CREATE HELPER. Then choose Template > Template a sensor
Name: VOC Index
State template*: air_monitor_voc_index #This is the name that needs to
match the automation
Unit of measurement: leave this blank
Device class: Air quality index
State class: Measurement
Device: Air Quality # This is whatever you named your device
You will see an error, but just ignore it an submit
- Run the Automation and check the Vindstyrka device and you should see a reading. You can customize the name and icon at the device as well.
Hope this helps someone out.