Comments (4)
The tip from albertoanta seemes to be the solution.
Issue did not trigger anymore after the change.
Thx
from nodered_heishamon_control.
Same bug for me. Solved it in WP Control Tab, node Cool Function
Just comment initialization of msg3 in first if statement and declare it at the begin of code in node.
The final code is
var F_COOL = global.get('F_COOL',"file");
if (F_COOL === undefined || F_COOL.setpoint_requested === undefined) {return null}
var TOP20_ThreeWay_Valve_State = global.get('TOP20_ThreeWay_Valve_State');
var TOP4_Operating_Mode_State = global.get('TOP4_Operating_Mode_State',"file");
var TOP0_Heatpump_State = global.get('TOP0_Heatpump_State',"file");
let msg1 = {}; // calculated_dew_point
let msg2 = {}; // calculated_setpoint_lower_limit
let msg3 = {}; // final setpoint
//
// TOP20_ThreeWay_Valve_State = 0 (ROOM)
// TOP4_Operating_Mode_State = 1, 5 TOP20=0
//
//// Operating mode 0=Heat only, 1=Cool only, 2=Auto(Heat), 3=DHW only, 4=Heat+DHW, 5=Cool+DHW, 6=Auto(Heat)+DHW, 7=Auto(Cool), 8=Auto(Cool)+DHW
////////////////////////////////////////////////////////////////////////////////
// DEW POINT CALCULATION //
////////////////////////////////////////////////////////////////////////////////
if (F_COOL.RelativeHumidity !== undefined && F_COOL.Temperature !== undefined && F_COOL.safety_margin !== undefined && F_COOL.manual_setpoint_lower_limit !== undefined) {
var A = Math.log(F_COOL.RelativeHumidity / 100) / Math.log(2.718282) + 17.62 * F_COOL.Temperature / (243.12 + F_COOL.Temperature); // BLB 20230405 corrected Td calculation
var Td = 243.12 * A / (17.62 - A);
// let msg1={}; // calculated_dew_point
// let msg2={}; // calculated_setpoint_lower_limit
// let msg3={}; // final setpoint
msg1.payload = Td;
msg1.payload = Number(msg1.payload).toFixed(2);
msg1.payload = parseFloat(msg1.payload);
msg1.topic = "Dew Point (°C)";
global.set("F_COOL.calculated_dew_point",msg1.payload,"file");
msg2.payload = Td + F_COOL.safety_margin;
msg2.payload = Number(msg2.payload).toFixed(2);
msg2.payload = parseFloat(msg2.payload);
msg2.topic = 'Setpoint lower limit';
global.set("F_COOL.calculated_setpoint_lower_limit",msg2.payload,"file");
msg3.payload = Math.ceil(msg2.payload);
if (msg3.payload < F_COOL.manual_setpoint_lower_limit) { msg3.payload = F_COOL.manual_setpoint_lower_limit; }
if (F_COOL.setpoint_requested > msg3.payload) { msg3.payload = F_COOL.setpoint_requested; }
// Check if heatpump is on. if not, do nothing / exit
if (TOP0_Heatpump_State === undefined || TOP0_Heatpump_State == 0) { return null }
// check if COOL is in the current operating mode. if not, do nothing / exit
if (TOP4_Operating_Mode_State === undefined || TOP4_Operating_Mode_State == 0 || TOP4_Operating_Mode_State == 2 || TOP4_Operating_Mode_State == 3 || TOP4_Operating_Mode_State == 4) { return null }
msg3.topic = 'new setpoint';
return msg3
}
// If there is no humidity or temperature sensor data, the requested setpoint will be sent.
if (F_COOL.RelativeHumidity === undefined && F_COOL.Temperature === undefined) {
msg3.payload = F_COOL.setpoint_requested
msg3.topic = 'new setpoint';
return msg3
}
from nodered_heishamon_control.
Yes. You are correct.
In 2 weeks im back behind the pc. And can fix it.
Thanks for the bug Report and also pointing the cause.
from nodered_heishamon_control.
from nodered_heishamon_control.
Related Issues (20)
- [BUG]: Scheduler conditions not shown after reboot HOT 2
- [BUG]: [error] [function:COOL function] ReferenceError: msg3 is not defined HOT 1
- [BUG]: Scheduler not functioning with 23.06. HOT 1
- DegreeDays - question HOT 2
- [ENHANCEMENT]: Anti-Theft request HOT 6
- [ENHANCEMENT]: various ideas HOT 2
- [ENHANCEMENT]: Support for Zone2 and Buffer tank HOT 8
- Settings memory HOT 2
- dashboard and pump work according to custom room temperature sensor HOT 31
- [BUG]: Softstart jumps between 2 temperatures HOT 3
- RTC power trigger dT question HOT 3
- [ENHANCEMENT]: table with supported Heishamon versions on Github. HOT 17
- [ENHANCEMENT]: Delay for outside Temp-Sensor HOT 4
- [ENHANCEMENT]: Panel integrated temp sensor as trigger HOT 4
- [BUG]: Tsp sometimes jumps to "set water temperature" and not applying "custom functions" HOT 3
- [ENHANCEMENT]: after auto DHW heat, pump is on for heating HOT 4
- [BUG]:V23.09: text heat,dhw,cool status missing HOT 2
- [ENHANCEMENT]: Softstart and Night reduction HOT 6
- [BUG]:Delay-Node missing? HOT 4
- [ENHANCEMENT]: Using S0 of Heishamon for calculating efficiency HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nodered_heishamon_control.