homebridge-controme-thermostat-v2

Raspberry Pi thermostat plugin for homebridge: https://github.com/nfarina/homebridge

Usage no npm install needed!

<script type="module">
  import homebridgeContromeThermostatV2 from 'https://cdn.skypack.dev/homebridge-controme-thermostat-v2';
</script>

README

Homebridge Plugin for Controme

Build Status

Description

This plugin exposes a thermostat to HomeKit and makes it controllable via HTTP requests. The plugin will poll your thermostat at regular intervals and present you with this information when requested. The plugin also allows you so control a number thermostat variables via HomeKit such as the target temperature. This thermostat plugin works on the same RPI where the heating system software works.

Installation

  • Install Homebridge using sudo npm install -g homebridge
  • Install this plugin using: sudo npm install -g --unsafe-perm homebridge-controme-thermostat-v2
  • Run the python script named "fetch.py". You can change the necessary information here. This will generate the config file to the specific path. This file is saved in the specific path. "/home/pi/.homebridge/config.json"

Auto-run script setup

1. Simple usage - /etc/profile

Now we need to tell the operating system to run the script for the Pi user. In the command prompt or in a terminal window type:

sudo nano /etc/profile

Scroll to the bottom and add the following line :

sudo python3 /usr/lib/node_modules/homebridge-controme-thermostat-v2/fetch.py
homebridge

Type “Ctrl+X” to exit, then “Y” to save followed by “Enter” twice.

1.1. A Script Without End

You will only be returned to the command line when your script is complete. If your script contains an endless loop then you may want to use this line in the profile file instead:

sudo python3 /usr/lib/node_modules/homebridge-controme-thermostat-v2/fetch.py &

This will allow the script to run in the background but you will not see any text output from it.

1.2. Reboot and Test

To test if this has worked reboot your Pi using:

sudo reboot

When it starts up your script will run.

2. Complicated usage - crontab

There are some methods to enable this. We are going to use crontab. The crontab file in Linux OS is a daemon that performs user-edited tasks at specific times and events. To edit the file, open a terminal and type "sudo crontab -e" to open your crontab file in the default text editor. At the first available line, type "@reboot xxxx", where "xxxx" is the command you wish to run. Save the file and exit. For example, you can see launcher.sh file in homebridge-controme-thermostat-v2 path. Copy this file to the /home/pi/.homebridge/ path. Now it's time to add command to run.

@reboot sh /home/pi/.homebridge/launcher.sh >/home/pi/.homebridge/cronlog 2>&1

Save this file and reboot the Raspberry pi.

Configuration

For example:

"accessories": [
  {
    "accessory": "Thermostat",
    "id": 5,
    "name": "Arbeitszimmer",
    "password": "test",
    "server": "http://controme.goip.de",
    "username": "testaccount@controme.com"
  }
]