Giter Site home page Giter Site logo

roadsnail / pi-ve Goto Github PK

View Code? Open in Web Editor NEW
32.0 5.0 1.0 1.03 MB

Raspberry Pi Zero W Controls Hive SLR/SLT using Zigbee and Wifi networks- A Standalone Heating/Hot water Control solution without the British Gas Cloud

License: GNU General Public License v3.0

pi-ve raspberry-pi node-red message-broker boiler-controller thermostat hive zigbee mqtt zigbee2mqtt

pi-ve's Introduction

Pi-ve

A Raspberry Pi Zero W controls a Hive Active Thermostat (SLTx) /Boiler Controller (SLR2) - A standalone Central Heating (CH)/ Hot Water (HW) control solution (without the British Gas 'Cloud').

Control your Central Heating/Hot Water boiler on your local network using Pi-ve from:-

  • Node-RED Dashboard (runs in a Web browser from a device on your network) to control Heating/Hot water functions
  • HTTP Requests (GET and/or POST Methods)to view control Heating/Hot water functions
  • MQTT Messages published to Pi-ve's Mosquitto dedicated message broker

The Node-RED dashboard Web page offers full control of CH and HW with up to 8 programmable 'On' periods per day plus Override/Boost functions.

In addition, the Pi-ve may be controlled using MQTT commands OR HTTP Requests from an external system (eg. A Home Automation platform or phone/tablet app).

Pi-ve_1

Pi-ve System - SLR2, Zigbee USB Stick (attached to Raspberry Pi Zero W), SLT2

But why go to the trouble of controlling Hive Active from a Pi when it's easy to use the Hive Hub and control heating and hot water from the Hive App?

Well, the main reason I have taken this approach is to remove my dependence on the Hive Cloud and have full local control over my boiler even during Hive system outages, (yes they do happen), and ISP/Internet issues.

The second reason is to remove any dependency my Home Automation system has on Hive's undocumented APIs which may change without notice. I have been caught out twice in the past when British Gas made changes.

Lastly, British Gas may decide at some time to stop supporting Hive Active. If or when that happens, my Hive investment will continue working.

And lastly lastly, I have enjoyed the new challenges of 'coding' in node-RED and hacking together the javascript to enable the web interfaces into Pi-ve.


Contents

  1. What is Pi-ve
  2. Where can I get my very own Pi-ve?
  3. Can I use a Raspberry Pi 3 or 4?
  4. The Pi-ve Dashboard - Set up CH/HW 'On' Timers, 'Boost' and Control your Heating/Hot Water from your Pi-ve
  5. The Pi-ve HTTP Screen - Control Pi-ve with HTTP requests
  6. Control Pi-ve with HTTP GET Request using curl
  7. Control Pi-ve with HTTP request method POST
  8. Control Pi-ve by Publishing to Topics on Pi-ve Mosquitto Message Broker
  9. Software/Firmware Sources
  10. Pi-ve software configuration
  11. Review Progress and Check Software Components
  12. Configure Hive Active SLR/SLT - Factory Reset and Join Pi-ve Zigbee Network
  13. node-RED - Import flow
  14. Pi-ve Dashboard Timed Off/On Slots (in timer (TMR) Mode)
  15. Attributions

What is Pi-ve?

Pi-ve =

Hardware:

  • 1 off Raspberry Pi Zero W (kit inc. Case and micro-USB cable) + PSU + micro SD card
  • 1 off Zigbee USB Controller (eg. CC2531) + USB Housing +
  • British Gas Hive Active Heating Thermostat/Boiler Controller (models SLR2/SLT2) or (models SLR2/SLT3). The Hive Active Hub is NOT required.

Software:

Firmware:


Where can I get my very own Pi-ve?

Disclaimer - WARNING - If you intend to play along with this project, be very aware that the Hive SLR Boiler Controller will require connecting to a mains electricity supply and that the connections to the controller's Central Heating and Hot Water terminals will be switching at mains voltage! Get it wrong, or touch the wrong parts and serious injury or death may result! Also, keep it well away from children and pets whilst developing and testing this. You have been warned. If uncertain how to connect the Boiler Controller (SLR2), then obtain advice/assistance from a qualified person.

If you are confident and happy with the warning above and want to make your own Pi-ve, then here is a list of parts:-

  • The Hive Active components, the SLT (Thermostat) and SLR2 (Boiler Controller), are easily obtained used from the usual Internet auction places. The Hive Active hub is not required as this will be replaced by the Raspberry Pi. Although the above picture shows the older Hive Active Thermostat (Model SLT2), the newer model SLT3 may be used instead.

  • A Pi Zero W was a freebie when I subscribed to the excellent MagPi magazine. See https://magpi.raspberrypi.org/. Alternatively, these are readily available as a kit including a case and a USB OTG Host cable.

  • A Zigbee USB dongle - I used the ubiquitous CC2531 Zigbee board and programmed it with Koenkk firmware. The picture above shows one of these modules with an antenna enclosed in a USB shell (red) that I had in my parts bin.

Next - Add about 1 day to download and configure the software

Result - A standalone Heating/Hot Water Controller, lots of fun, and a chance to learn how to configure a Pi, MQTT broker, Node-RED and Koenkk's Zigbee2MQTT software/firmware

Alternatively, buy a Hive Active system and install it, but where's the fun and education in that?


Can I use a Raspberry Pi 3 or 4?

Yes, of course. Model 3 and 4 have onboard Wifi making them very suitable for this project. The reason I chose a model Zero W was it has onboard Wifi allowing me to place it somewhere convenient where it is in good Zigbee network range for the SLR/SLT and Wifi range. I also had one surplus to requirements. In addition, my Pi-ve runs an additional task of listening to my Bluetooth LE thermometers and relaying temperature data to my Home Automation system. But that's another story...


The Pi-ve Dashboard - Set up CH/HW 'On' Timers, 'Boost' and Control your Heating/Hot Water from your Pi-ve

The below screenshot shows the Pi-ve status/control web page created in node-RED and running on the Pi Zero. Just connect to the node-RED dashboard from a browser on your network and browse to URL http://your-pive-ip-address:1880 (inserting your Pi-ve actual IP4 address of course).

It shows the current status of the Pi-ve, online, current time, plus the current temperature/thermostat setting and CH/HW Off/On and 'Demand' states.

2021-05-19 23_21_24-Node-RED Dashboard Example Pi-ve Dashboard screenshot showing Pi-ve 'online', room temperature 19.53 deg C, thermostat setting 20 deg. Hot Water has been boosted with 28:33 minutes remaining. Looking at the CH Time Slots for the current time (23:21) CH is programmed to 'On' with a Thermostat setpoint of 20 deg C, however, 'Override' is active forcing CH Off (indicated by the green 'Override State' LED). The HW 'Demand' icon is active (on - not greyed out), however the CH icon is greyed out thus inactive (off) and red LED state

  • 'Manual' or 'Timer' modes for heating and water.

  • Heating and Water Off/On switching.

  • Timed 'On' periods for 7 days and up to 8 programmable 'On' periods per day (Time Slots) are available for boiler control of heating and hot water. A thermostat setpoint value can be set for each 'On' Time Slot period allowing CH thermostat settings to be changed during a 24hr period.

  • An 'Override Timer' function is available allowing the current state of CH or HW to be changed for the duration of a time slot (either off to on OR on to off).

  • A 'Boost' function allow for a 30 minute, 60 minute or 90 minute 'heat on' function for heating and/or water.

    • Hot water boost will switch on the HW relay for the selected period. 30/60/90-minutes. 'Cancel' will cancel the last boost period selected.
    • Similarly, Heating boost will set the thermostat setting to the current temperature plus 1 deg C for the selected period and 'Cancel' will cancel the last boost period.

The Pi-ve HTTP Screen - Control Pi-ve with HTTP requests

A screenshot showing Off/On, Manual/Timer Mode and Boost buttons on a simple browser screen that allows for easy control from a smartphone/tablet by pointing your browser to http://your-pive-ip-address:1880/ctrl/page

Pi-ve-HTTP

Example of /ctrl/page showing Pi-ve room temperature 18.94 deg C, thermostat setpoint 20 deg C. Both Heating and Water demand is 'On' and SLR2 outputs set to demand 'heat' from the attached boiler. 'Timer' is active for water, while 'Boost' is active for a further 59:04 minutes for heating.

This allows basic control of the Pi-ve without the 'Time Slot' editing functions provided by the Node-RED Dashboard screen. Although not offering Time Slot editing functions, it is better optimised for small screen devices.


Control Pi-ve with HTTP GET Request using curl

Basic control of Pi-ve from a simple HTTP GET request command:-

Thermostat setpoint

Central Heating

Hot Water


Control Pi-ve with HTTP request method POST

Pi-ve may be controlled using HTTP JSON formatted requests:-

POST HTTP://your-pive-ip-address:1880/cmd with Content-Type: application/json

List of valid payloads below (in and including the curly brackets). eg. To switch the HW output to off, POST json {"HW":"Off"}

Thermostat setpoint

  • {"SP":"22.5"} Set Thermostat setpoint to 22.5 degrees C. (Range 1-30, Increments 0.5)

Central Heating

  • {"CH":"Off"} Set CH Switch to Off
  • {"CH":"On"} Set CH Switch to On
  • {"CHBoost":"30"} Set CH Boost for 30 mins
  • {"CHBoost":"60"} Set CH Boost for 60 mins
  • {"CHBoost":"90"} Set CH Boost for 90 mins
  • {"CHBoost":"Off"} Set CH Boost off
  • {"tmrActive":"CH"} Set CH Mode to Timer
  • {"manActive":"CH"} Set CH Mode to Timer

Hot Water

  • {"HW":"Off"} Set HW Switch to Off
  • {"HW":"On"} Set HW Switch to On
  • {"HWBoost":"30"} Set HW Boost for 30 mins
  • {"HWBoost":"60"} Set HW Boost for 60 mins
  • {"HWBoost":"90"} Set HW Boost for 90 mins
  • {"HWBoost":"Off"} Set HW Boost off
  • {"tmrActive":"HW"} Set HW Mode to Timer
  • {"manActive":"HW"} Set HW Mode to Timer

Control Pi-ve by Publishing to Topics on Pi-ve Mosquitto Message Broker

In addition to the above control methods, Pi-ve may be controlled by publishing control payloads to Topics on Pi-ve's Mosquitto Message Broker:-

List of valid payloads below. eg. To set the Thermostat setpoint to 22.5 deg C, publish to the MQTT message broker at host Pi-ve, topic pive2mqtt/SLRCtrl/savedSP payload 22.5

Thermostat setpoint

  • Topic pive2mqtt/SLRCtrl/savedSP payload 22.5 - Set Thermostat setpoint to 22.5 degrees C. (Range 1-30, Increments 0.5)

Central Heating

  • Topic pive2mqtt/SLRCtrl/CHOffOn payload off - Switch Heating off
  • Topic pive2mqtt/SLRCtrl/CHOffOn payload heat - Switch Heating on
  • Topic pive2mqtt/SLRCtrl/CHManAuto payload tmrActiveCH - Set Timer Mode
  • Topic pive2mqtt/SLRCtrl/CHManAuto payload manActiveCH - Set Manual Mode

Central Heating

  • Topic pive2mqtt/SLRCtrl/HWOffOn payload off - Switch Hot Water off
  • Topic pive2mqtt/SLRCtrl/HWOffOn payload heat - Switch Hot Water on
  • Topic pive2mqtt/SLRCtrl/HWManAuto payload tmrActiveHW - Set Timer Mode
  • Topic pive2mqtt/SLRCtrl/HWManAuto payload manActiveHW - Set Manual Mode

Software/Firmware Sources

Your Pi-ve will require the following software/firmware. Here is a list of software sources and brief instructions for installing the necessary software. I suggest installing and configuring the software in the order below, ensuring that things work properly at each stage of your build.

Some guidance on software configuration is included in the next section (below).

Firmware

Other Zigbee USB solutions may be used for this project. I just happened to have a CC2531 surplus to requirements as I have upgraded my main Zigbee network controller to a TI CC2652R based module. In my experience, the CC2531 is great at controlling just a few Zigbee devices but struggles with larger Zigbee networks. In this application, the CC2531 copes easily with just two Zigbee connections (the Hive SLR and SLT).

Software

Raspberry Pi OS

https://www.raspberrypi.org/software/operating-systems/ . There are plenty of guides explaining how to install Raspberry Pi OS onto the Pi Zero W so that you may connect in 'headless' mode.

Following the installation of the OS, connect to your Pi and run raspi-config (sudo raspi-config) and:-

  1. Set a new password for user Pi (mandatory)
  2. Set a Hostname for your Pi. I suggest Pive.
  3. Expand Filesystem (optional)

Mosquitto MQTT Message Broker for Raspberry Pi

Mosquitto and clients can be installed from the Pi OS repository. In essence, login to your Pi as user Pi, then...

sudo apt update
sudo apt upgrade
sudo apt-get install mosquitto mosquitto-clients

Node-RED

See the official install guide here https://nodered.org/docs/getting-started/raspberrypi . Login as user Pi and in the home directory run the command given on the guide page. This will take some time on the Raspberry Pi Zero.

Zigbee2mqtt (V1.19.1)

Follow the Official installation guide at https://www.zigbee2mqtt.io/getting_started/running_zigbee2mqtt.html AFTER reading the next two tips:-

  • Step 2 of the guide - Installing - instructions to install Node.js may be omitted as this will have been installed earlier during the node-RED install.

  • Also in section 5 of the official guide, the instruction that refers to the installation of Zigbee2MQTT on a Pi 1 or Zero and modification of ExecStart should be ignored

Installation of Zigbee2mqtt will take a few minutes, with many warnings thrown up. Don't panic, these may be ignored.

Zigbee2MQTT software should start correctly after following the official installation guide, however in addition to the configuration settings (in the official guide), please take note of the additional configuration notes in the Zigbee2MQTT software configuration section below. including instructions on how to revert the latest version (installed above) to the tested version (v1.19.1).


Pi-ve software configuration

  • Raspberry Pi OS

Post-install configuration discussed above

  • Mosquitto MQTT Message Broker for Raspberry Pi

Create Mosquitto Configuration file located at /etc/mosquitto/mosquitto.conf, suggested contents

# Place your local configuration in /etc/mosquitto/conf.d/
#
# A full description of the configuration file is at
# /usr/share/doc/mosquitto/examples/mosquitto.conf.example

pid_file /var/run/mosquitto.pid

persistence true
persistence_location /var/lib/mosquitto/

log_dest file /var/log/mosquitto/mosquitto.log

include_dir /etc/mosquitto/conf.d
  • node-RED

Following installation, set the SYSTEMD to start node-RED at startup thus:

pi@pive:~ $ sudo systemctl enable nodered
Created symlink /etc/systemd/system/multi-user.target.wants/nodered.service → /lib/systemd/system/nodered.service.
pi@pive:~ $
pi@pive:~ $ sudo systemctl start nodered

Reboot your Pi-ve and ensure node-RED is started by pointing a browser at http://your-pive-ip-address:1880 and ensure node-RED responds with an empty flow screen.

Next, install some additional node-RED nodes required by the Pi-ve flow (when we install it later).

These may be installed at the node-RED flow creation screen by selecting 'MENU' - Manage palette

Select the 'Install' tab.

For each of the nodes listed below, enter the name into the 'search' field, then when the node is found and displayed, click 'install'

List of additional nodes:-

node-red-dashboard
node-red-node-ui-list
node-red-contrib-ui-led
node-red-contrib-ui-media
node-red-contrib-simple-gate
node-red-contrib-moment

Lastly, install some icon graphics used by the node-RED dashboard to indicate the SLR online and CH/HW demand status.

Copy file Pive-images.tar.gz from the repository into user Pi home directory

Then enter the following tar command to unzip the images into node-RED.

pi@pive:~ $ tar -xzvf  Pive-images.tar.gz
./.node-red/lib/ui-media/lib/Images/
./.node-red/lib/ui-media/lib/Images/slr2-online.png
./.node-red/lib/ui-media/lib/Images/manActiveHW.png
./.node-red/lib/ui-media/lib/Images/HW_On.png
./.node-red/lib/ui-media/lib/Images/slr2-offline.png
./.node-red/lib/ui-media/lib/Images/tmrActiveCH.png
./.node-red/lib/ui-media/lib/Images/HW_Off.png
./.node-red/lib/ui-media/lib/Images/tmrActiveHW.png
./.node-red/lib/ui-media/lib/Images/CH_On.png
./.node-red/lib/ui-media/lib/Images/manActiveCH.png
./.node-red/lib/ui-media/lib/Images/CH_Off.png
  • Zigbee2mqtt

If you have successfully followed the official Zigbee2MQTT installation notes earlier, your Pi-ve should have started Zigbee and made a connection to the Mosquitto Message broker running on the Pi.

The Pi-ve node-RED flows have been tested on version 1.19.1 of zigbee2mqtt which is a slightly older version currently (26th Aug 2021) available from the github repository and it is highly recommended that you should git reset your installation to that version. This will only take a few minutes.

So run the following commands to stop zigbee2mqtt (just in case it is running), git reset to the version 1.19.1 commit hash, install dependencies then restart zigbee2mqtt....

cd /opt/zigbee2mqtt
sudo systemctl stop zigbee2mqtt

# Revert to version 1.19.1
git reset --hard 9bd46932c365e886ed0b1f9b8740d8cce632230c

# Install dependencies (as user "pi")
# This will take a few minutes, ignore warnings
npm ci

sudo systemctl start zigbee2mqtt

Zigbee2MQTT Configuration - Additional Steps

Make the following additions to the Zigbee2MQTT configuration.yaml file to:-

  • Enable the web-based frontend - The web-based frontend to Zigbee2MQTT should be enabled to allow the easier setup of the Zigbee connection from the CC2531 co-ordinator to the Hive SLR/SLT devices. This can be seen in the example configuration.yaml file below under the section frontend: - set port: to 7070 and host: to 0.0.0.0

Documentation for the web-based frontend may be found here

  • In the mqtt: section - Modify the base_topic: to be pive2mqtt (see below)

  • In the advanced: section - Set log_level: to error and last_seen: to epoch (see example configuration.yaml below)

After making any changes, either reboot your Pi or restart zigbee2mqtt

sudo systemctl restart zigbee2mqtt

Example configuration.yaml

homeassistant: false
permit_join: true
mqtt:
  base_topic: pive2mqtt
  server: 'mqtt://localhost'
serial:
  port: /dev/ttyACM0
frontend:
  port: 7070
  host: 0.0.0.0
advanced:
  log_level: error
  last_seen: epoch

Review Progress and Check Software Components

Progress Review

So far, the Pi-ve software has been installed and hopefully configured correctly and all software components are working.

If the configuration has got this far, then node-RED must be installed and working, as it is possible to connect to it with a browser connected to the Pi-ve IP address at port 1880

It may be useful at this point to check that the Mosquitto Message Broker is also functioning correctly and that Zigbee2MQTT is running, can connect to the Message Broker, and it can at least connect to a functioning Zigbee co-ordinator (the CC2531).

Mosquitto Message Broker Status

Check the status of the Message Broker service:

pi@pive:~ $ sudo systemctl status mosquitto
● mosquitto.service - Mosquitto MQTT v3.1/v3.1.1 Broker
   Loaded: loaded (/lib/systemd/system/mosquitto.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2021-04-30 12:59:25 BST; 1h 11min ago
     Docs: man:mosquitto.conf(5)
           man:mosquitto(8)
 Main PID: 366 (mosquitto)
    Tasks: 1 (limit: 877)
   CGroup: /system.slice/mosquitto.service
           └─366 /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf

Apr 30 12:59:24 pive systemd[1]: Starting Mosquitto MQTT v3.1/v3.1.1 Broker...
Apr 30 12:59:25 pive systemd[1]: Started Mosquitto MQTT v3.1/v3.1.1 Broker.
pi@pive:~ $

The command sudo systemctl status mosquitto should return something similar to the above. If not, then the prime suspect will almost certainly be a problem with options in the Mosquitto configuration file located at /etc/mosquitto/mosquitto.conf

An extremely useful and highly recommended tool for checking Mosquitto is MQTT Explorer from Thomas Nordquist and is available for all major software platforms - Link

The Zigbee2MQTT Service Status

Similarly, check the Zigbee2MQTT service status:

pi@pive:~ $ sudo systemctl status zigbee2mqtt
● zigbee2mqtt.service - zigbee2mqtt
   Loaded: loaded (/etc/systemd/system/zigbee2mqtt.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2021-04-30 13:15:34 BST; 54min ago
 Main PID: 654 (node)
    Tasks: 23 (limit: 877)
   CGroup: /system.slice/zigbee2mqtt.service
           ├─654 npm
           ├─668 sh -c node index.js
           └─669 node index.js

Apr 30 13:15:34 pive systemd[1]: Started zigbee2mqtt.
pi@pive:~ $

The command sudo systemctl status zigbee2mqtt should return something similar to the above. If not, then check logs (syslog) just after stopping ( $ sudo systemctl stop zigbee2mqtt) then starting ( $ sudo systemctl start zigbee2mqtt)

The logs should give a clue as to what is stopping the service from coming up cleanly.

Useful information can be found at the official Zigbee2MQTT documentation site here

The usual suspects are:

  • The Zigbee USB device is malfunctioning (try re-programming it) or it is not recognised on the Raspberry Pi USB serial port
  • A configuration problem with the zigbee2mqtt configuration file at /opt/zigbee2mqtt/data/configuration.yaml.
  • A problem with zigbee2mqtt not connecting to the Mosquitto Message Broker (see MQTT Explorer comments above).

Configure Hive Active SLR/SLT - Factory Reset and Join Pi-ve Zigbee Network

The Hive Active Thermostat (SLT) and Boiler Controller (SLR) can now be connected to the CC2531 Zigbee co-ordinator to form a 3 node Zigbee network.

To allow the SLR/SLT devices to join the network, (Zigbee) 'Join' must be enabled on the Pi.

From a webbrowser, go to http://pi-ve-ip-address:7070 to access the Zigbee2MQTT frontend. If this fails, then review the section configuring Zigbee2MQTT above ensuring that the frontend: section in configuration.yaml has been set up.

Web-frontend-zigbee2mqtt Web frontend Zigbee2MQTT screenshot - showing 'Join' button, the SLR/SLT devices and friendly names

Click on the 'join' button on the right-hand side of the menu bar to display 'Permit join'. This should allow new Zigbee devices to join the network.

Next, the SLR/SLT should both be factory reset and placed into pairing mode. Here is an overview of the process, a detailed description of pairing is below.

Stage 1. Firstly, the SLR will be reset and paired, we should observe log messages appearing on the zigbee2MQTT web frontend screen as it pairs with the CC2531 co-ordinator.

Stage 2. As soon as pairing (of the SLR) has finished, it remains in pairing mode waiting for the SLT to pair with it. So, reset the SLT, place it into pairing mode and observe it pair with the Pi-ve AND the SLR. If this has been successful, then the SLR/SLT will appear in the web frontend Devices list and the SLR status LED will change to solid green.

Zigbee Pairing Instructions for the Hive Active SLR and SLT2/SLT3

  • Remove a battery from the Hive Active Thermostat (model SLT2 or SLT3)
  • Enable Zigbee2MQTT to allow the Pi-ve to accept new devices. (Click the Zigbee2MQTT web frontend 'Pair' button. Log messages should show pairing activity as it happens)
  • On the Boiler Controller SLR2, press and hold the 'Central Heating' button until its LED flashes pink. Release then press and hold it again. It will flash amber, pairing should begin and the controller should join the network, log messages occur and an entry for the SLR will appear in the web frontend. (See above picture).

While Zigbee2MQTT is still in pairing mode:-

  • Replace batteries in the Hive Active Thermostat (SLT2 or SLT3) WHILE pressing 'back' and 'menu' buttons on the SLT3 OR the '+' and '-' buttons on the SLT2 to perform a factory reset.

It will, reset, reboot and join the network (check log messages on the web frontend screen).

  • The LED on the Boiler Controller should turn solid green and the SLR/SLT's should be joined to the Zigbee network and communicate with each other.

  • SLT3 ONLY - After joining the network, the Thermostat goes into a setup mode requesting Hot Water and Central Heating schedules to be set up. Do NOT accept the option to set these up. The thermostat should just display the current temperature and the status of CH and HW will be shown as 'Sch'

  • Finally click the web frontend 'Join' button to disable other devices from potentially joining the network.

  • The web frontend screen should now show two new devices successfully connected to the Pi-ve Zigbee network with unfriendly hexadecimal names.

  • The last step is to set 'friendly names' for the SLR/SLT devices as these are used later in the node-RED flows when referring to Mosquitto Message Broker topics - So, in the device's screen on the web frontend, click on the 'unfriendly' hexadecimal name for the SLR device. A description screen is displayed with an edit (pencil icon) option at the bottom left. Click that and enter a friendly name SLR for the device and 'Save Changes'. Similarly, do the same for the SLT device and make its friendly name SLT and 'Save Changes'.

Check Zigbee Topic SLR

At this point, the controller may not publish a full list of parameters on its root topic pive2mqtt/SLR which are required by Pi-ve's node-RED flow for control. To check these, go to the web frontend screen, select the SLR device and the 'State' tab.

Those required are highlighted. Any additional parameters are unused.

ZigbeeState

To enable any missing information -

On the SLT3 model thermostat:- Press MENU button Select 'Heat' and set to 'Manual' - Then press confirm button

Similarly (for Hot Water):-

Press MENU button Select 'Hot Water' and set to 'Always On' - Then press confirm button

On the SLT2 model thermostat:- Press top right 'menu' button marked + to enable other switches Press Heat function button (marked right arrow) until the status changes to Manual Press Hot Water function button (marked left arrow) until the status changes to Off


node-RED - Import flow

To complete the software setup, copy the node-RED flow at https://github.com/roadsnail/Pi-ve/blob/main/Pi-ve%20flow%20v2-14beta and import it as a new flow in node-RED. Pointing a browser at http://your-pive-ip-address:1880 go to Menu - Import - New flow.

The flow should deploy without warnings/errors and the Pi-ve dashboard should be available by pointing a web browser at http://your-pive-ip-address:1880/ui . If warnings about missing nodes appear, then check that the additional nodes were installed as listed above.

The first time the flow runs, it will check for the existence of two files containing time slot settings. (These files are stored by default in the home directory of the account used to install Node-RED ie. user pi in this tutorial). The files are named Pive-CH and Pve-HW for Central Heating and Hot Water. If these files are not found on first run of the flow, they should be created by the Node-RED catch nodes name No HW! and No CH!.

Pi-ve 1-30b Screenshot


Pi-ve Operation Modes

  • Manual Mode (CH and/or HW)

Set the Man<>Timer switch to 'Man' position OR press the MANUAL ON/OFF - TIMER MODE button (toggles betweeen Manual and Timer Modes). Applicable to CH and HW.

In Manual mode, the HW relay is switched by its Manual Mode - Off/On switch. The state of the relay is indicated by the State LED and the HW Demand icon.

Similarly, the CH relay is switched by its Manual Mode - Off/On switch according to the Thermostat SP setting. The state of the relay is indicated by the State LED and the CH Demand icon.

  • Timer Mode (CH and/or HW)

Set the Man<>Timer switch to 'Timer' position OR press the MANUAL ON/OFF - TIMER MODE button (toggles betweeen Manual and Timer Modes). Applicable to CH and HW.

In Timer mode, the HW relay is automatically switched according to the current HW Time Slot state (see below Timed Off/On Slots). The state of the relay is indicated by the State LED and the HW Demand icon.

Similarly, the CH relay is automatically according to the current CH Time Slot state (see below Timed Off/On Slots). The state of the relay is indicated by the State LED and the CH Demand icon.


Pi-ve Dashboard Timed Off/On Slots (in timer (TMR) Mode)

There are between 1 and a maximum of 8 timed 'On' periods per day for both Heating and Hot Water. Heating and/or Hot Water is 'Off' during the periods between the Time Slots.

By default, the current day's Time Slots are listed under the HW Daily Time Slots and CH Daily Time Slots columns. Pressing a 'Day' button selects all of the Time Slots for a particular day for either Heating or Hot Water.

A Time Slot is selected, (press or click on it in the list), and the Time Slot Start/End Times are displayed in the Edit Time Slot column where they may be changed.

The (selected) Time Slots are modified using the four buttons: SAVE, CANCEL, ADD and DELETE.

  • SAVE - Pressing the 'SAVE' button will store the modified times. (Checks are made to ensure the start/end times do not overlap with previous and later Time Slots).

  • CANCEL - Will cancel any modifications in progress to the times and restore the originals to the Edit Time Slot columns

  • ADD - Inserts a new Time Slot after the currently selected time slot highlighted in the Daily Time Slot columns

  • DELETE - Removes the selected Time Slot from the daily list. Note that Time Slot one cannot be deleted and attempting to delete it will result in an error

The 'C' Button may be used to restore default Time Slots for the whole week and should be used with care. Existing time slot settings will be overwritten with new defaults!

  • REPEAT PREVIOUS DAY'S PROG - Will copy the previous day's Time Slot settings into the day currently selected

Programming Central Heating Time Slots

Example Time Slot setup for CH to:-

  1. Switch on CH at 06:30 to 20.5 deg C on Monday
  2. 07:45 turn down thermostat to 19 deg C
  3. 08:15 switch off CH
  4. 16:30 turn on CH and set thermostat to 21 deg C
  5. 18:40 turn down thermostat to 19.5 deg C
  6. 22:15 turn off heating
  • Select Day MON - Edit Time Slot 1 (Click on Time Slot 1 from list)...

Set - Start = 06:30 End = 07:45 Temp = 20.5 (SAVE)

  • Edit Time Slot 2 (Click on Time Slot 2)...

Set - Start = 07:45 End = 08:15 Temp = 19 (SAVE)

  • Edit Time Slot 3 ...

Set - Start = 16:30 End = 18:40 Temp = 21 (SAVE)

  • Edit Time Slot 4 ...

Set - Start = 18:40 End = 22:15 Temp = 19.5 (SAVE)

  • Delete Time Slots 5 to 8

After 22:15, CH will be switched Off until the first (On)Time Slot on Tuesday


Repeat Previous Day's Programme

Want the same programme on Tuesday? Simple -:

  • Select Day TUE - (Tuesday's Time Slots will be displayed under CH Edit Time Slot column)

Click 'REPEAT PREVIOUS DAY'S PROG'


OVERRIDE Current CH/HW Relay State (in TMR Mode)

In Timer mode, the state of the CH and/or HW relays may be toggled by pressing the CH OVERRIDE TIMER and/or HW OVERRIDE TIMER button. Override will be active from the time the button is pressed until completion of the current Time Slot.

Thus pressing Override Timer while the relevant output is on, will switch it off for the remainder of the current Time Slot duration. Similarly if the output is currently off, then Override will switch it on for the reaminder of the current time slot.

Pressing the relevant Override Active will turn the Override Active LED green. The override duration is shown beneath the LED indicator. The Start time being the time OVERRIDE was activated. The End time will be the current time slot End Time (either On or Off).


Boost Function

The four boost buttons: +30M, +60M, +90M and CANCEL allow CH and/or HW outputs to be turned on for a period of 30, 60 or 90 minutes respectively.

Thus pressing the CH +30M button will set the thermostat setpoint (SP) to 1 degree C higher than the current SLR Thermostat Temperature for 30 minutes. Pressing the HW +30M button will switch the HW output on for a duration of 30 minutes. Similarly the boost time may be 60 or 90 minutes by pressing the appropriate button.

On pressing the boost button, the boost time remaining will be displayed, (the boost countdown), until the (boost) time remaining equals 00:00 and the previous output status is restored.

An active Boost state may be cancelled at any time by pressing the CANCEL button.


Attributions

The following ICONS requiring attribution are used in the Pi-ve dashboard:-

Hot Water Demand Off/On - Icon made by Freepik from www.flaticon.com

Heating Demand Off/On - Icon made by Flat Icons from www.flaticon.com

pi-ve's People

Contributors

roadsnail avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

chickey

pi-ve's Issues

Last seen

Last seen time not updating - it's 4 hours out of sync and counting. Pive has been working perfectly fine for 5 days.

Setpoint for time slots

Hi @roadsnail,

This looks very comprehensive and powerful, and I'm thinking of implementing it on a spare SLT2 / SLR2 setup, before putting it into 'production'. I've downloaded the flow in order to take a look at the dashboard, but when creating / editing time slots I can't see how to define the setpoint for each slot, or for the gaps between the time slots - am I missing something?

MikeF

base_topic

Having recently been tinkering with Zigbee, mqtt and assorted sensors with Python scripts, I chanced on this project and thought I'd give it a try despite the complexity of adding another new, to me, system, node-RED. Easy enough to install node-RED on my R Pi and follow the instructions here to import the node-RED flow, graphics etc.

However, it doesn't work at present, clicking on the UI part of Pive does not change the Hive controller, possibly as I have zigbee2mqtt base_topic set as the default zigbee2mqtt. I'm reluctant to change this as I have all my other devices working with the default. The excellent MQTT Explorer shows another topic pive2mqtt at the same level as zigbee2mqtt, with pive2mqtt showing mqtt messages. So, I'm nearly there; a bit more to learn.

Anyway, certainly an interesting project for which many thanks. It seems a little strange tinkering with the central heating control in a UK heat wave, although perhaps that is the best time 😄

Install Guide

Hi I was wondering if you have a step by step install guide.

I was also wondering if the timing schedule setup via your web server saves data to the hive unit itself?

SLR without SLT

Have you managed to get it working when the SLT is switch off? Of I switch off my SLT and try to control the SLT it fails after a period of time with the SLR showing a red link light.

Changing time on 1st HW slot

Morning, i have the hot water only come on from half 7 to 8 am daily. I have deleted all the time slots except the first, but when i edit that time slot to the times i want it never saves and i have to edit the Pive-HW file directly and it works.

Problem with hysteresis, or the lack thereof.

Pi-ve contains some great functionality, thank you for all the time and effort. One issue that has raised its head is the lack of any control over hysteresis. It seems that, when left with a temperature setpoint to maintain, the SLR2C and SLT keep turning demand on and off far too often. It seems that if the SLT sensor momentarily reports temperature below the setpoint it will call for heat. A minute or two later it will turn it off again, without any radiator becoming warm. This is inefficient use of the boiler and pump. It would be good to have a configurable hysteresis parameter to eliminate this useless cycling. I'm not sure how this would be achieved, since it looks like setpoint temperature is only adjustable in increments of 0.5 degrees. Any ideas?

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.