Git Product home page Git Product logo

mijiav2's Introduction

MijiaV2

Bash script that allows to query several MijiaV2 sensors one by one and the information is sent to influxdb.

2 scripts available, the poller and the init.d.

source of inspiration: https://www.fanjoe.be/?p=3911

Prerequisites

Update your raspberry :

  • Update the raspbian distribution : sudo apt update & sudo apt upgrade
  • update the firmware : sudo rpi-update

Integration :

  • copy the files directly into their respective places and make them executable :

curl https://raw.githubusercontent.com/jbsky/MijiaV2/master/sbin/mijiav2 -o /usr/local/sbin/mijiav2

curl https://raw.githubusercontent.com/jbsky/MijiaV2/master/init.d/mijiav2 -o /etc/init.d/mijiav2

chmod +x /usr/local/sbin/mijiav2 & chmod +x etc/init.d/mijiav2

Configuration :

In /usr/local/sbin/mijiav2, at the beginning of the file :

  • change addMAC , please quote the addresses : ex: addMAC = ("AA:BB:CC:DD:EE:FF" "11:22:33:44:55:66")

  • Add label corresponding for each MAC address, of course with the same constraints. : ex: ("Vitre\ Salon" "Salon" "Chambre\ Mathilde" "Chambre\ Parent")

  • change influxDB IP : influxDB="192.168.10.182:8086"

  • change the name of the influxDB database : _db="temperature"

Execution :

  • Simply as a service : sudo systemctl start mijiav2.service

Execute at boot time

  • Enable the service : sudo systemctl enable mijiav2.service

Conclusion :

It is a simple solution to capture data from these small sensors from Xiaomi.

It doesn't wait stupidly after a timeout, this is made possible by a file that counts lines every second.

Limitation:

no multiple parallel connection, no threading. Without saying anything stupid, I don't think the raspberry's bluetooth supports it.

mijiav2's People

Contributors

jbsky avatar

Stargazers

 avatar Jérôme BONIN avatar

Watchers

James Cloos avatar

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.