ckamps / hubitat-driver-ha7net

Hubitat Drivers for HA7Net and 1-Wire Devices
0 stars 1 forks source link

Distinguish between standalone DS2438 sensors and AAG TAI-8540 sensors #10

Open ckamps opened 4 years ago

ckamps commented 4 years ago

Related to #5, but the parent driver needs to be able to distinguish between standalone DS2438 sensors for which the temperature only child driver is appropriate and the AAG TAI-8540 humidity + temperature sensor that uses a DS2438 sensor as its interface to the 1-Wire network.

Currently, the parent driver misidentifies standalone DS2438 sensors as being humidity + temperature sensors.

ckamps commented 4 years ago

Here's some code from the digitemp application that distinguishes between standalone DS2438 and humidity-capable sensors:

https://github.com/bcl/digitemp/blob/82f50e2d8dce147a89742c2b26dd342a7fd4efd0/src/digitemp.c#L1432

We should be able to dig into that code to learn the low-level interfaces and data needed to distinguish and then update the parent driver to use the low-level interfaces to the HA7Net to do the same. Since we'll be using low-level interfaces on the HA7Net, we'll also use the new locking support of the parent driver for concurrency management.

ckamps commented 4 years ago

More code/logic examples of working at a low level with DS2438 sensors:

https://eds.zendesk.com/hc/en-us/articles/214484863-Working-with-the-DS2438-using-the-HA7E-HA7S

ckamps commented 4 years ago

This issue has been partly fixed via recent commits and merges and tested by a user who has DS2438 sensors.

The current detection is a kludge and needs to be beefed up to more reliably detect standalone DS2438 sensors. Perhaps via low-level interfaces through the HA7Net.