Skip to content

Instantly share code, notes, and snippets.

View quicklywilliam's full-sized avatar

William Henderson quicklywilliam

View GitHub Profile
@quicklywilliam
quicklywilliam / rest_temp.py
Last active November 25, 2020 18:31
Flask Server for Temperature Sensor and Binary Temperature Threshold Sensor
# Use this along with Home Assistant's RESTful Sensor Platform (https://home-assistant.io/components/sensor.rest/)
# to create a temperature sensor using a Raspberry Pi and a DS18B20 probe.
#
# In my case this was being used in a sauna (using a waterproof probe https://www.sparkfun.com/products/11050)
# so I also wanted a binary sensor that indicated whether the temperature had reached a certain threshold or not.
import os
import glob
import time