Skip to content

Commit

Permalink
Add script that sets room temperature to sensor value
Browse files Browse the repository at this point in the history
  • Loading branch information
fredlcore committed Nov 19, 2024
1 parent 0f2038b commit cce6d7c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions BSB_LAN/custom_functions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ This script connects to an NTP time server and writes the accurate time to the h

This script collects the current temperature of registered MAX! thermostats, calculates an avaerage and sends this average as the current room temperature to the heater (via parameter 10000).

## Set room temperature to sensor value

This script takes the value of one parameter (for examle 20500.1 for the temperature of the first MAX! device) and sends it to the room temperature parameter (10000 for BSB/LPB, 15008 for PPS) every five minutes. This way, BSB-LAN can replace the room temperature sensor function of a room unit when using one of the devices/sensors that BSB-LAN can access out-of-the-box (DS18B20, DHT22, BME280 sensors or MAX! devices).

## Emulation of Room Unit and Presence Buttons

_The pushbutton functionality will need adjustments and is not compatible out-of-the-box from version 3 onwards._
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Run every five minutes, this code takes the value of one parameter,
* in this case 20500.1 (which contains the measured temperature of the first MAX! device),
* and sends it to the room temperature parameter (10000 for BSB/LPB, 15008 for PPS).
*/

// Set the parameter that refers to the temperature sensor here:
float sensor_parameter = 20500.1; // 20500.1 is the measured temperature of the first MAX! device

if (custom_timer > custom_timer_compare+300000) { // every five minutes
custom_timer_compare = millis();
query(sensor_parameter);
char set_temp[6];
strcpy(set_temp, decodedTelegram.value);
if (bus->getBusType() == BUS_PPS) {
set(15008, set_temp, 1); // PPS: Send sensor value to room temperature parameter 15008
} else {
set(10000, set_temp, 0); // BSB/LPB: Send sensor value to room temperature parameter 10000
}
}

0 comments on commit cce6d7c

Please sign in to comment.