Giter VIP home page Giter VIP logo

nodemcubot's Introduction

Home automation with a nodemcu v3 via Telegram Bot

Bread board

Requeriments

Install

  • Install libraries: [CTBot] [UniversalTelegramBot] [Adafruit BME280] [Adafruit Unified Sensor] [Adafruit SSD1306] [NTPClient Fabrice] [ArduinoJson] (version 5.13.4 at the time of writing, not the last one because fails to compile!!) [WakeOnLan by a7md0 Version 1.1.6]
  • Follow instructions on how to create a Telegram Bot, via telegram bot BotFather or see examples insiee CTBot library
  • Rename file secrets.h_dist -> secrets.h changing all definitions
  • Connect nodemcu using usb to the computer
  • Configure Arduino Board to "nodeMCU v1.0"
  • Check on Board Manager that ESP8266 is versions 2.7,1
  • Select port (e.g. maybe /dev/ttyUSB0 on linux // maybe /dev/cu_.... on mac)
  • Upload Sketch to nodeMCU ¹
  • Open Serial Monitor
  • Test if messages are sent to the serial port and the OLED screen show information

Issues

¹ On linux maybe is needed to allow write permissions to the USB

sudo chmod a+rw /dev/ttyUSB0

Debug

Some information is sent to serial, so is it possible to check if the wifi is already connected, etc...

Telegram Bot

Example bot output

Telegram Bot

Customize icon, commands via BotFather

List of commands (commands must be lowercase):

motionon - Active motion on OVO
motionoff - Disable motion on OVO
temp - Get temperature of computers
pressure - Get pressure of computers
humidity - Get humidity of computers
altitude - Get altitude of computers
tempovo - Get temp inside cabin
weight - Weight inside cabin
position - Position of cabin
wolpc1 - Start computer PC1
wolpc2 - Start computer PC2

Web Page

Example

REST API

Created a JSON REST API to get weather information (no security!) Change "weather.local" or established hostName to ip if mDNS does not work

GET http://weather.local/api/v1/weather
GET http://weather.local/api/v1/relay/1/on
GET http://weather.local/api/v1/relay/1/off
GET http://weather.local/api/v1/relay/2/on
GET http://weather.local/api/v1/relay/2/off

GET http://192.168.1.46/api/v1/weather
GET http://192.168.1.46/api/v1/relay/1/on
GET http://192.168.1.46/api/v1/relay/1/off
GET http://192.168.1.46/api/v1/relay/2/on
GET http://192.168.1.46/api/v1/relay/2/off

Schema & Parts list

Schema

Schema nodemcu

nodemcubot's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

nodemcubot's Issues

Box

Include space for relay?
3D printed? Look for existing ones.

Degree symbol

° on html page
On display needs use another typography.

Screen at some moment does not show correct values and it is not updated.

Can be:

  • i2c error, because of bus termination
  • i2c error at temperature sensor, need to reset
  • Web page is served
  • REST API works, but return invalid values: {"temperature":-143.2, "humidity":100, "pressure":1154, "altitude":-1114}, API is slow...
  • Time is not updated, seem interesting sent it to API.

Show data from location to compare

Get geolocation from HTML
Call openweathermap from process to get actual data to compare

Compare data from different sensors from the net. All share data yo the other sensors.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.