All Projects → Kirgnition → raspy-temperature-bot

Kirgnition / raspy-temperature-bot

Licence: MIT license
This is a telegram bot hosted by a Raspberry Pi equipped with a temperature and humidity sensor. The bot is capable of sending plots and readings.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to raspy-temperature-bot

plant erd
ERD exporter with PlantUML and mermaid format
Stars: ✭ 126 (+306.45%)
Mutual labels:  sqlite3
five-minute-midas
Predicting Profitable Day Trading Positions using Decision Tree Classifiers. scikit-learn | Flask | SQLite3 | pandas | MLflow | Heroku | Streamlit
Stars: ✭ 41 (+32.26%)
Mutual labels:  sqlite3
imessage-chatbot
💬 Recurrent neural network -- generates messages in your style of speech! Trained on imessage data. Sqlite3, TensorFlow, Flask, Twilio SMS, AWS.
Stars: ✭ 33 (+6.45%)
Mutual labels:  sqlite3
LoginToASqlite3DatabaseWithoutCredentialsWithAdminer
✔️ An Adminer plugin to use SQLite databases without credentials (no username and no password)
Stars: ✭ 30 (-3.23%)
Mutual labels:  sqlite3
docker-sqlite3
Sqlite3 command line in a docker container
Stars: ✭ 28 (-9.68%)
Mutual labels:  sqlite3
versatile-data-kit
Versatile Data Kit (VDK) is an open source framework that enables anybody with basic SQL or Python knowledge to create their own data pipelines.
Stars: ✭ 144 (+364.52%)
Mutual labels:  sqlite3
Mathurat
A text-based Mathurat library
Stars: ✭ 14 (-54.84%)
Mutual labels:  sqlite3
imgui
Dear ImGui Addons Branch = plain unmodified dear imgui plus some extra addon.
Stars: ✭ 348 (+1022.58%)
Mutual labels:  sqlite3
crystal-sqlite3
SQLite3 bindings for Crystal
Stars: ✭ 118 (+280.65%)
Mutual labels:  sqlite3
temperature-machine
Data logger for multiple DS18B20 temperature sensors on one or more machines
Stars: ✭ 56 (+80.65%)
Mutual labels:  temperature-monitoring
go-sqlite
Low-level Go interface to SQLite 3
Stars: ✭ 268 (+764.52%)
Mutual labels:  sqlite3
network performance monitor
Network Performance Monitor - a portable tool for troubleshooting performance issues with home networks
Stars: ✭ 74 (+138.71%)
Mutual labels:  sqlite3
SwiftySHT20
⚡ A Swift library for the I2C SHT20 Humidity and Temperature Sensor.
Stars: ✭ 19 (-38.71%)
Mutual labels:  temperature-sensor
sqlite-spellfix
Loadable spellfix1 extension for sqlite as python package
Stars: ✭ 13 (-58.06%)
Mutual labels:  sqlite3
deep-pmsm
Estimate intrinsic Permanent Magnet Synchronous Motor temperatures with deep recurrent and convolutional neural networks.
Stars: ✭ 29 (-6.45%)
Mutual labels:  temperature-monitoring
Online-News-Portal-with-Django
Daily News For You is an online news portal developed by Django and SQLite
Stars: ✭ 45 (+45.16%)
Mutual labels:  sqlite3
electron-vue3-inote
使用electron11+vue3.x+ts的桌面端便笺项目,拥有漂亮的过渡动画效果,以富文本形式储存在本地,可多开输入窗口。(The desktop note project using electron11+vue3.x+ts has beautiful transition animation effects, stored locally in the form of rich text, and can open more input windows.)
Stars: ✭ 168 (+441.94%)
Mutual labels:  sqlite3
mijia-homie
A Homie MQTT bridge for the Xiaomi Mijia 2 hygrometer-thermometer. This repo also serves as the monorepo for a handful of helper crates related to Homie and Bluetooth.
Stars: ✭ 40 (+29.03%)
Mutual labels:  temperature-monitoring
purescript-node-sqlite3
Basic Purescript wrapper for node-sqlite3
Stars: ✭ 13 (-58.06%)
Mutual labels:  sqlite3
esp8266 homekit temp
Small project to send data from a temperature sensor connected to an esp8266 to a HomeKit server, running on a Raspberry Pi.
Stars: ✭ 38 (+22.58%)
Mutual labels:  temperature-sensor

raspy-temperature-bot

This is a telegram bot hosted by a Raspberry Pi equipped with a temperature and humidity sensor. The bot is capable of sending plots and readings.

graph example

Structure

This project is composed of 3 main files:

  • bot.py is used to host the telegram bot.
  • graph.py contains the Graph class, used to make graphs.
  • sensor.py contains the TemperatureSensor class, used to write and read from the sqlite3 database, as well as the function that reads the temperature and humidity values from the sensor.

bot.py will call both the Graph and TemperatureSensor classes.

Installation

Dependencies

Raspberry Pi setup

To make this project i used a Raspberry Pi Zero W with an AM2302 temperature and humidity sensor.

The humidity sensor has 3 pins:

  • DATA, connected to the GPIO 4 port, it sends the readings to the Raspberry Pi.
  • GROUND, connected to one of the ground ports.
  • VCC, connected to one of the 5V ports.

gpio pinout

Once your sensor is connected to your Raspberry Pi, go ahead and proceed to install a clean version of Raspberry Pi OS Lite.

raspy-temperature-bot installation

To install raspy-temperature-bot:

  1. Ssh into your Raspberry Pi
  1. Clone the repository
git clone https://github.com/Kirgnition/raspy-temperature-bot.git
  1. cd into the repository and install the requirements.
cd ./raspy-temperature-bot
pip3 install -r ./requirements.txt
  1. Paste your bot token in the TOKEN.py file.

  2. Create a service for the temperature sensor:

    1. Create a file called temperature_sensor.service:

      sudo nano /etc/systemd/system/temperature_sensor.service
    2. Paste the following:

      [Unit]
      Description=ROT13 demo service
      After=network.target
      StartLimitIntervalSec=0
      
      [Service]
      Type=simple
      Restart=always
      RestartSec=1
      User=username
      ExecStart=python3 /path/to/sensor.py
      
      [Install]
      WantedBy=multi-user.target
      

      Set your username after User= and the path to sensor.py after ExecStart=.

    3. Enable the service by issuing on the terminal:

      systemctl start temperature_sensor.service
      systemctl enable temperature_sensor.service

      From the moment you start the service a reading will be taken by the sensor every 5 minutes and saved in a sqlite3 database.

  3. Create a service for the telegram bot in an analogous way.

Your bot should be now active, in case of restart both the bot and the sensor will start automatically.

Usage

Once the bot is installed and running, send the /start command on telegram to receive the list of available commands.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].