ebaauw/homebridge-rpi

New temperature sensor

JaKubinaa opened this issue · 3 comments

Hi :)

Would it be possible to add another temperature sensor?

I have a DS18B20 sensor that is also one wire, I would like to use it in the sauna.

The dht22 sensor can't handle it. I need something that can handle higher temperatures than the dht22.

Great plugin, thank you.

ebaauw commented

Don’t know that one. Would you have any technical info on it?

ebaauw commented

From what I can tell, the sensor's GPIO pin cannot be read through pigpio directly, see joan2937/pigpio#60 (comment).

But when 1-wire support is enabled on Raspberry Pi OS, the sensor output is available on a file, /sys/bus/w1/devices/28-00*/w1_slave, which could be accessed through pigpiod. Search for 1-wire on https://abyz.me.uk/rpi/pigpio/examples.html.

I could implement polling the file and parsing its contents relatively easily (similar to polling the files for the LED state). I'm afraid the file name would need to be specified in config.json. Or maybe it would be enough to specify only the device ID, as the file name is derived from that. And, obviously, /opt/pigpio/access would need to be edited manually, to allow access to the file.

Could you please enable 1-wire on your Pi and double-check that a /sys/bus/w1/devices/28-00*/w1_slave file is indeed created? Could you please list the contents of that file (using cat when it context text, or od -c when it's binary)? Could you please check that the contents are updated when the temperature changes?