-
-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script that sets room temperature to sensor value
- Loading branch information
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
BSB_LAN/custom_functions/Set_room_temperature_to_sensor_value/BSB_LAN_custom.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |