I fine tuned the Homey Scripts for pulling the data from BoilerText, ThermostatInfo and AirSensor.
If people have any smarter solutions/ more info or ideas how data is processed, I’m fully open for this.
I run these scripts on top of the (unsupported) OpenToon app (manually installed and also had to make changes in the code of the app itself because of the issue described in post #91.
Change the IP for the IP of your Rooted Toon.
AirSensor Info
Runs every 15min. Picks up TVOC, Humidity, CO2, Intensity, only available on Toon2
Within the flow, the value are added to a virtual device
`//Get Toon AirSensor info`
var url = "http://192.168.1.9/tsc/sensors";
(async () => {
const rawResponse = await fetch(url, {
method: 'GET',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
});
const content = await rawResponse.json();
console.log(content);
if (content.humidity !== null && content.humidity != '')
{
var humidity = content.humidity ;
await tag("Humidity", humidity);
var tvoc = content.tvoc
await tag("TVOC", tvoc);
var eco2 = content.eco2
await tag("ECO2",eco2);
var intensity = content.intensity
await tag("intensity",intensity);
}
console.log("TVOC : " + tvoc)
console.log("Humidity : " + humidity)
console.log("CO2 : " + eco2)
console.log("Intensity : " + intensity)
})();
return true;
BoilerText
Runs every 6 hours, just to pick up system pressure. More info is available, but i do not find those interesting. Unfortunately, Boiler Temp In and Boiler Temp Out are no longer available in Toon
//Get Toon BoilerText info
var url = "http://192.168.1.9/boilerstatus/boilervalues.txt";
(async () => {
const rawResponse = await fetch(url, {
method: 'GET',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
});
const content = await rawResponse.json();
//console.log(content);
if (content.boilerSetpoint !== null && content.boilerSetpoint != '') {
var boilerPressure = content.boilerPressure ;
// console.log(boilerPressure);
await tag("boiler_druk", boilerPressure);
// console.log(boilerPressure )
}
})();
return true;
ThermosStatInfo
Pulls the boiler state, the programm, the next programm and at what times these will change.
Runs every minute, i use the BoilerState to control my Floor Heating Pump.
//Get Toon ThermosStatInfo
var url = "http://192.168.1.9/happ_thermstat?action=getThermostatInfo";
(async () => {
const rawResponse = await fetch(url, {
method: 'GET',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
});
const content = await rawResponse.json();
//console.log(content);
if (content.boilerSetpoint !== null && content.boilerSetpoint != '') {
var burnerInfo = content.burnerInfo*1;
var boilerModulationLevel = content.currentModulationLevel*1;
var currentInternalBoilerSetpoint = content.currentInternalBoilerSetpoint*1;
var activeState = content.activeState*1;
var nextState = content.nextState*1;
var nextSetpoint = content.nextSetpoint/100
var nextTime = content.nextTime*1
secondsToday = nextTime - Math.floor(nextTime/3600/24) *3600 *24
FullHours = Math.floor( secondsToday / 3600 )
FullMinutes = ((secondsToday - FullHours *3600)/60)
if (burnerInfo == 1) {burnerMode = 'CV aan'}
else if (burnerInfo == 0) {burnerMode = 'CV uit'}
else {burnerMode = 'Warm Water'};
if (activeState == 0) {Mode = 'Comfort'}
else if (activeState == 1) {Mode = 'Thuis'}
else if (activeState == 2) {Mode = 'Slapen'}
else if (activeState == 3) {Mode = 'Weg'}
else {Mode = 'Geen Stand'};
if (nextState == 0) {NMode = 'Comfort'}
else if (nextState == 1) {NMode = 'Thuis'}
else if (nextState == 2) {NMode = 'Slapen'}
else if (nextState == 3) {NMode = 'Weg'}
else {NMode = 'Geen Stand'};
await tag("nextSetpoint", nextSetpoint);
await tag("modulation", boilerModulationLevel);
await tag("Boiler_Setpoint", currentInternalBoilerSetpoint);
await tag("burnercode", burnerInfo);
await tag("burnermode", burnerMode);
await tag("mode", Mode);
await tag("Nmode", NMode);
await tag("TimeNextProgram", FullHours+":"+FullMinutes);
console.log("burnerMode : " + burnerMode);
console.log("Programma : " + Mode);
console.log("Volgend Programma : " + NMode);
console.log("Next_Setpoint : " + nextSetpoint);
console.log("Boiler_Setpoint : " + currentInternalBoilerSetpoint);
console.log('Burner Info : ' + burnerInfo)
console.log('Burner Modulation : ' + boilerModulationLevel)
console.log('Tijd : ' + FullHours+":"+FullMinutes)
}
})();
return true;