{"id":20447393,"url":"https://github.com/darwinsbuddy/tempsense","last_synced_at":"2026-04-20T09:02:53.692Z","repository":{"id":122069575,"uuid":"512288844","full_name":"DarwinsBuddy/tempsense","owner":"DarwinsBuddy","description":"Connect several DS18B20 1wire temperature sensors to a RaspberryPi and log their measurements or send it to a home assistant","archived":false,"fork":false,"pushed_at":"2023-04-08T13:45:17.000Z","size":3676,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-08T11:06:43.991Z","etag":null,"topics":["1wire","ds18b20","hassio","homeassistant","mqtt","raspberrypi"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DarwinsBuddy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-07-09T21:27:11.000Z","updated_at":"2022-07-10T22:09:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"c1538f75-0e22-4438-8db1-d1adc6f17dda","html_url":"https://github.com/DarwinsBuddy/tempsense","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DarwinsBuddy/tempsense","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarwinsBuddy%2Ftempsense","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarwinsBuddy%2Ftempsense/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarwinsBuddy%2Ftempsense/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarwinsBuddy%2Ftempsense/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DarwinsBuddy","download_url":"https://codeload.github.com/DarwinsBuddy/tempsense/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarwinsBuddy%2Ftempsense/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32040353,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["1wire","ds18b20","hassio","homeassistant","mqtt","raspberrypi"],"created_at":"2024-11-15T10:26:17.844Z","updated_at":"2026-04-20T09:02:53.662Z","avatar_url":"https://github.com/DarwinsBuddy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tempsense\n\nThis project connects several DS18B20 1wire temperature\nsensors to a RaspberryPi.\n\nFollowing features are supported\n\n- [x] Rotation logging (with auto-header)\n  - [x] Supported formats: csv, plaintext\n  - [x] Timezone support\n- [x] Units supported: °C, °F\n- [x] Mocking of sensors (for testing)\n- [x] Map device serial numbers to custom names (device_map)\n- [x] custom interval for temperature measurement\n- [x] (optional) MQTT publishing for Home Assistant integration\n\n## Prerequisites\n\n* [DS18B20 sensors](https://www.amazon.de/AZDelivery-1M-Kabel-DS18B20-Parent/dp/B07ZQNTTX4)\n\u003e several 1wire devices can be connected to a single GPIO pin\n\u003e \n\u003e (default: `GPIO4`, header `7`)\n\n* RaspberryPi\n* `4.7 kOhm` resistor\n* solder iron, etc.\n\nSee `\u003cprojectdir\u003e/doc/DS18B20.pdf` for assembly instructions\n\n\u003cimg src=\"./doc/rpi.jpg\" alt=\"RaspberryPi pinout\" width=\"500\"/\u003e\n\u003cimg src=\"./doc/breadboard_front.jpg\" alt=\"breadboard front\" width=\"500\"/\u003e\n\u003cimg src=\"./doc/breadboard_back.jpg\" alt=\"breadboard back\" width=\"500\"/\u003e\n\n## Install\n\n```commandline\npip install -r requirements.txt\n```\n\n## Usage\n\n```\npython3 -m tempsense -i=\u003cmeasurement-interval-in-seconds\u003e\n```\n\n### Mocking\n\nTo produce test output (random) start with argument `-m`.\n3 fake devices with hardware names `@Mock-1`, `@Mock-2`, `@Mock-3`\nwill return random gauss values.\nTest integration in your systems without fiddling with hardware first. ;)\n\n### rotating file log\nUse `-o=\u003clog-file-path\u003e` to enable rotating file logging, if this argument is omitted `stdout` is chosen as output\n\u003e Options:\n\u003e \n\u003e `-f=(csv | plain)` choose between csv and plaintext\n\u003e\n\u003e `-rb=\u003cbackupCount\u003e` how many log files should be kept after rotating\n\u003e \n\u003e `-ri=\u003crotating-interval\u003e` after which \"time\" rotating takes place\n\u003e \n\u003e `-ru=\u003crotating-interval-unit\u003e` unit of `rotating-interval`\n\n### mqtt (home assistant)\n* Install [mosquitto](https://www.home-assistant.io/docs/mqtt/broker/) Add-On in `home-assistant`\n* Configure it\n\u003e Logins\n\u003e ```\n\u003e - username: \u003cmqtt-user\u003e\n\u003e   password: \u003cmqtt-pw\u003e\n\u003e ```\n* Register your sensors in `configuration.yaml` of home assistant as documented in `homeassistant/configuration.yaml` (`homeassistant/configuration.mock.yaml` resp.) \n* Use it by providing at least `-mqtt=\u003cbroker-ip\u003e`\n\n  use `-user=\u003cmqtt-user\u003e -pw=\u003cmqtt-pw\u003e` (recommended)\n\n\u003e Note:\n\u003e Sensors' mqtt topics are the lower case name with ' ' replaced by '_', e.g. 'My Sensor 123' -\u003e 'my_sensor_123'\n### device mapping\n\nCreate a simple json file and map serial numbers of **your** sensors to\nnames of your desire\n```\n\u003c\u003cEOF \u003e dev_map.json\n{\n  \"28-aaaaaaaaaaaa\": \"Sensor-1\",\n  \"28-bbbbbbbbbbbb\": \"Sensor-2\",\n  \"28-cccccccccccc\": \"Sensor-3\"\n}\nEOF\n```\nUse `-d=./dev_map.json` to map your devices\n\u003e MQTT topic will also be altered accordingly.\n\u003e \n\u003e i.e. instead of\n\u003e \n\u003e `/home-assistant/ds18b20/28-aaaaaaaaaaaa`\n\u003e \n\u003e we publish on\n\u003e \n\u003e `/home-assistant/ds18b20/Sensor-1`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarwinsbuddy%2Ftempsense","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarwinsbuddy%2Ftempsense","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarwinsbuddy%2Ftempsense/lists"}