@ttjaden
Ich pack hier mal meine "gebastelte" Lösung rein, das ist tatsächlich Vor- und Rücklauftemp dabei, aber ich speichere nicht alle Werte aktuell.
Wenn ich mal Zeit habe mach ich das mal "schön".
Heizung host mit IP ersetzen!
Das unschöne ist, dass die Rückgabewerte in responseBody[]-array reinkommen, die Reihenfolge ist, soweit ich das aber erkenne, diesselbe wie die Anfrage, also im jsonRequest.
/**
* This script reads data from a hautec heater Keba controller.
* www.hautec.eu
*/
const request = require('request');
const heizung_host = '192.168.100.99';
const urlOfHeatpump = 'http://' + heizung_host + '/var/readWriteVars';
const jsondata = [{"name":"APPL.CtrlAppl.sParam.outdoorTemp.values.actValue"}];
// all values I want to receive
const jsonRequest = [
{"name":"APPL.CtrlAppl.sParam.param.setControlMode"},
{"name":"APPL.CtrlAppl.sParam.heatCircuit[0].tempRoom.values.actValue"},
{"name":"APPL.CtrlAppl.sParam.hotWaterTank[0].topTemp.values.actValue"},
{"name":"APPL.CtrlAppl.sParam.heatCircuit[0].humidityRoom.values.actValue"},
{"name":"APPL.CtrlAppl.sParam.outdoorTemp.values.actValue"},
{"name":"APPL.CtrlAppl.sParam.heatCircuit[0].values.setValue"},
{"name":"APPL.CtrlAppl.sParam.heatCircuit[0].param.offsetRoomTemp"},
{"name":"APPL.CtrlAppl.sParam.heatCircuit[0].values.selectedSetTemp"},
{"name":"APPL.CtrlAppl.sParam.heatCircuit[0].values.heatRequest"},
{"name":"APPL.CtrlAppl.sParam.heatCircuit[0].values.coolRequest"},
{"name":"APPL.CtrlAppl.sParam.hotWaterTank[0].values.heatRequestTop"},
{"name":"APPL.CtrlAppl.sParam.outdoorTemp.state.msgId"},
{"name":"APPL.CtrlAppl.sParam.hotWaterTank[0].topTemp.state.msgId"},
{"name":"APPL.CtrlAppl.sParam.heatCircuit[0].humidityRoom.state.msgId"},
{"name":"APPL.CtrlAppl.sParam.heatCircuit[0].param.operatingMode"},
{"name":"APPL.CtrlAppl.sParam.heatCircuit[0].tempRoom.state.msgId"},
{"name":"APPL.CtrlAppl.sParam.screedDrying.values.active"},
{"name":"APPL.CtrlAppl.sParam.param.operatingMode"},
{"name":"APPL.CtrlAppl.sParam.hmiRetainData.ctrlSessionId"},
{"name":"APPL.CtrlAppl.sParam.hotWaterTank[0].param.normalSetTempMax.value"},
{"name": "APPL.CtrlAppl.sParam.hotWaterTank[0].values.heatRequestTop"},
{"name": "APPL.CtrlAppl.sParam.heatCircuit[0].tempReflux.values.actValue"},
{"name": "APPL.CtrlAppl.sParam.heatCircuit[0].values.flowSetTemp"}
];
const jsonAsString = JSON.stringify(jsonRequest);
// create all the states in broker
createState('javascript.'+instance+'.Heizung.Aussentemperatur', 0, {type: 'number', role: 'value', unit: '°C'});
createState('javascript.'+instance+'.Heizung.Boilertemperatur.ist', 0, {type: 'number', role: 'value', unit: '°C'});
createState('javascript.'+instance+'.Heizung.Boilertemperatur.soll', 0, {type: 'number', role: 'value', unit: '°C'});
createState('javascript.'+instance+'.Heizung.Raumtemperatur.ist', 0, {type: 'number', role: 'value', unit: '°C'});
createState('javascript.'+instance+'.Heizung.Raumtemperatur.soll', 0, {type: 'number', role: 'value', unit: '°C'});
createState('javascript.'+instance+'.Heizung.Boiler.aufheizen', 0, {type: 'boolean', role: 'value', unit: ''});
createState('javascript.'+instance+'.Heizung.Heizung.aufheizen', 0, {type: 'boolean', role: 'value', unit: ''});
createState('javascript.'+instance+'.Heizung.RuecklaufTemp.ist', 0, {type: 'number', role: 'value', unit: '°C'});
createState('javascript.'+instance+'.Heizung.RuecklaufTemp.soll', 0, {type: 'number', role: 'value', unit: '°C'});
// every minute read the data from the heater and save it
schedule("* * * * *", function() {
request.post({
url: urlOfHeatpump,
form: jsonAsString
}, function(error, response, body) {
if (error) log(error, 'error');
if (body) {
//log(body);
var responseBody = JSON.parse(body);
setState('javascript.'+instance+'.Heizung.Aussentemperatur', parseFloat(responseBody[4].value), true);
setState('javascript.'+instance+'.Heizung.Boilertemperatur.ist', parseFloat(responseBody[2].value), true);
setState('javascript.'+instance+'.Heizung.Boilertemperatur.soll', parseFloat(responseBody[19].value), true);
setState('javascript.'+instance+'.Heizung.Raumtemperatur.ist', parseFloat(responseBody[1].value), true);
setState('javascript.'+instance+'.Heizung.Raumtemperatur.soll', parseFloat(responseBody[5].value), true);
if (parseInt(responseBody[8].value) == 1) {
setState('javascript.'+instance+'.Heizung.Heizung.aufheizen', true);
}
if (parseInt(responseBody[8].value) == 2) {
setState('javascript.'+instance+'.Heizung.Heizung.aufheizen', false);
}
setState('javascript.'+instance+'.Heizung.Boiler.aufheizen', JSON.parse(responseBody[20].value));
setState('javascript.'+instance+'.Heizung.RuecklaufTemp.ist', parseFloat(responseBody[21].value));
setState('javascript.'+instance+'.Heizung.RuecklaufTemp.soll', parseFloat(responseBody[22].value));
}
});
});
Wen es interessiert wie ich darauf gekommen bin?
Heizungscontroller im Browser aufrufen, Chrome, rechte Maustaste "Untersuchen"
in den Menues kann man dann immer die Requests und Responses "sniffen". Da ist auch nix verschlüsselt.