1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- // name: Heatfunction
- // outputs: 3
- // initialize: DEBUG = false;\n\nkey_user_setpoint = "user_setpoint_sleep_madi"
- // finalize: // Der Code hier wird ausgeführt,\n// wenn der Node gestoppt wird\n
- // info:
- if (DEBUG)
- {
- node.warn(msg)
- }
-
- out_1 = null;
- out_2 = null;
- out_3 = null;
-
- user_setpoint = flow.get(key_user_setpoint)
-
- if (msg.topic == "valve_setpoint")
- {
- if (user_setpoint == undefined)
- {
- flow.set(key_user_setpoint, msg.payload)
- }
- }
- else if (msg.topic == "user_setpoint")
- {
- flow.set(key_user_setpoint, msg.payload)
- out_1 = {topic: "new_setpoint", payload: {"current_heating_setpoint": msg.payload}};
- out_2 = {topic: "trigger", reset: true};
- }
- else if (msg.topic == "boost")
- {
- if (user_setpoint != undefined)
- {
- out_1 = {topic: "boost_setpoint", payload: {"current_heating_setpoint": user_setpoint + 5}};
- out_2 = {topic: "trigger", payload: null};
- out_3 = {topic: "boost_state", payload: true};
- }
- }
- else if (msg.topic == "trigger")
- {
- out_1 = {topic: "user_setpoint", payload: {"current_heating_setpoint": user_setpoint}};
- out_3 = {topic: "boost_state", payload: false};
- }
- return [out_1, out_2, out_3];
|