Code Monkey home page Code Monkey logo

nixfilter-rtble's Introduction

nixfilter-rtble

Filter (non-interactive command-line tool reading from STDIN and writing to STDOUT) for controlling the target temperature of an eqiva eQ-3 Bluetooth Smart Radiator Thermostat.

Installation

$ npm install -g --unsafe-perm nixfilter-rtble

Requires Node.js and Bluetooth 4.x capable hardware.

Command-line tools

nixfilter-rtble-temperature

nixfilter-rtble-temperature reads and writes the target temperature of an eqiva eQ-3 Bluetooth Smart Radiator Thermostat. To set the target temperature, write a line with a float value in degrees celsius to the program's STDIN. If the target temperature changes, the program will write the new target temperature to STDOUT.

In order to save the thermostat's battery, the Bluetooth connection will be automatically closed after --auto_disconnect_time seconds of inactivity. In order to also recognize and output manual changes to the target temperature, the program requests status updates every --status_update_time seconds. This requires connecting to the thermostat, so in order to save the thermostat's battery, it is advised to set this value as high as possible, as low as necessary. Or, simply turn status updates off by setting --status_update_time to 0.

$ nixfilter-rtble-temperature -h

usage: nixfilter-rtble-temperature [-h] [--address ADDRESS]
                                   [--auto_disconnect_time AUTO_DISCONNECT_TIME]
                                   [--status_update_time STATUS_UPDATE_TIME]
                            

Control the target temperature of a eQ-3 eqiva radiator thermostat. Reads the 
target temperature to set as input lines from STDIN, outputs the actual 
current target temperature to STDOUT (all temperatures in degrees celsius).

Optional arguments:
  -h, --help            Show this help message and exit.
  --address ADDRESS, -a ADDRESS
                        The MAC address of the radiator thermostat. If 
                        omitted (not recommended), the first radiator 
                        thermostat found will be used
  --auto_disconnect_time AUTO_DISCONNECT_TIME, -adt AUTO_DISCONNECT_TIME
                        The auto-disconnect time, in seconds. A value of 0 
                        will deactivate auto-disconnect (usually not 
                        recommended, drains battery) (default: 1)
  --status_update_time STATUS_UPDATE_TIME, -sut STATUS_UPDATE_TIME, -t STATUS_UPDATE_TIME
                        The status update time, in seconds. A value of 0 will 
                        deactivate status updates (default: 0)

Using nixfilter-rtble-temperature as a Filter

nixfilter-rtble-temperature is intended to be used as a Filter, reading from STDIN and writing to STDOUT. The following command line demonstrates how to make use of this, by using the mosquitto-clients tools (sudo apt-get install mosquitto-clients) to make the radiator thermostat accessable via MQTT:

$ mosquitto_sub -h 192.168.0.12 -t "thermostat/temperature/set" | nixfilter-rtble-temperature -a 00:11:22:33:44:55 -sut 300 | mosquitto_pub -l -r -h 192.168.0.12 -t "thermostat/temperature"

The above command assumes a MQTT broker with IP address 192.168.0.12 and a radiator thermostat with MAC address 00:11:22:33:44:55. In order to set the target temperature, publish a MQTT message like "23.5" (=degrees celsius) to MQTT topic "thermostat/temperature/set". The actual target temperature will automatically be published as retained messages to MQTT topic "thermostat/temperature", and will be checked for changes every 300 seconds.

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.