Smart Nora - thermostat - overwrite setpoint

Hi there,

For my home automation I'm using a PLC (Wago) for general control of heating and lighting, commanding it via the PLC visualisation. I'm also using Smart Nora as a second layer to command my home by voice .
I'm trying to set up Nora thermostat to command the heating and it seems to work. The only problem is, once set up I can not overwrite the setpoint value via the PLC visualisation anymore. When I build in some latency I can clearly see that the new setpoint vallue arrives at the input of the Thermostat node, and even the output changes. But after a while it turns back to the initial vallue which was given via the google speaker. Does anyone have an idea what I'm possibly doing wrong?

Great thanks in advance,

David

Hi,

Can you post the essential part of your NR flow.
Then we might be able to give you a hint.

Hi,
That is indeed a wonderful idea! Sorry, I should have thought about it.
Is it ok if I post it like this, I can't seem to upload a file as I'm new to this forum.

[{"id":"9862336b.eee69","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"2289b69.eaa1b4a","type":"noraf-thermostat","z":"9862336b.eee69","devicename":"Thermostat","roomhint":"Office","name":"","modes":"off,heat,on,auto","unit":"C","rangeMin":"","rangeMax":"","topic":"","passthru":false,"commandOnly":false,"queryOnly":false,"bufferRangeCelsius":2,"nora":"fcc92e05.a8bf8","x":1190,"y":300,"wires":[["6cb8e45.0b49d1c"]]},{"id":"c9713ea6.ae45c","type":"change","z":"9862336b.eee69","name":"rTempOffice","rules":[{"t":"set","p":"payload","pt":"msg","to":"rTempOffice","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":300,"wires":[["8c459433.62f688"]]},{"id":"58fd0d27.f09dd4","type":"link in","z":"9862336b.eee69","name":"","links":["43532815.8811b8"],"x":275,"y":300,"wires":[["c9713ea6.ae45c","b73b584d.b70ad8"]]},{"id":"b73b584d.b70ad8","type":"change","z":"9862336b.eee69","name":"rReferenceOffice","rules":[{"t":"set","p":"payload","pt":"msg","to":"rReferenceOffice","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":360,"wires":[["49fcbd87.9bc864"]]},{"id":"93f9cef8.ebdee","type":"function","z":"9862336b.eee69","name":"Samenstellen Object","func":"var data = {};\nvar rReferenceOffice = global.get ('rReferenceOffice')||0;\nvar rTempOffice = global.get ('rTempOffice')||0;\ndata = {\n    mode: \"heat\",\n    setpoint: rReferenceOffice,\n    temperature: rTempOffice\n}\nmsg.payload = data\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":960,"y":300,"wires":[["2289b69.eaa1b4a"]]},{"id":"6cb8e45.0b49d1c","type":"change","z":"9862336b.eee69","name":"","rules":[{"t":"set","p":"xOffice_SP_Heating","pt":"global","to":"payload.setpoint","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1430,"y":300,"wires":[["bbbbfefc.49af"]]},{"id":"8c459433.62f688","type":"change","z":"9862336b.eee69","name":"","rules":[{"t":"set","p":"rTempOffice","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":300,"wires":[["93f9cef8.ebdee"]]},{"id":"49fcbd87.9bc864","type":"change","z":"9862336b.eee69","name":"","rules":[{"t":"set","p":"rReferenceOffice","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":360,"wires":[["93f9cef8.ebdee"]]},{"id":"bbbbfefc.49af","type":"debug","z":"9862336b.eee69","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1410,"y":400,"wires":[]},{"id":"fcc92e05.a8bf8","type":"noraf-config","name":"","group":"","twofactor":"off","twofactorpin":"","localexecution":true,"structure":""}]

Thx & Grtz
david

Hello David (@Baste),

I looked to your flow and honestly I do not completely understand the intention of the flow. This might be because I do not know the message that arrives through the "Link" in.

Fortunately someone (or you) edited the post, because I couldn't get it imported.
But first the flow.

Obviously you receive a msg.payload that you send to a "Change" node.
You create 2 new msg (msg.rTempOffice and msg.rReferenceOffice).
These are both equal to msg.payload.

In the next "Change" node you create a new global variable rTempOffice and in another "Change" node another global variable rReferenceOffice.

And then in the "Function"node you use that global variable again.
Do you use those variables also elsewhere?

var data = {};
var rReferenceOffice = global.get ('rReferenceOffice')||0;
var rTempOffice = global.get ('rTempOffice')||0;
data = {
    mode: "heat",
    setpoint: rReferenceOffice,
    temperature: rTempOffice
}
msg.payload = data
return msg;

With this function node you send the msg.payload to your thermostat.
This will work, but your setpoint is equal to the temperature and equal to the received msg.payload. So very dynamic. Perhaps I'm wrong.

Let us look to the "Change" node connected to the output.

The Thermostat node gives a output of msg.payload.setpoint.
The Change node gives that value to another global variable. (xOffice_SP_Heating)

What do you do with those global variables?

The debug node with msg.payload will not show much.

If you can give more details of what you want to achieve and what msg you receive and want to send, we can probably help you.

Regards

Hey,

First and foremost a big thank you for trying to help me. Indeed, I struggled to post the flow correctly and clearly failed to do so. You should know that I'm a dummy when it comes to java script and programming in general. Most of what I have achieved so far has been through trial and error. So I am not sure my answer will be clear and complete. Anyway, here we go:

The basis of my automation is a PLC that controls the lighting and heating in my home. I think it is important that it can continue to function independently, without needing any other.

The plc sends a list of network variables received by the node netvar-reciever. Then I use a function node to split the incoming array. This array actually contains the rTempOffice which is the actual office temperature and the rReferenceOffice which is the setpoint temperature.

So the first change nodes I send you are simply to get the variable of the list I want to use. The second change node I use it to make those variables global as I didn’t achieved to get them into the function in an other way. The function node I use it to make a JSON and send it to the Thermostat node.

From the output of the thermostat node I only use the setpoint which I put into an other function, along with some other variables . With this function I create a new array of network variables which is return to the PLC.

In resume you could say that the received variables are a status feedback to the smart Nora nodes. Via Google I want to be able to ask what the actual temperature and setpoint is. Finally I want to be able to ask google to change the setpoint which needs to be send back to the plc and appear on the visu. Naturally I also want to be able to change that setpoint via the visualisation of the plc, that one should be returned to the input of the thermostat node. And that last one seems to be the problem.

I put the flow in attachement hoping this time it reach you in a complete way. If you need more info, please don't hesitate.

Many thanks

grtz

David

flows.json (2.21 KB)

Hello David,

Yes, I have a few questions.

I struggled to post the flow correctly and clearly failed to do so.

I think a moderator corrected it, and I had it already installed in my Node Red editor.
The attached file with your latest post is te same.

The plc sends a list of network variables received by the node netvar-reciever.

It is indicated that the netvar node is not for production use.
But can you provide a screenshot of the results of a debug node, connected to the output of the netvar-receive node?
Is the netvar-receive node on the same tab as the smart-nora node?

I believe that the whole flow can be simplified a lot.
I will try to create somthing, as soon as I have a complete picture of what you receive from the netvar-receive node.

Regards

Hey,

I don't quite understand what you mean by 'the netvar node is not for production use'?

But here you have the output of the node:

I only opened line 13 and 14 as they are relevant.
About the second question, actually I made everything in one tab... bad idea?
I made a copy of the tab and deleted everything irrelevant, this way maybe I could make it easier for you to understand. You will find it in the next post

Thanks

David

Here you have it, hope you can use it this time:

[{"id":"cbccd4a4.91c678","type":"function","z":"d440d994.606fc8","name":"Format array","func":"var msg_o={};\n// BASEMENT\nvar xVDI119 = global.get ('xVDI119')||0;\nvar xVDI119a = global.get ('xVDI119a')||0;\nvar xWaterleakBasement = global.get ('xWaterleakBasement')||0;\nvar rBasementFloodTemp = global.get ('rBasementFloodTemp')||0;\nvar rBasementFloodBattery = global.get ('rBasementFloodBattery')||0;\n// LIVING ROOM & KITCHEN\nvar xVDI22 = global.get ('xVDI22')||0;\nvar xVDI22a = global.get ('xVDI22a')||0;\nvar xVDI23 = global.get ('xVDI23')||0;\nvar xVDI23a = global.get ('xVDI23a')||0;\nvar xVDI24 = global.get ('xVDI24')||0;\nvar xVDI24a = global.get ('xVDI24a')||0;\nvar xVDI29 = global.get ('xVDI29')||0;\nvar xVDI29a = global.get ('xVDI29a')||0;\nvar xVDI30 = global.get ('xVDI30')||0;\nvar xVDI30a = global.get ('xVDI30a')||0;\nvar xSlidingWindow = global.get ('xSlidingWindow')||0;\nvar rSlidingWindowBattery = global.get ('rSlidingWindowBattery')||0;\nvar xVDI31 = global.get ('xVDI31')||0;\nvar xVDI31a = global.get ('xVDI31a')||0;\nvar xVDI32 = global.get ('xVDI32')||0;\nvar xVDI32a = global.get ('xVDI32a')||0;\nvar xWindowSittingRoom = global.get ('xWindowSittingRoom')||0;\nvar rSittingRoomContactBattery = global.get ('rSittingRoomContactBattery')||0;\nvar xSceneLeefruimte1 = global.get ('xSceneLeefruimte1')||0;\nvar xSceneLeefruimte2 = global.get ('xSceneLeefruimte2')||0;\nvar xSceneLeefruimte3 = global.get ('xSceneLeefruimte3')||0;\nvar xSceneLeefruimte4 = global.get ('xSceneLeefruimte4')||0;\nvar xSceneLeefruimte5 = global.get ('xSceneLeefruimte5')||0;\nvar xSceneLeefruimte6 = global.get ('xSceneLeefruimte6')||0;\nvar xWaterleakKitchen = global.get ('xWaterleakKitchen')||0;\nvar rKitchenFloodBattery = global.get ('rKitchenFloodBattery')||0;\n// OFFICE\nvar xVDI28 = global.get ('xVDI28')||0;\nvar xVDI28a = global.get ('xVDI28a')||0;\nvar xWindowOffice = global.get ('xWindowOffice')||0;\nvar rOfficeContactBattery = global.get ('rOfficeContactBattery')||0;\nvar xOfficeHeating = global.get ('xOfficeHeating')||0;\nvar xOffice_SP_Heating = global.get ('xOffice_SP_Heating')||0;\n// STORAGE ROOM\nvar xVDO101 = global.get ('xVDO101')||0;\nvar xWindowStorage = global.get ('xWindowStorage')||0;\nvar rStorageContactBattery = global.get ('rStorageContactBattery')||0;\n// GARAGE\nvar xLightGarage = global.get ('xLightGarage')||0;\nvar xWindowGarageLeft = global.get ('xWindowGarageLeft')||0;\nvar xWindowGarageRight = global.get ('xWindowGarageRight')||0;\nvar rGarageContactLeftBattery = global.get ('rGarageContactLeftBattery')||0;\nvar rGarageContactRightBattery = global.get ('rGarageContactRightBattery')||0;\n// WC\nvar xStatusVl_Wc = global.get ('xStatusVl_Wc')||0;\nvar xWindowWC = global.get ('xWindowWC')||0;\nvar rWCContactBattery = global.get ('rWCContactBattery')||0;\n// ENTRANCE\nvar xVDI102 = global.get ('xVDI102')||0;\nvar xDoorEntrance = global.get ('xDoorEntrance')||0;\nvar rEntranceContactBattery = global.get ('rEntranceContactBattery')||0;\nvar xOpenFrontdoor = global.get ('xOpenFrontdoor')||0;\n// STAIRCASE\nvar xVDI02 = global.get ('xVDI02')||0;\nvar xVDI02a = global.get ('xVDI02a')||0;\n// BATHROOM\nvar xVDI20 = global.get ('xVDI20')||0;\nvar xVDI20a = global.get ('xVDI20a')||0;\nvar xVDI21 = global.get ('xVDI21')||0;\nvar xVDI21a = global.get ('xVDI21a')||0;\nvar xVDI105 = global.get ('xVDI105')||0;\nvar xSceneBadkamer1 = global.get ('xSceneBadkamer1')||0;\nvar xSceneBadkamer2 = global.get ('xSceneBadkamer2')||0;\nvar xWindowBathroom = global.get ('xWindowBathroom')||0;\nvar rBathroomContactBattery = global.get ('rBathroomContactBattery')||0;\nvar xBathroomHeating = global.get ('xBathroomHeating')||0;\n// MASTERBEDROOM + DRESSING\nvar xVDI13 = global.get ('xVDI13')||0;\nvar xVDI13a = global.get ('xVDI13a')||0;\nvar xVDI14 = global.get ('xVDI14')||0;\nvar xVDI14a = global.get ('xVDI14a')||0;\nvar xWindowMasterBedroomLeft = global.get ('xWindowMasterBedroomLeft')||0;\nvar xWindowMasterBedroomRight = global.get ('xWindowMasterBedroomRight')||0;\nvar rMasterContactLeftBattery = global.get ('rMasterContactLeftBattery')||0;\nvar rMasterContactRightBattery = global.get ('rMasterContactRightBattery')||0;\nvar xMasterbedroomHeating = global.get ('xMasterbedroomHeating')||0;\nvar xDaddysLightStatus = global.get ('xDaddysLightStatus')||0\nvar xMommysLightStatus = global.get ('xMommysLightStatus')||0\n// VISITORS ROOM\nvar xVDI15 = global.get ('xVDI15')||0;\nvar xVDI15a = global.get ('xVDI15a')||0;\nvar xWindowVisitorsRoom = global.get ('xWindowVisitorsRoom')||0;\nvar rVisitorContactBattery = global.get ('rVisitorContactBattery')||0;\nvar xVisitorsRoomHeating = global.get ('xVisitorsRoomHeating')||0;\n// SCENES LEVEL 2\nvar xSceneLevel2_1 = global.get ('xSceneLevel2_1')||0;\nvar xSceneLevel2_2 = global.get ('xSceneLevel2_2')||0;\nvar xSceneLevel2_3 = global.get ('xSceneLevel2_3')||0;\nvar xSceneLevel2_4 = global.get ('xSceneLevel2_4')||0;\nvar xSceneLevel2_5 = global.get ('xSceneLevel2_5')||0;\nvar xSceneLevel2_6 = global.get ('xSceneLevel2_6')||0;\n// BEDROOM LISA\nvar xLisaWarzoneLight = global.get ('xLisaWarzoneLight')||0;\nvar xLisaWarzoneLighta = global.get ('xLisaWarzoneLighta')||0;\nvar xLisaRelaxzoneLight = global.get ('xLisaRelaxzoneLight')||0;\nvar xLisaRelaxzoneLighta = global.get ('xLisaRelaxzoneLighta')||0;\nvar xWindowBedroomLisaLeft = global.get ('xWindowBedroomLisaLeft')||0;\nvar xWindowBedroomLisaRight = global.get ('xWindowBedroomLisaRight')||0;\nvar rBedLisaContactLeftBattery = global.get ('rBedLisaContactLeftBattery')||0;\nvar rBedLisaContactRightBattery = global.get ('rBedLisaContactRightBattery')||0;\nvar xBedroomLisaHeating = global.get ('xBedroomLisaHeating')||0;\n// SHOWERROOM\nvar xShowerLight = global.get ('xShowerLight')||0;\nvar xShowerLighta = global.get ('xShowerLighta')||0;\nvar xWindowShowerroom = global.get ('xWindowShowerroom')||0;\nvar rShowerContactBattery = global.get ('rShowerContactBattery')||0;\nvar xShowerroomHeating = global.get ('xShowerroomHeating')||0;\n// BEDROOM AMY\nvar xAmyWarzoneLight = global.get ('xAmyWarzoneLight')||0;\nvar xAmyWarzoneLighta = global.get ('xAmyWarzoneLighta')||0;\nvar xAmyRelaxzoneLight = global.get ('xAmyRelaxzoneLight')||0;\nvar xAmyRelaxzoneLighta = global.get ('xAmyRelaxzoneLighta')||0;\nvar xWindowBedroomAmyLeft = global.get ('xWindowBedroomAmyLeft')||0;\nvar xWindowBedroomAmyRight = global.get ('xWindowBedroomAmyRight')||0;\nvar rBedAmyContactLeftBattery = global.get ('rBedAmyContactLeftBattery')||0;\nvar rBedAmyContactRightBattery = global.get ('rBedAmyContactRightBattery')||0;\nvar xBedroomAmyHeating = global.get ('xBedroomAmyHeating')||0;\nvar xAmysLightStatus = global.get ('xAmysLightStatus')||0;\n// MEDIAROOM\nvar xMainLightMediaroom = global.get ('xMainLightMediaroom')||0;\nvar xMainLightMediarooma = global.get ('xMainLightMediarooma')||0;\nvar xWallLightMediaroom = global.get ('xWallLightMediaroom')||0;\nvar xWallLightMediarooma = global.get ('xWallLightMediarooma')||0;\nvar xFloorLightMediaroom = global.get ('xFloorLightMediaroom')||0;\nvar xFloorLightMediarooma = global.get ('xFloorLightMediarooma')||0;\nvar xSceneMediaRoom1 = global.get ('xSceneMediaRoom1')||0;\nvar xSceneMediaRoom2 = global.get ('xSceneMediaRoom2')||0;\nvar xSceneMediaRoom3 = global.get ('xSceneMediaRoom3')||0;\nvar xSceneMediaRoom4 = global.get ('xSceneMediaRoom4')||0;\nvar xSceneMediaRoom5 = global.get ('xSceneMediaRoom5')||0;\nvar xSceneMediaRoom6 = global.get ('xSceneMediaRoom6')||0;\nvar xWindowMediaroom = global.get ('xWindowMediaroom')||0;\nvar rMediaroomContactBattery = global.get ('rMediaroomContactBattery')||0;\nvar xMediaroomHeating = global.get ('xMediaroomHeating')||0;\n// BOILERROOM\nvar xVlBoilerroom = global.get ('xVlBoilerroom')||0;\nvar xWaterleakBoilerroom = global.get ('xWaterleakBoilerroom')||0;\nvar rBoilerRoomFloodTemp = global.get ('rBoilerRoomFloodTemp')||0;\nvar rBoilerRoomFloodBattery = global.get ('rBoilerRoomFloodBattery')||0;\nvar xWarmWaterPump = global.get ('xWarmWaterPump')||0;\n// ATIC\nvar xVlZolder = global.get ('xVlZolder')||0;\n// EMERGY MEASUREMENT\nvar rPlug1Power = global.get ('rPlug1Power')||0;\nvar rPlug2Power = global.get ('rPlug2Power')||0;\nvar arr = [\n    // BASEMENT\n    [\"xVDI119\", \"BOOL\", xVDI119],\n    [\"xVDI119a\", \"BOOL\", xVDI119a],    \n    [\"xWaterleakBasement\", \"BOOL\", xWaterleakBasement],\n    [\"rBasementFloodTemp\", \"REAL\", rBasementFloodTemp], \n    [\"rBasementFloodBattery\", \"REAL\", rBasementFloodBattery],\n    // LIVING ROOM & KITCHEN\n    [\"xVDI22\", \"BOOL\", xVDI22],\n    [\"xVDI22a\", \"BOOL\", xVDI22a],    \n    [\"xVDI23\", \"BOOL\", xVDI23],\n    [\"xVDI23a\", \"BOOL\", xVDI23a],    \n    [\"xVDI24\", \"BOOL\", xVDI24],\n    [\"xVDI24a\", \"BOOL\", xVDI24a],  \n    [\"xVDI29\", \"BOOL\", xVDI29],\n    [\"xVDI29a\", \"BOOL\", xVDI29a],    \n    [\"xVDI30\", \"BOOL\", xVDI30],\n    [\"xVDI30a\", \"BOOL\", xVDI30a],    \n    [\"xSlidingWindow\", \"BOOL\", xSlidingWindow],\n    [\"rSlidingWindowBattery\", \"REAL\", rSlidingWindowBattery],\n    [\"xVDI31\", \"BOOL\", xVDI31],\n    [\"xVDI31a\", \"BOOL\", xVDI31a],    \n    [\"xVDI32\", \"BOOL\", xVDI32],\n    [\"xVDI32a\", \"BOOL\", xVDI32a],    \n    [\"xWindowSittingRoom\", \"BOOL\", xWindowSittingRoom],\n    [\"rSittingRoomContactBattery\", \"REAL\", rSittingRoomContactBattery],\n    [\"xSceneLeefruimte1\", \"BOOL\", xSceneLeefruimte1],\n    [\"xSceneLeefruimte2\", \"BOOL\", xSceneLeefruimte2],\n    [\"xSceneLeefruimte3\", \"BOOL\", xSceneLeefruimte3],\n    [\"xSceneLeefruimte4\", \"BOOL\", xSceneLeefruimte4],\n    [\"xSceneLeefruimte5\", \"BOOL\", xSceneLeefruimte5],\n    [\"xSceneLeefruimte6\", \"BOOL\", xSceneLeefruimte6],\n    [\"xWaterleakKitchen\", \"BOOL\", xWaterleakKitchen],\n    [\"rKitchenFloodBattery\", \"REAL\", rKitchenFloodBattery],\n    // OFFICE\n    [\"xVDI28\", \"BOOL\", xVDI28],\n    [\"xVDI28a\", \"BOOL\", xVDI28a],\n    [\"xWindowOffice\", \"BOOL\", xWindowOffice],\n    [\"rOfficeContactBattery\", \"REAL\", rOfficeContactBattery],\n    [\"xOfficeHeating\", \"BOOL\", xOfficeHeating],\n    [\"xOffice_SP_Heating\", \"REAL\", xOffice_SP_Heating],\n    // STORAGE ROOM\n    [\"xVDO101\", \"BOOL\", xVDO101],\n    [\"xWindowStorage\", \"BOOL\", xWindowStorage],\n    [\"rStorageContactBattery\", \"REAL\", rStorageContactBattery],\n    // GARAGE\n    [\"xLightGarage\", \"BOOL\", xLightGarage],\n    [\"xWindowGarageLeft\", \"BOOL\", xWindowGarageLeft],\n    [\"xWindowGarageRight\", \"BOOL\", xWindowGarageRight],\n    [\"rGarageContactLeftBattery\", \"REAL\", rGarageContactLeftBattery],\n    [\"rGarageContactRightBattery\", \"REAL\", rGarageContactRightBattery],\n    // TOILET\n    [\"xStatusVl_Wc\", \"BOOL\", xStatusVl_Wc],\n    [\"xWindowWC\", \"BOOL\", xWindowWC],\n    [\"rWCContactBattery\", \"REAL\", rWCContactBattery],\n    // ENTRANCE\n    [\"xVDI102\", \"BOOL\", xVDI102],\n    [\"xDoorEntrance\", \"BOOL\", xDoorEntrance],\n    [\"rEntranceContactBattery\", \"REAL\", rEntranceContactBattery],\n    [\"xOpenFrontdoor\", \"BOOL\", xOpenFrontdoor],\n    // STARECASE\n    [\"xVDI02\", \"BOOL\", xVDI02],\n    [\"xVDI02a\", \"BOOL\", xVDI02a],    \n    //BATHROOM\n    [\"xVDI20\", \"BOOL\", xVDI20],\n    [\"xVDI20a\", \"BOOL\", xVDI20a],    \n    [\"xVDI21\", \"BOOL\", xVDI21],\n    [\"xVDI21a\", \"BOOL\", xVDI21a],    \n    [\"xVDI105\", \"BOOL\", xVDI105],\n    [\"xSceneBadkamer1\", \"BOOL\", xSceneBadkamer1],\n    [\"xSceneBadkamer2\", \"BOOL\", xSceneBadkamer2],\n    [\"xWindowBathroom\", \"BOOL\", xWindowBathroom],\n    [\"rBathroomContactBattery\", \"REAL\", rBathroomContactBattery],\n    [\"xBathroomHeating\", \"BOOL\", xBathroomHeating],\n    // MASTERBEDROOM & DRESSING\n    [\"xVDI13\", \"BOOL\", xVDI13],\n    [\"xVDI13a\", \"BOOL\", xVDI13a],    \n    [\"xVDI14\", \"BOOL\", xVDI14],\n    [\"xVDI14a\", \"BOOL\", xVDI14a],    \n    [\"xWindowMasterBedroomLeft\", \"BOOL\", xWindowMasterBedroomLeft],\n    [\"xWindowMasterBedroomRight\", \"BOOL\", xWindowMasterBedroomRight],\n    [\"rMasterContactLeftBattery\", \"REAL\", rMasterContactLeftBattery],\n    [\"rMasterContactRightBattery\", \"REAL\", rMasterContactRightBattery],\n    [\"xMasterbedroomHeating\", \"BOOL\", xMasterbedroomHeating],\n    [\"xDaddysLightStatus\", \"BOOL\", xDaddysLightStatus],\n    [\"xMommysLightStatus\", \"BOOL\", xMommysLightStatus],\n    // VISITORSROOM\n    [\"xVDI15\", \"BOOL\", xVDI15],\n    [\"xVDI15a\", \"BOOL\", xVDI15a],   \n    [\"xWindowVisitorsRoom\", \"BOOL\", xWindowVisitorsRoom],\n    [\"rVisitorContactBattery\", \"REAL\", rVisitorContactBattery],\n    [\"xVisitorsRoomHeating\", \"BOOL\", xVisitorsRoomHeating],\n    // SCENES LEVEL 2\n    [\"xSceneLevel2_1\", \"BOOL\", xSceneLevel2_1],\n    [\"xSceneLevel2_2\", \"BOOL\", xSceneLevel2_2],\n    [\"xSceneLevel2_3\", \"BOOL\", xSceneLevel2_3],\n    [\"xSceneLevel2_4\", \"BOOL\", xSceneLevel2_4],\n    [\"xSceneLevel2_5\", \"BOOL\", xSceneLevel2_5],\n    [\"xSceneLevel2_6\", \"BOOL\", xSceneLevel2_6],\n    // BEDROOM LISA\n    [\"xLisaWarzoneLight\", \"BOOL\", xLisaWarzoneLight],\n    [\"xLisaWarzoneLighta\", \"BOOL\", xLisaWarzoneLighta],    \n    [\"xLisaRelaxzoneLight\", \"BOOL\", xLisaRelaxzoneLight],\n    [\"xLisaRelaxzoneLighta\", \"BOOL\", xLisaRelaxzoneLighta],\n    [\"xWindowBedroomLisaLeft\", \"BOOL\", xWindowBedroomLisaLeft],\n    [\"xWindowBedroomLisaRight\", \"BOOL\", xWindowBedroomLisaRight],\n    [\"rBedLisaContactLeftBattery\", \"REAL\", rBedLisaContactLeftBattery],\n    [\"rBedLisaContactRightBattery\", \"REAL\", rBedLisaContactRightBattery],\n    [\"xBedroomLisaHeating\", \"BOOL\", xBedroomLisaHeating],\n    // SHOWERROOM\n    [\"xShowerLight\", \"BOOL\", xShowerLight],\n    [\"xShowerLighta\", \"BOOL\", xShowerLighta],   \n    [\"xWindowShowerroom\", \"BOOL\", xWindowShowerroom],\n    [\"rShowerContactBattery\", \"REAL\", rShowerContactBattery],\n    [\"xShowerroomHeating\", \"BOOL\", xShowerroomHeating],\n    // BEDROOM AMY\n    [\"xAmyWarzoneLight\", \"BOOL\", xAmyWarzoneLight],\n    [\"xAmyWarzoneLighta\", \"BOOL\", xAmyWarzoneLighta],    \n    [\"xAmyRelaxzoneLight\", \"BOOL\", xAmyRelaxzoneLight],\n    [\"xAmyRelaxzoneLighta\", \"BOOL\", xAmyRelaxzoneLighta],    \n    [\"xWindowBedroomAmyLeft\", \"BOOL\", xWindowBedroomAmyLeft],\n    [\"xWindowBedroomAmyRight\", \"BOOL\", xWindowBedroomAmyRight],\n    [\"rBedAmyContactLeftBattery\", \"REAL\", rBedAmyContactLeftBattery],\n    [\"rBedAmyContactRightBattery\", \"REAL\", rBedAmyContactRightBattery],\n    [\"xBedroomAmyHeating\", \"BOOL\", xBedroomAmyHeating],\n        [\"xAmysLightStatus\", \"BOOL\", xAmysLightStatus],\n    // MEDIAMROOM\n    [\"xMainLightMediaroom\", \"BOOL\", xMainLightMediaroom],\n    [\"xMainLightMediarooma\", \"BOOL\", xMainLightMediarooma],    \n    [\"xWallLightMediaroom\", \"BOOL\", xWallLightMediaroom],\n    [\"xWallLightMediarooma\", \"BOOL\", xWallLightMediarooma],    \n    [\"xFloorLightMediaroom\", \"BOOL\", xFloorLightMediaroom],\n    [\"xFloorLightMediarooma\", \"BOOL\", xFloorLightMediarooma],   \n    [\"xSceneMediaRoom1\", \"BOOL\", xSceneMediaRoom1],\n    [\"xSceneMediaRoom2\", \"BOOL\", xSceneMediaRoom2],\n    [\"xSceneMediaRoom3\", \"BOOL\", xSceneMediaRoom3],\n    [\"xSceneMediaRoom4\", \"BOOL\", xSceneMediaRoom4],\n    [\"xSceneMediaRoom5\", \"BOOL\", xSceneMediaRoom5],\n    [\"xSceneMediaRoom6\", \"BOOL\", xSceneMediaRoom6],\n    [\"xWindowMediaroom\", \"BOOL\", xWindowMediaroom],\n    [\"rMediaroomContactBattery\", \"REAL\", rMediaroomContactBattery],\n    [\"xMediaroomHeating\", \"BOOL\", xMediaroomHeating],\n    // BOILERROOM\n    [\"xVlBoilerroom\", \"BOOL\", xVlBoilerroom],\n    [\"xWaterleakBoilerroom\", \"BOOL\", xWaterleakBoilerroom],\n    [\"rBoilerRoomFloodTemp\", \"REAL\", rBoilerRoomFloodTemp],\n    [\"rBoilerRoomFloodBattery\", \"REAL\", rBoilerRoomFloodBattery],\n    [\"xWarmWaterPump\", \"BOOL\", xWarmWaterPump],\n    // ATIC\n    [\"xVlZolder\", \"BOOL\", xVlZolder],\n    // ENERGY MEASUREMENT\n    [\"rPlug1Power\", \"REAL\", rPlug1Power],\n    [\"rPlug2Power\", \"REAL\", rPlug2Power]\n    ];\nmsg_o.payload = arr;\nreturn msg_o;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":915,"y":380,"wires":[["5a50f88c.5fa398"]],"l":false},{"id":"5a50f88c.5fa398","type":"netvar-sender","z":"d440d994.606fc8","index":"3","idnum":"2970419","x":1180,"y":380,"wires":[["7b0075d5.bd21cc"]]},{"id":"7b0075d5.bd21cc","type":"udp out","z":"d440d994.606fc8","name":"","addr":"192.168.86.76","iface":"","port":"1203","ipv":"udp4","outport":"","base64":false,"multicast":"false","x":1430,"y":380,"wires":[]},{"id":"3f4f023c.fff09e","type":"inject","z":"d440d994.606fc8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":570,"y":380,"wires":[["d3d10b2f.68ecc8"]]},{"id":"d3d10b2f.68ecc8","type":"trigger","z":"d440d994.606fc8","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"-50","extend":false,"overrideDelay":false,"units":"ms","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":770,"y":380,"wires":[["cbccd4a4.91c678"]]},{"id":"6e3e4505.d2368c","type":"udp in","z":"d440d994.606fc8","name":"","iface":"","port":"1203","ipv":"udp4","multicast":"false","group":"","datatype":"buffer","x":560,"y":80,"wires":[["48d7c.d736e2844"]]},{"id":"48d7c.d736e2844","type":"netvar-receiver","z":"d440d994.606fc8","index":"1","vars":"xVDO19:BOOL;xVDO18:BOOL;xVDO06:BOOL;xVDO07:BOOL;xVDO08:BOOL;xVAO03:BOOL;xVAO04:BOOL;xVAO05:BOOL;xKachel:BOOL;xGaragedoor:BOOL;xStatusVL_Garage:BOOL;xAlarm1Patch:BOOL;xVDO17:BOOL;rTempOffice:REAL;rReferenceOffice:REAL;xVDI101:BOOL;xVDO102:BOOL;xVDO10:BOOL;xStaircaseSatusTimer:BOOL;xVDO05:BOOL;xVAO01:BOOL;xVDO105:BOOL;xVDO13:BOOL;xVAO02:BOOL;xDaddysLightSwitch:BOOL;xMommysLightSwitch:BOOL;xVDO16:BOOL;xVDO14:BOOL;xVDO15:BOOL;xVDO04:BOOL;xVDO11:BOOL;xVDO12:BOOL;xAmysLightSwitch:BOOL;xAO02_HVAC:BOOL;xVDO08_HVAC:BOOL;xAO01_HVAC:BOOL;xVDOVlBoilerroom:BOOL;xVDOVlZolder:BOOL;","x":840,"y":80,"wires":[["9d5ad1e7.23023","3b88c11c.e480be"]]},{"id":"9d5ad1e7.23023","type":"function","z":"d440d994.606fc8","name":"split","func":"var msg_o = {};\nmsg_o={\n    [msg.payload[0][0]]:Boolean(msg.payload[0][2]),\n    [msg.payload[1][0]]:Boolean(msg.payload[1][2]),\n    [msg.payload[2][0]]:Boolean(msg.payload[2][2]),\n    [msg.payload[3][0]]:Boolean(msg.payload[3][2]),\n    [msg.payload[4][0]]:Boolean(msg.payload[4][2]),\n    [msg.payload[5][0]]:Boolean(msg.payload[5][2]),\n    [msg.payload[6][0]]:Boolean(msg.payload[6][2]),\n    [msg.payload[7][0]]:Boolean(msg.payload[7][2]),\n    [msg.payload[8][0]]:Boolean(msg.payload[8][2]),\n    [msg.payload[9][0]]:Boolean(msg.payload[9][2]),\n    [msg.payload[10][0]]:Boolean(msg.payload[10][2]),\n    [msg.payload[11][0]]:Boolean(msg.payload[11][2]),\n    [msg.payload[12][0]]:Boolean(msg.payload[12][2]),\n    [msg.payload[13][0]]:msg.payload[13][2],\n    [msg.payload[14][0]]:msg.payload[14][2],\n    [msg.payload[15][0]]:Boolean(msg.payload[15][2]),\n    [msg.payload[16][0]]:Boolean(msg.payload[16][2]),\n    [msg.payload[17][0]]:Boolean(msg.payload[17][2]),\n    [msg.payload[18][0]]:Boolean(msg.payload[18][2]),\n    [msg.payload[19][0]]:Boolean(msg.payload[19][2]),\n    [msg.payload[20][0]]:Boolean(msg.payload[20][2]),\n    [msg.payload[21][0]]:Boolean(msg.payload[21][2]),\n    [msg.payload[22][0]]:Boolean(msg.payload[22][2]),\n    [msg.payload[23][0]]:Boolean(msg.payload[23][2]),\n    [msg.payload[24][0]]:Boolean(msg.payload[24][2]),\n    [msg.payload[25][0]]:Boolean(msg.payload[25][2]),\n    [msg.payload[26][0]]:Boolean(msg.payload[26][2]),\n    [msg.payload[27][0]]:Boolean(msg.payload[27][2]),\n    [msg.payload[28][0]]:Boolean(msg.payload[28][2]),\n    [msg.payload[29][0]]:Boolean(msg.payload[29][2]),\n    [msg.payload[30][0]]:Boolean(msg.payload[30][2]),\n    [msg.payload[31][0]]:Boolean(msg.payload[31][2]),\n    [msg.payload[32][0]]:Boolean(msg.payload[32][2]),\n    [msg.payload[33][0]]:Boolean(msg.payload[33][2]),\n    [msg.payload[34][0]]:Boolean(msg.payload[34][2]),\n    [msg.payload[35][0]]:Boolean(msg.payload[35][2]),\n    [msg.payload[36][0]]:Boolean(msg.payload[36][2]),\n    [msg.payload[37][0]]:Boolean(msg.payload[37][2])\n};\n    return [msg_o];","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1150,"y":80,"wires":[["e509dc9.64f852"]]},{"id":"bccfbe43.6688e","type":"comment","z":"d440d994.606fc8","name":"Recieving VAR from PLC + split array","info":"","x":170,"y":80,"wires":[]},{"id":"1d89a41.99f165c","type":"comment","z":"d440d994.606fc8","name":"create array + sending var to PLC","info":"","x":150,"y":380,"wires":[]},{"id":"e509dc9.64f852","type":"link out","z":"d440d994.606fc8","name":"Variable list 1 - from PFC100","links":["f4e51cd8.672f4","5fa891e8.ee1ed","9b912cfa.ef42a","1fc09aa2.f35c15","9ee81938.d5cc88","33f8f44b.757eac","3d0ecd90.df68f2","59f6480.b385fb8","f1748525.ae9ae8","3ccb5d72.e46582","b8ce8ae6.352938","68fb8de7.b07ee4","74d267d.68afe98","47409d6.7c4e564","e5979e34.24dd9","7c6429ec.939488","bc9d9b2b.6484e8","a5deba7b.db3118","343a84c.180257c","ed200a36.7aabe8","dab9ed7e.b2af3","76a58f1a.310db","c3598625.a219a8","32ad1a6e.c96626","de60e8cd.165098","ad5d7503.2e2058","bf3196d0.f854c8","6175ff83.9d066","c17f93b2.da56a","f5100acf.e224c8","c8d20bb5.65e928","4aebbde0.3af1d4","3d6c7dbb.143622","89c3bbc0.1a2098","cdfc42b0.5b4e","f8b8192b.7c6198","5580542f.2bc4bc","bc493d95.1b2c4","1959004.d76ad","9bee6a8d.ae2d58","183d1b90.c182f4","d387ac37.8e4c8","aa26af48.83ad8","9840d2ad.d6534","710df357.f32a9c","2c09d6b1.8b068a"],"x":1475,"y":80,"wires":[]},{"id":"25b8256b.68d7da","type":"noraf-thermostat","z":"d440d994.606fc8","devicename":"Thermostat","roomhint":"Office","name":"","modes":"off,heat,on,auto","unit":"C","rangeMin":"","rangeMax":"","topic":"","passthru":false,"commandOnly":false,"queryOnly":false,"bufferRangeCelsius":2,"nora":"fcc92e05.a8bf8","x":1230,"y":200,"wires":[["7a8d0820.fad5d8"]]},{"id":"ff07a713.f74648","type":"change","z":"d440d994.606fc8","name":"rTempOffice","rules":[{"t":"set","p":"payload","pt":"msg","to":"rTempOffice","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":510,"y":200,"wires":[["4fda9ca0.3b0084"]]},{"id":"710df357.f32a9c","type":"link in","z":"d440d994.606fc8","name":"","links":["e509dc9.64f852"],"x":395,"y":200,"wires":[["ff07a713.f74648","f5afc0f7.55f79"]]},{"id":"f5afc0f7.55f79","type":"change","z":"d440d994.606fc8","name":"rReferenceOffice","rules":[{"t":"set","p":"payload","pt":"msg","to":"rReferenceOffice","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":530,"y":260,"wires":[["77d80085.a745"]]},{"id":"10257529.fde44b","type":"function","z":"d440d994.606fc8","name":"Format Object","func":"var data = {};\nvar rReferenceOffice = global.get ('rReferenceOffice')||0;\nvar rTempOffice = global.get ('rTempOffice')||0;\ndata = {\n    mode: \"heat\",\n    setpoint: rReferenceOffice,\n    temperature: rTempOffice\n}\nmsg.payload = data\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1020,"y":200,"wires":[["25b8256b.68d7da"]]},{"id":"7a8d0820.fad5d8","type":"change","z":"d440d994.606fc8","name":"","rules":[{"t":"set","p":"xOffice_SP_Heating","pt":"global","to":"payload.setpoint","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1470,"y":200,"wires":[[]]},{"id":"4fda9ca0.3b0084","type":"change","z":"d440d994.606fc8","name":"","rules":[{"t":"set","p":"rTempOffice","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":200,"wires":[["10257529.fde44b"]]},{"id":"77d80085.a745","type":"change","z":"d440d994.606fc8","name":"","rules":[{"t":"set","p":"rReferenceOffice","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":760,"y":260,"wires":[["10257529.fde44b"]]},{"id":"3b88c11c.e480be","type":"debug","z":"d440d994.606fc8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1060,"y":140,"wires":[]},{"id":"fcc92e05.a8bf8","type":"noraf-config","name":"","group":"","twofactor":"off","twofactorpin":"","localexecution":true,"structure":""}]

Hello David,

Just a few simple questions:

  1. Is the picture with all the arrays the result of what has been presented in the "Debug" node, connected to the output of the netvar-receiver node?

  2. Is the temperature always in element 13 of the array and the setpoint always in element 14?
    Or can the position in the array vary?

Everything in one tab is fine. Then we don't need all those variables.

If I have the answers on both questions above, I will create first the stream from the netvar-receive node to Smart-Nora node. You can test that and if that is okay and it functions to your desire we taken the other side.

Regards

Hey,

  1. Yes indeed it is
  2. Those variables are indeed always in element 13 and 14 as long as I don't change the list. But the array has some personal organisation per room so possibly in the future I will add some variables that could come before or after. At that moment the element number will change.

Thanks, I am impressed with your willingness to help me!

grtz

David

Hello David,

With this information I have created a very simple flow. It ignores all other values, but takes only element 13 and 14 into account.

[{"id":"e111e9f7.5741c8","type":"function","z":"9862336b.eee69","name":"Function In Thermostaat","func":"msg.payload = {\n    setpoint : msg.payload[14][2],\n    temperature : msg.payload[13][2],\n    mode : heat\n};\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1010,"y":780,"wires":[["3cce6795.6c121"]]},{"id":"6e3e4505.d2368c","type":"udp in","z":"9862336b.eee69","name":"","iface":"","port":"1203","ipv":"udp4","multicast":"false","group":"","datatype":"buffer","x":560,"y":780,"wires":[["48d7c.d736e2844"]]},{"id":"48d7c.d736e2844","type":"netvar-receiver","z":"9862336b.eee69","index":"1","vars":"xVDO19:BOOL;xVDO18:BOOL;xVDO06:BOOL;xVDO07:BOOL;xVDO08:BOOL;xVAO03:BOOL;xVAO04:BOOL;xVAO05:BOOL;xKachel:BOOL;xGaragedoor:BOOL;xStatusVL_Garage:BOOL;xAlarm1Patch:BOOL;xVDO17:BOOL;rTempOffice:REAL;rReferenceOffice:REAL;xVDI101:BOOL;xVDO102:BOOL;xVDO10:BOOL;xStaircaseSatusTimer:BOOL;xVDO05:BOOL;xVAO01:BOOL;xVDO105:BOOL;xVDO13:BOOL;xVAO02:BOOL;xDaddysLightSwitch:BOOL;xMommysLightSwitch:BOOL;xVDO16:BOOL;xVDO14:BOOL;xVDO15:BOOL;xVDO04:BOOL;xVDO11:BOOL;xVDO12:BOOL;xAmysLightSwitch:BOOL;xAO02_HVAC:BOOL;xVDO08_HVAC:BOOL;xAO01_HVAC:BOOL;xVDOVlBoilerroom:BOOL;xVDOVlZolder:BOOL;","x":760,"y":780,"wires":[["3b88c11c.e480be","e111e9f7.5741c8"]]},{"id":"3b88c11c.e480be","type":"debug","z":"9862336b.eee69","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":970,"y":840,"wires":[]},{"id":"3cce6795.6c121","type":"noraf-thermostat","z":"9862336b.eee69","devicename":"Thermostat","roomhint":"Office","name":"","modes":"off,heat,on,auto","unit":"C","rangeMin":"","rangeMax":"","topic":"","passthru":false,"commandOnly":false,"queryOnly":false,"bufferRangeCelsius":2,"nora":"fcc92e05.a8bf8","twofactorpin":"","x":1250,"y":780,"wires":[[]]},{"id":"fcc92e05.a8bf8","type":"noraf-config","name":"","group":"","twofactor":"off","twofactorpin":"","localexecution":true,"structure":""}]

Can you test it:

  1. Check that the temperature as indicated by your PLC is the same as indicated in the Google Home app for this Thermostat.

  2. Check the speech and Google should tell you the temperature and setpoint

  3. Change the setpoint in your PLC. This should also be changed in Google.

Currently it is not possible to give a command to change the setpoint.

Let me know.

Regards

Hey FireWizard,

Works just fine, impressive!

Makes me realize I have to reconsider my approach...

grtz

Hello David,

You can remove a lot of nodes, unless you need some for another function.

The next step is to send the msg.payload.setpoint to netvar-sender.

What does this netvar-sender expect?

Does it really expect every 50 msec. that it receives all the data as in the Function node?
Or is only line 194 sufficient:

["xOffice_SP_Heating", "REAL", xOffice_SP_Heating],

If you send only the value, when you change the setpoint from your PLC, would that work?

Regards

Hey,

Yes indeed it's an eye opener. But I guess it will be less manageable when I stick to my initial structure. Guess I need to overthink it...
The nedvar sender should send an array to the plc with the 'spoken' setpoint of heating, it needs to be a 'real'.
The 50ms is actually coming from the lead time of the PLC that sends out the list. I guess for heating it is less important, a little latency doesn't harm. On the other hand, for controlling the light you don't want it to take to long. Max 200ms?
I think only sending the list 'on change' is not an option, to many variables.
Maybe I'm using the wrong communication protocol?
My plc is also handling MODbus, so that could be an option?

grtz

Hello David, @Baste,

The nedvar sender should send an array to the plc with the 'spoken' setpoint of heating, it needs to be a 'real'

I have been watching a movie on YouTube and they did it the same way as you did it. So probably you output flow should work.
Did you already test with the change node connected to the Smart-Nora output node?

I suggest you try. and test it as follows:

  1. Send a Change Setpoit command from the Google Home app and check if the setpoint has been changed in your PLC Dashboard.

  2. Do the same with speech.

Maybe I'm using the wrong communication protocol?
My plc is also handling MODbus, so that could be an option?

Could be more efficient, but on the other hand, if it works to your satisfaction, I would leave it that way.

Regards

Hey FireWizard52,

I think I'm starting to understand the problem, I noticed something while playing. I changed the send frequency from the senderlist to 10s in place of 50ms (this is the list who is send back from node red to the PLC).
When I do this I can see the setpoint change at the input of the thermostat node, even the text under the node which mentions the setpoint changes.

image.png

But when I put the debug node at the output of the thermostat node, there is no value returned. So thats probably why the value of the setpoint returned to the plc doesn't get overwritten and the value in the sendlist doesn't change. In this case, the only way to change the setpoint is true voice, then the node does return an output.

So I checked this one:
image.png

When I do this, the PLC's visualisation get's the overhand and I'm no longer able to change the setpoint by voice. When I connect a debug node to the output of the thermostat node I see the 'voice' changed value come by but it get's overwriten instantly.
I guess the changed value doesn't get returned fast enough to the input of the thermostat node. You could say it get's overwriten immediatly by the initial value.
I have been playing with the recieve time (from PLC to nodered) and the send time of node red with the idea to give the node some time to get the returned value, but unfortunately without succes.
So I don't really know how to handle this problem. Any idea?

Thx & grtz

David

Hello David, @Baste

You wrote:

I think I'm starting to understand the problem, I noticed something while playing. I changed the send frequency from the senderlist to 10s in place of 50ms (this is the list who is send back from node red to the PLC).
When I do this I can see the setpoint change at the input of the thermostat node, even the text under the node which mentions the setpoint changes.

This happens always and the data under the node changes according to the Input (In this case mode: heat, temperature 20 degrees and the setpoint 16 degrees)
The setpoint will also change if the data comes from Google Home through the Thermostat node.

But when I put the debug node at the output of the thermostat node, there is no value returned.

That is because the data is received at the Input, so from the PLC.

In this case, the only way to change the setpoint is true voice, then the node does return an output.

Or manual in the app. But what you saw is the correct behavior.

So I checked this one:

Then you create a loop, which may cause problems.

I guess the changed value doesn't get returned fast enough to the input of the thermostat node.

I do not think that that is a good solution. The setpoint received from Google Home should be sent to the PLC and the PLC should not send it back to the thermostat node.

I guess the changed value doesn't get returned fast enough to the input of the thermostat node. You could say it gets overwritten immediately by the initial value.

This assumption is probably correct.

So I don't really know how to handle this problem. Any idea?

We can try to use a RBE node, which will only accept a value once, until the data has changed.

Can you try this flow:

[{"id":"e111e9f7.5741c8","type":"function","z":"9862336b.eee69","name":"Function In Thermostaat","func":"msg.payload = {\n    setpoint : msg.payload[14][2],\n    temperature : msg.payload[13][2],\n    mode : heat\n};\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1010,"y":780,"wires":[["68c6575f.b8914"]]},{"id":"6e3e4505.d2368c","type":"udp in","z":"9862336b.eee69","name":"","iface":"","port":"1203","ipv":"udp4","multicast":"false","group":"","datatype":"buffer","x":560,"y":780,"wires":[["48d7c.d736e2844"]]},{"id":"48d7c.d736e2844","type":"netvar-receiver","z":"9862336b.eee69","index":"1","vars":"xVDO19:BOOL;xVDO18:BOOL;xVDO06:BOOL;xVDO07:BOOL;xVDO08:BOOL;xVAO03:BOOL;xVAO04:BOOL;xVAO05:BOOL;xKachel:BOOL;xGaragedoor:BOOL;xStatusVL_Garage:BOOL;xAlarm1Patch:BOOL;xVDO17:BOOL;rTempOffice:REAL;rReferenceOffice:REAL;xVDI101:BOOL;xVDO102:BOOL;xVDO10:BOOL;xStaircaseSatusTimer:BOOL;xVDO05:BOOL;xVAO01:BOOL;xVDO105:BOOL;xVDO13:BOOL;xVAO02:BOOL;xDaddysLightSwitch:BOOL;xMommysLightSwitch:BOOL;xVDO16:BOOL;xVDO14:BOOL;xVDO15:BOOL;xVDO04:BOOL;xVDO11:BOOL;xVDO12:BOOL;xAmysLightSwitch:BOOL;xAO02_HVAC:BOOL;xVDO08_HVAC:BOOL;xAO01_HVAC:BOOL;xVDOVlBoilerroom:BOOL;xVDOVlZolder:BOOL;","x":760,"y":780,"wires":[["3b88c11c.e480be","e111e9f7.5741c8"]]},{"id":"3b88c11c.e480be","type":"debug","z":"9862336b.eee69","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":970,"y":840,"wires":[]},{"id":"3cce6795.6c121","type":"noraf-thermostat","z":"9862336b.eee69","devicename":"Thermostat","roomhint":"Office","name":"","modes":"off,heat,on,auto","unit":"C","rangeMin":"","rangeMax":"","topic":"","passthru":false,"commandOnly":false,"queryOnly":false,"bufferRangeCelsius":2,"nora":"fcc92e05.a8bf8","twofactorpin":"","x":1510,"y":780,"wires":[[]]},{"id":"68c6575f.b8914","type":"rbe","z":"9862336b.eee69","name":"Report by Exception","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","x":1280,"y":780,"wires":[["3cce6795.6c121"]]},{"id":"fcc92e05.a8bf8","type":"noraf-config","name":"","group":"","twofactor":"off","twofactorpin":"","localexecution":true,"structure":""}]

Let me know.

Hey FireWizard52,

I tried the node with big expectations, unfortunately no positive result. Depressing...
I'm thinking that maybe the variables don't get handled correctly in the plc as I'm trying to write from visualisation and the variable list at the same time.
So I'm gonna contact my friends at Wago and check with them if there is nothing wrong with the program. Hopefully there is some result to find, otherwise I will return to my garden and treat the flowers as they should, leaving this problem for next winter. I'll keep you in touch :wink:
thanks!

Grtz

Hi David, @Baste

One quick question.

Did you uncheck "If messages arrived on input, etc?
You should do that.

Regards

Hey Firewizard,

Yes I did but didn't worked. I think even if the node doesn't sends out a variable, maybe the initial value is maintained in the sender list and therefore keeps overwriting the new value in the plc.
Everything in node red seems logic and correct now, so I will look at the level of PLC program. Actually I'm gonna try to do the same as the rbe node in my plc program, maybe that will do the job?
I only have to figure out how to program it... I'll keep you in touch.
Thanks for the help!

grtz