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] Please add Support for CO2 sensor in Titan TPZRCO2TH-Z3 #792
Comments
I'm unsure which bits are needed, I think this is the whole pairing / setup sequence.
I'm going to read through the docs on this site and have a go, but if anyone else can do this, it would be great ! |
The only non standard cluster is 0x040d cluster. I wonder if that one is the co2 measurement. |
Yes it is. It’s linked in the docs as a concentration cluster. I think the battery one must me a bit non standard too as it doesn’t report the battery level properly. That’s not as big a deal. |
ah, missed that on the mobile. Kudos to the vendor for providing that information.
and then a custom device with a replacement for 0x040D cluster_ID using the GacConcentration class. See https://github.com/zigpy/zha-device-handlers#what-the-heck-is-a-quirk for more info |
That’s great. I’ll take a look |
Hi,
Do you know of any similar devices I could look at to figure this out.
I kind of follow the logic of what quirks do. But it looks pretty heavy. If I could find a similar device I might have a better chance.
Thanks.
|
I've raised an issue on Zigpy itself as I'm unsure if the ConcentrationCluster should be added into measurement.py to make products such as this work ? Is that the right thing to do, or should it just be handled as a quirk ? |
No, zigpy only contains standard clusters included in ZCL specification. So unless it was included in ZCL revision 7 it does not belong to zigpy |
ok, I've hacked this together.............. Thanks in advance........
|
Thanks. |
for the signature, the
The replacements, in your case is going to match the signature mostly exactly, with the exception of the gas cluster only. Since you want to replace it with your copy, you have to reference it by the "class" instead of a cluster id:
|
|
Is the order of this line important.......
In the log it shows them in this order, rather than in numerical order. |
Order is not important. Usually quirks have clusters in numeri orders and constant names following the numeric order. Thanks for the picture. Looks like this one https://sstsensing.com/product/cozir-lp2-ambient-air-co2-sensor/ |
ok, so more stupid questions. I've enabled zigpy debug. So where do I put the quirk file ? I'm running....
Thanks very much for your help. |
Agreed, it looks exactly like that. |
This is the whole file I've got........ TPZRCO2THZ3.py
and init.py
|
Hang on, I might have found it, let my fight with it for a bit before you give me the answer ! :-) |
If running HassOS, try https://github.com/zigpy/zha-device-handlers#testing-quirks-in-development-in-docker-based-install Usually I just get access to HassOS dev console (not the ssh add-on one), gives you access to the docker. From there inside the home assistant container |
Thanks, I did it through portainer add-on. Fingers crossed !! |
the first step is getting the quirk recognized. Second would require some mods to ZHA |
I've run out of home automation time tonight. The suspense !! |
Ok, I have progress. I ended up with..............
The log when I pair the product now says...............
Thoughts ? Thanks |
go to device page, pick the device -> Manage Clusters, Pick GasConcentration and then get value for the "measured_value" attribute. What do you get? |
Is the drop down empty? |
Yes, drop down empty. Other quirk files say: Whereas, ours says vendor_attributes should I change this ? |
were you able to read |
battery_percentage_remaining (0x0021) - None |
CO2 still reporting nan :-( |
|
well, apparently they do not support the
|
May want trying to get any one technical from the vendor and ask them if anything special needs to be done. |
I had emailed the vendor already, this was their response..... The sensor will return 0x7fc00000 if the 0x040d cluster is not bound. Can you confirm that you have you bound the CO2 cluster? We use Single-precision floating-point because this is the type specified by Zigbee Cluster Library specification for the concertation cluster. I've asked if they would expect it to return the max and min values in this situation. Thanks |
If I ask it to bind from the UI, I get this in the log....
|
Perhaps trying binding from the device card to the coordinator. or if its not working thee cluster to group 0x000 (coordinator group) ? Is the sensor sleeping or do it listening and executing the command ? |
Sorry, you've lost me a bit. I can forget the device, then discover it. When you bind from the UI are you binding a device? or a cluster? On my bindable devices list I just see my conbee USB stick. On the clusters list I see all clusters incl. the gas concentration one. Sorry if I'm being a bit thick, but what do I do to bind it or to diagnose it ? Thanks |
Binding is not pairing the device. I think ZHA is not doing any binding on your device then the devs have not "knowing its needs" so you need binding it manually. Try binding it to your coordinator and look in the log if you can see its being bonded. And if you is waiting little is normally Adminiuga coming back after his night rest (US TZ) and hi is knowing all the best. I still finding it very interesting getting your CO2 sensor being supported !! |
Do you get an extra entity for this device for the 0x040D cluster?
For ZHA to bind that cluster, ZHA needs to have a "sensor" mapping. zha/sensor.py maps a cluster to a channel, and channel does the binding. |
Turns out ZCL revision 7 does specify a bunch of Gas Concentration clusters |
Would need to add those to zigpy then. Maybe next release |
Don't try the binding from UI, as I'm not positive it would work correctly for these types of clusters. ZHA binds measurement clusters on device join or on clicking the "reconfigure button". Although some devices don't really like to be configured multiple times, so for now just reset the device and re-pair it, assuming you do get the sensor entity for 0x040d cluster |
ok, I've manually patched zigpy on my installation. I've added......
I'm on core-2021.3.1 I've dropped the quirk for now, as I'm not sure if it is required now zigpy has been updated.
in measurement.py I have added:
Pairing Log is now.........
I've attached debug log. What should I do next? Thanks. |
I forgot about https://github.com/home-assistant/core/blob/864380e77c277b58ab4a85f5d1d3c023b31cf4c7/homeassistant/components/zha/core/registries.py#L57-L78
and you already modified the |
Well I have an entity now ! yay !! Did a remove and repair and it has a value now ! Amazing ! Thank you so much. So how do we get all of this into a pull request ? |
should it have a suitable icon ? |
I don't think HA has defined a device class for Carbon Monoxide, so for now the icon should be overriden through customization. see home-assistant/architecture#520 |
That's fine. |
I've created a branch here: with all the concentration clusters added into the various files. zha/sensor.py I was going to try and submit a pull request, but I'm a bit out of depth. Could someone with more knowledge please look if they can be submitted. |
So from the github, from you repo and the branch with the updates, you should be able to click on the "Pull Request" link/box and create the PR. |
ok, I've created the Pull request, hope it's ok. |
Got some validation errors on the pull request, I think I've fixed them and checked them into the branch. |
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. |
Is your feature request related to a problem? Please describe.
Please add support for the CO2 measurement feature of the Titan Zigbee 3.0 C02 sensor.
I seem to be able to see Humidity and Temperature already.
But the battery level doesn't report properly and I don't see the CO2 level at all.
Product Page
Device signature - this can be acquired by removing the device from ZHA and pairing it again from the add devices screen. Be sure to add the entire content of the log panel after pairing the device to a code block below this line.
Additional context
Add any other context or screenshots about the feature request here.
Endpoint Cluster Attribute Manual Attached
The text was updated successfully, but these errors were encountered: