Giter Site home page Giter Site logo

ruuvidriver's Introduction

ruuvidriver


๐Ÿ‘‰ โš ๏ธ This project is no longer under active development as of December 2022.


Serves your Ruuvitag Weather Station data over HTTP.

Tested on Raspberry Pi 3 with Raspbian and Node 9 from Nodesource.

Usage

  • yarn
  • yarn start
  • Visit http://127.0.0.1:52020/tags. Any Ruuvitags in your device's vicinity should start showing up.

โ„น๏ธ You'll get higher resolution data if your Ruuvitag is in Raw mode. You can toggle this by pressing the B button on your tag. See the "RAW mode" section in the Ruuvitag Firmware docs.

Not seeing tags?

If you're running Ruuvidriver as a regular user on Linux, the Node.js binary needs a capability to be allowed to do BLE things.

An easy way to set the CAP_NET_RAW capability required is

sudo setcap cap_net_raw+eip $(eval readlink -f `which node`)

but be certain you understand what this means for other programs using the same Node.js binary.

Endpoints

All tags (/tags)

All tags, as a mapping:

{
  "beefbeefbeef": {
    "dataFormat": 3,
    "rssi": -73,
    "humidity": 21,
    "temperature": 21.72,
    "pressure": 100664,
    "accelerationX": -64,
    "accelerationY": -44,
    "accelerationZ": 1020,
    "battery": 2935,
    "ts": 1521542394667
  }
}

Single tag (/tag/:id (i.e. /tag/beefbeefbeef))

As above, but the given tag's data only.

{
  "dataFormat": 3,
  "rssi": -73,
  "humidity": 21,
  "temperature": 21.72,
  "pressure": 100664,
  "accelerationX": -64,
  "accelerationY": -44,
  "accelerationZ": 1020,
  "battery": 2935,
  "ts": 1521542394667
}

Configuration

Configured via environment variables or a .env file via dotenv.

  • RUUVI_PORT: Port to serve on. Defaults to 52020.

Usage with Home-Assistant

Ruuvidriver is trivial to integrate with home-assistant.

A RESTful sensor configuration for humidity, pressure, temperature and Ruuvitag voltage looks like this.

(Replace beefbeefbeef with your tag's ID, and the IP address/port with something else if your home-assistant is not on the same device as Ruuvidriver, or if you configured the port above.)

- platform: rest
  resource: http://127.0.0.1:52020/tag/beefbeefbeef/
  name: Magic Mystery Room Temperature
  value_template: "{{ value_json.temperature }}"
  unit_of_measurement: "C"
  force_update: true
- platform: rest
  resource: http://127.0.0.1:52020/tag/beefbeefbeef/
  name: Magic Mystery Room Humidity
  value_template: "{{ value_json.humidity }}"
  unit_of_measurement: "%RH"
  force_update: true
- platform: rest
  resource: http://127.0.0.1:52020/tag/beefbeefbeef/
  name: Magic Mystery Room Ruuvi Voltage
  value_template: "{{ value_json.battery }}"
  unit_of_measurement: "mV"
  force_update: true
- platform: rest
  resource: http://127.0.0.1:52020/tag/beefbeefbeef/
  name: Magic Mystery Room Pressure
  value_template: "{{ value_json.pressure }}"
  unit_of_measurement: "kPa"
  force_update: true

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.