{"id":15547353,"url":"https://github.com/phseiff/meditemp","last_synced_at":"2025-07-13T16:39:22.645Z","repository":{"id":107724763,"uuid":"436699384","full_name":"phseiff/MediTemp","owner":"phseiff","description":"A program for monitoring the temperature in your medication cabinet and warning you via Telegram when it's too hot or cold - complete with setup instructions","archived":false,"fork":false,"pushed_at":"2022-01-17T21:56:37.000Z","size":1260,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-03T11:22:51.641Z","etag":null,"topics":["gnuplot","telegram","temperature","temperature-logger","temperature-monitoring","temperature-sensor"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phseiff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2021-12-09T17:14:37.000Z","updated_at":"2022-10-14T16:02:14.000Z","dependencies_parsed_at":"2023-04-19T19:17:15.460Z","dependency_job_id":null,"html_url":"https://github.com/phseiff/MediTemp","commit_stats":{"total_commits":9,"total_committers":2,"mean_commits":4.5,"dds":0.2222222222222222,"last_synced_commit":"cdbcf5b42894f250caa39145fb4c2318247c6761"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phseiff%2FMediTemp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phseiff%2FMediTemp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phseiff%2FMediTemp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phseiff%2FMediTemp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phseiff","download_url":"https://codeload.github.com/phseiff/MediTemp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246122971,"owners_count":20726921,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["gnuplot","telegram","temperature","temperature-logger","temperature-monitoring","temperature-sensor"],"created_at":"2024-10-02T13:08:52.244Z","updated_at":"2025-03-29T01:22:18.912Z","avatar_url":"https://github.com/phseiff.png","language":"Python","readme":"\u003c!-- # MediTemp --\u003e\n\n\u003cimg src=\"docs/title.png\" width=\"500px\" alt=\"MediTemp\"\u003e\n\n\u003e A program for monitoring the temperature in your medication cabinet and warning you via Telegram when it's too hot or cold - complete with setup instructions\n\nIf you've ever lived in a one-room-appartment, you know how difficult it can be to keep your medication at a medication-friendly temperature and humidity.\nThere's steam from the kitchen, humidity from the shower, coldness from opening the windows at night and heat from closing them in winter.\n\nMediTemp is a solution -admittedly for linux powerusers mainly- that allows you to monitor the temperature in your medication cabinet using a Linux machine and a small temper usb thermometer connected with an usb cable.\nIt plots the temperature and humidity, one data point every 10 minutes, and stores it in a csv file, and it sends you a notification (e.g. on your phone) via Telegram whenever temperature or humidity fall into bad ranges.\nThere are even instructions on how to get a ringtone from your phone whenever ths occurs (on android)!\n\n## How does this work?\n\nIt's just a small python script that you will have to start (with sudo) everytime your machine starts.\nThis README contains detailed information on how to set up the thermometer and the USB connection to it, how to get these components, how to set up the connection via Telegram, and potentially the ringtone notification if you want to get one everytime the temperature goes out of bounds.\n\n## When will I get warning notifications?\n\nWhenever the temperature is lower than 15°C or higher than 25°C, or when the humidity is higher than 60%.\nYou can change these values by editing the `meditemp.py` file.\nYou can also change the interval in which the temperature is changed in the file (defaults to 10 minutes, checking the temperature more often can cause the temperature device to heat up its surroundings or itself).\n\n## How do I set up the hardware?\n\nYou'll need a TEMPer device, which looks like a USB stick, but contains a thermometer and, in some cases, a humidity sensor that can be accessed by a connected machine.\nThe one I used (for which this program is tested) is the [classic TEMPer device](https://www.amazon.de/-/en/gp/product/B07BFBSF57/ref=ppx_yo_dt_b_asin_title_o05_s00?ie=UTF8\u0026psc=1) which is also pretty affordable (around 15USD), but doesn't offer humidity support; alternatives and how to identify them are listed [here](devices.md).\n\nYou will also need a USB-A plug to USB-A socket cable to connect the TEMPer device to your machine on which you run meditemp;\nthe one I used is [this one](https://www.amazon.de/-/en/gp/product/B00BBPVNFE/ref=ppx_yo_dt_b_asin_title_o02_s00?ie=UTF8\u0026th=1).\nYou could, theoretically, do without this if you store your machine in your medicine cabinet, but I wouldn't recommend this since your machine will emit heat into the medicine cabinet and also heat up the temperature sensor itself.\n\nIt should be mentioned that all of the TEMPer devices measure their internal temperature, so the temperature reported may be higher than the one of their surroundings.\n\n### optional hardware components\n\nIf you want to minimize temperature changes for the emds, you could put them and the thermometer into a thermos bag.\nThis might cause them to get warmer due to the heat generated by the thermometer, though, which might be a problem if your room is already on the warmer side (but might be a positive side effect if it isn't).\nYou should also make sure to only open the bag under good temperature conditions if you do this, since otherwise you'll end up keeping your meds at suboptimal temperatures longer than needed with this bag.\n\n## How do I set up the software?\n\n### Like this (bash):\n\n```bash\n# Clone the repo\ngit clone git@github.com:phseiff/MediTemp.git\ncd MediTemp\n# or like this:\n# git clone https://github.com/phseiff/MediTemp.git\n\n# make sure gnuplot is installed\n# if you don't want your temperature plotted you can skip this\nsudo apt-get install -y gnuplot\n\n# install telegram-send and set it up\n# if you don't want warning notifications you can skip this\nsudo pip3 install telegram-send\ntelegram-send --configure\n# you will now have to go to https://telegram.me/BotFather to\n#  create a bot, and paste the bot token; just follow the \n#  instructions telegram-send gives you on this.\n```\n\n### You should then run the following command, to test if everything works right:\n```bash\nsudo python3 meditemp.py \\\n    --no-gnuplot `# \u003c- only if skipped the gnuplot step above` \\\n    --no-notif `# \u003c- only if you skipped the telegram-send step` \\\n    #--no-log `# \u003c- disables error log - not recommended!!!` \\\n```\n\n### What should happen now are the following things:\n\n1. You should get a temperature log printed in the console, one line every 10 minutes, like this: `12/28/2021, 01:43; 24.56`\n2. A file called `med_temp.csv` will be created, in which the temperature is logged, each line being in a `\"time[%m/%d/%Y, %H:%M]; temp[°C]; humidity[%]` format.\n3. A file called `meditemp-log.txt` will be created, in which, if `--no-log` isn't set, errors and the time they occurred will be logged.\n   None of these errors will ever crash the program.\n4. If `--no-gnuplot` isn't set, a file called `med_temp.html` should be created, which you can open in your browser to see how the temperature changed over time.\n   You can change `meditemp.gnuplot` to midufy how the plot looks like.\n   \u003cdetails\u003e\u003csummary\u003eClick here to see an image of the plot.\u003c/summary\u003e\n\n   As you can see, the temperature is plotted in blue with blue boundaries around the \"healthy\" area, and the humidity is plotted in brown, with an upper bound for the \"healthy\" area in brown.\u003cbr/\u003e\n   ![demo image of the plot](docs/plot-demo-image.png)\n   \u003c/details\u003e\n5. If `--no-notifs` isn't set and the temperature or humidity falls out of bounds, you should receive a telegram notification from the bot you created that goes like `Temperature alert: 25.18°` or like `Humidity alert: 61%`.\n\nAll of the files created by meditemp are persistent throughout all runs (restarting doesn't overwrite their content, instead adding to it), and updated everytime temperature and humidity are measured, not just when the program is exited.\nThe program runs with sudo (otherwise connecting to the thermometer won't work for some reason), but all files are saved and created with the local user as their owner.\n\n### Setting up an alarm for notifications\n\nIf you are on android and want to get a ringtone whenever you get a notification, you can either set custom notifications for the bot (this should work in iOS too) by going into your chat with the bot, clicking the bot's name, clicking on \"Notifications\" and choosing \"Customize\", then customizing, or you can use [an app called Message Alarm](https://play.google.com/store/apps/details?id=com.app.messagealarm) which allows you to set specific notifications (as in, ringtones) for specific telegram contacts (such as your bot).\nYou have to add Telegram to the applications tracked by the app to achieve this, and then add the username (not the handle!) of your bot to the tracked users.\n\n### Starting meditemp with every system restart\n\nrun\n\n```bash\nsudo nano /bin/rc.local\n```\n\n(you might have to enter your root password) and then add\n\n```bash\nsudo python3 [absolute path to meditemp]/meditemp.py [optional arguments] \u0026\n```\n\nbefore the `exit 0` and after the shebang and anything else in the file (the ampersand is important).\n\nThen press \u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eX\u003c/kbd\u003e and press \u003ckbd\u003ey\u003c/kbd\u003e and \u003ckbd\u003eEnter\u003c/kbd\u003e.\n\n## What to do in case of bugs?\n\nIf you encounter a bug please report it with the entire relevant parts of `meditemp-log.txt`, as well as the command you used.\nIf you encounter an error with `--no-logfile` and do not have the error message from your console, please try to replicate the error without `--no-logfile` before reporting the issue so you can share the log.\n\nHumidity detection is untested and I am not really able to debug anything specific to it due to me not owning the relevant hardware;\nif you encounter or see an issue related to it feel free to help by creating a pull request that fixes the issue.\n\nThe program is tested in Ubuntu 18.04, in case that's relevant for you.\n\nIssues are welcome, pull requests for bugfixes are also welcome, starring this repo to show your appreciation is especially welcome! ⭐\n\n## DISCLAIMER OF LIABILITY\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\nSIMILARLY, ANY HARDWARE RECOMMENDATION OR SUGGESTION IS PROVIDED \"AS IS\",\nWITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\nTO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT, OF BOTH THE HARDWARE AND THE SUGGESTED USE FOR THE HARDWARE.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS OF THIS DOCUMENT BE LIABLE\nFOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE HARDWARE\nMENTIONED AND THE HARDWARE MENTIONS IN THIS DOCUMENT.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphseiff%2Fmeditemp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphseiff%2Fmeditemp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphseiff%2Fmeditemp/lists"}