Node-Red Doesn't Update Sensors & HA Integration Issues

Greetings,
i’m having trouble updating the NodeRed program made by a student before me for the automation & manual control of ventilation system in the building & readings from Energy Meters & Impulse Flowmeters
He is using ModBus / TCP, i have not yet connected the ethernet to the Intel NUC nor am i sure will it work automatically and start reading from that cable to NodeRed on NUC.

I tried setting up a simple button in HA & sensor to see if it’s on off (low speed / high speed)

It looks like this in Node-Red:

[
  {
    "id": "44c6fae4.4e6134",
    "type": "modbus-read",
    "z": "97f2a942.7250c8",
    "name": "",
    "topic": "low",
    "showStatusActivities": false,
    "logIOActivities": false,
    "showErrors": false,
    "showWarnings": true,
    "unitid": "1",
    "dataType": "HoldingRegister",
    "adr": "23",
    "quantity": "2",
    "rate": "1",
    "rateUnit": "s",
    "delayOnStart": false,
    "startDelayTime": "",
    "server": "10bb4c8a.889823",
    "useIOFile": false,
    "ioFile": "",
    "useIOForPayload": false,
    "emptyMsgOnFail": false,
    "x": 250,
    "y": 700,
    "wires": [
      [ "31d6e100.4b223" ],
      []
    ]
  },
  {
    "id": "31d6e100.4b223",
    "type": "function",
    "z": "97f2a942.7250c8",
    "name": "",
    "func": "let v1 = msg.payload[0]\nlet v2 = msg.payload[1]\nlet v1payload = {payload: v1}\nlet v2payload = {payload: v2}\nif(v2 > v1 ) { return v2payload } \nelse {return v1payload}",
    "outputs": 1,
    "timeout": "",
    "noerr": 0,
    "initialize": "",
    "finalize": "",
    "libs": [],
    "x": 500,
    "y": 720,
    "wires": [ [ "e65bf774.684768", "93f2a6e5.453a18", "8151a789e7acf2ce" ] ]
  },
  {
    "id": "6daa681f.a2f868",
    "type": "ui_text",
    "z": "97f2a942.7250c8",
    "group": "5703a672.163828",
    "order": 6,
    "width": 16,
    "height": 1,
    "name": "mala hitrost",
    "label": "<font size = 6>Preostali čas mala hitrost: {{msg.payload}}",
    "format": "",
    "layout": "row-center",
    "className": "",
    "style": false,
    "font": "",
    "fontSize": "",
    "color": "#000000",
    "x": 1090,
    "y": 720,
    "wires": []
  },
  {
    "id": "e65bf774.684768",
    "type": "function",
    "z": "97f2a942.7250c8",
    "name": "",
    "func": "let sec = msg.payload\nseconds = sec % 60\ntime = sec / 60\nminutes = time % 60\ntime /= 60\nhours = time % 24\nlet hoursint = parseInt(hours);\nlet minutesint = parseInt(minutes);\nlet secondsint = parseInt(seconds);\nlet string = new String (\"0min : 0sec\");\nlet stringsec =  string.replace( seconds > 9 ? \"0sec\" : \"sec\" , secondsint );\nlet stringmin =  stringsec.replace( minutes > 9 ? \"0min\" : \"min\" , minutesint  );\n//let stringhour =  stringmin.replace(hours > 9 ? \"0hour\" : \"hour\" , hoursint  );\nreturn { payload:stringmin };",
    "outputs": 1,
    "noerr": 0,
    "initialize": "",
    "finalize": "",
    "x": 800,
    "y": 720,
    "wires": [ [ "6daa681f.a2f868", "8316ce12.4b12a" ] ]
  },
  {
    "id": "8316ce12.4b12a",
    "type": "debug",
    "z": "97f2a942.7250c8",
    "name": "",
    "active": false,
    "tosidebar": true,
    "console": false,
    "tostatus": false,
    "complete": "false",
    "statusVal": "",
    "statusType": "auto",
    "x": 1120,
    "y": 820,
    "wires": []
  },
  {
    "id": "88d0efdb.b2f78",
    "type": "modbus-read",
    "z": "97f2a942.7250c8",
    "name": "",
    "topic": "low",
    "showStatusActivities": false,
    "logIOActivities": false,
    "showErrors": false,
    "unitid": "1",
    "dataType": "HoldingRegister",
    "adr": "25",
    "quantity": "2",
    "rate": "1",
    "rateUnit": "s",
    "delayOnStart": false,
    "startDelayTime": "",
    "server": "10bb4c8a.889823",
    "useIOFile": false,
    "ioFile": "",
    "useIOForPayload": false,
    "emptyMsgOnFail": false,
    "x": 250,
    "y": 920,
    "wires": [
      [ "c86fcb87.8b6f48" ],
      []
    ]
  },
  {
    "id": "c86fcb87.8b6f48",
    "type": "function",
    "z": "97f2a942.7250c8",
    "name": "",
    "func": "let v1 = msg.payload[0]\nlet v2 = msg.payload[1]\nlet v1payload = {payload: v1}\nlet v2payload = {payload: v2}\nif(v2 > v1 ) { return v2payload } \nelse {return v1payload}",
    "outputs": 1,
    "noerr": 0,
    "initialize": "",
    "finalize": "",
    "x": 500,
    "y": 920,
    "wires": [ [ "6325bb5a.e7f7b4", "321ad586.69460a", "228d85285ad7a359" ] ]
  },
  {
    "id": "430fa8a.1bcc758",
    "type": "ui_text",
    "z": "97f2a942.7250c8",
    "group": "5703a672.163828",
    "order": 7,
    "width": 16,
    "height": 1,
    "name": "velika hitrost",
    "label": "<font size = 6>Preostali čas velika hitrost: {{msg.payload}}",
    "format": "",
    "layout": "row-center",
    "x": 1090,
    "y": 920,
    "wires": []
  },
  {
    "id": "73fdd17f.d10ee",
    "type": "debug",
    "z": "97f2a942.7250c8",
    "name": "",
    "active": false,
    "tosidebar": true,
    "console": false,
    "tostatus": false,
    "complete": "false",
    "statusVal": "",
    "statusType": "auto",
    "x": 1120,
    "y": 1020,
    "wires": []
  },
  {
    "id": "6325bb5a.e7f7b4",
    "type": "debug",
    "z": "97f2a942.7250c8",
    "name": "",
    "active": false,
    "tosidebar": true,
    "console": false,
    "tostatus": false,
    "complete": "false",
    "statusVal": "",
    "statusType": "auto",
    "x": 770,
    "y": 1020,
    "wires": []
  },
  {
    "id": "93f2a6e5.453a18",
    "type": "debug",
    "z": "97f2a942.7250c8",
    "name": "",
    "active": false,
    "tosidebar": true,
    "console": false,
    "tostatus": false,
    "complete": "payload",
    "targetType": "msg",
    "statusVal": "",
    "statusType": "auto",
    "x": 810,
    "y": 800,
    "wires": []
  },
  {
    "id": "321ad586.69460a",
    "type": "function",
    "z": "97f2a942.7250c8",
    "name": "",
    "func": "let sec = msg.payload\nseconds = sec % 60\ntime = sec / 60\nminutes = time % 60\ntime /= 60\nhours = time % 24\nlet hoursint = parseInt(hours);\nlet minutesint = parseInt(minutes);\nlet secondsint = parseInt(seconds);\nlet string = new String (\"0min : 0sec\");\nlet stringsec =  string.replace( seconds > 9 ? \"0sec\" : \"sec\" , secondsint );\nlet stringmin =  stringsec.replace( minutes > 9 ? \"0min\" : \"min\" , minutesint  );\n//let stringhour =  stringmin.replace(hours > 9 ? \"0hour\" : \"hour\" , hoursint  );\nreturn { payload:stringmin };",
    "outputs": 1,
    "noerr": 0,
    "initialize": "",
    "finalize": "",
    "x": 820,
    "y": 920,
    "wires": [ [ "430fa8a.1bcc758", "73fdd17f.d10ee" ] ]
  },
  {
    "id": "a6fb79af55b13b7f",
    "type": "ha-button",
    "z": "97f2a942.7250c8",
    "name": "Vklop Velike Hitrosti",
    "version": 0,
    "debugenabled": false,
    "outputs": 1,
    "entityConfig": "99da321324b56385",
    "outputProperties": [
      {
        "property": "payload",
        "propertyType": "msg",
        "value": "",
        "valueType": "entityState"
      },
      {
        "property": "topic",
        "propertyType": "msg",
        "value": "",
        "valueType": "triggerId"
      },
      {
        "property": "data",
        "propertyType": "msg",
        "value": "",
        "valueType": "entity"
      }
    ],
    "x": 250,
    "y": 980,
    "wires": [ [ "c86fcb87.8b6f48" ] ]
  },
  {
    "id": "8151a789e7acf2ce",
    "type": "ha-binary-sensor",
    "z": "97f2a942.7250c8",
    "name": "Mala Hitrost Vklopljena",
    "entityConfig": "116c04f6442dc194",
    "version": 0,
    "state": "true",
    "stateType": "bool",
    "attributes": [],
    "inputOverride": "merge",
    "outputProperties": [],
    "x": 840,
    "y": 860,
    "wires": [ [] ]
  },
  {
    "id": "228d85285ad7a359",
    "type": "ha-binary-sensor",
    "z": "97f2a942.7250c8",
    "name": "Velika Hitrost Vklopljena",
    "entityConfig": "a865c9ec458968fe",
    "version": 0,
    "state": "payload",
    "stateType": "msg",
    "attributes": [],
    "inputOverride": "allow",
    "outputProperties": [],
    "x": 850,
    "y": 1080,
    "wires": [ [] ]
  },
  {
    "id": "69f4cdd437f07e09",
    "type": "ha-switch",
    "z": "97f2a942.7250c8",
    "name": "Vklop Male Hitrosti",
    "version": 0,
    "debugenabled": false,
    "inputs": 0,
    "outputs": 2,
    "entityConfig": "e5e1b4c1fb7a3ec7",
    "enableInput": false,
    "outputOnStateChange": false,
    "outputProperties": [
      {
        "property": "outputType",
        "propertyType": "msg",
        "value": "state change",
        "valueType": "str"
      },
      {
        "property": "payload",
        "propertyType": "msg",
        "value": "",
        "valueType": "entityState"
      }
    ],
    "x": 270,
    "y": 780,
    "wires": [
      [ "31d6e100.4b223" ],
      []
    ]
  },
  {
    "id": "10bb4c8a.889823",
    "type": "modbus-client",
    "name": "LOGO",
    "clienttype": "tcp",
    "bufferCommands": true,
    "stateLogEnabled": false,
    "queueLogEnabled": false,
    "tcpHost": "192.168.2.50",
    "tcpPort": "505",
    "tcpType": "DEFAULT",
    "serialPort": "/dev/ttyUSB",
    "serialType": "RTU-BUFFERD",
    "serialBaudrate": "9600",
    "serialDatabits": "8",
    "serialStopbits": "1",
    "serialParity": "none",
    "serialConnectionDelay": "100",
    "unit_id": "1",
    "commandDelay": "1",
    "clientTimeout": "1000",
    "reconnectOnTimeout": true,
    "reconnectTimeout": "2000",
    "parallelUnitIdsAllowed": true
  },
  {
    "id": "5703a672.163828",
    "type": "ui_group",
    "name": "Ročno/auto/temperatura",
    "tab": "9f7d7744.697db8",
    "order": 2,
    "disp": true,
    "width": 16,
    "collapse": true
  },
  {
    "id": "99da321324b56385",
    "type": "ha-entity-config",
    "server": "b09259d4.60b188",
    "deviceConfig": "91b7b4b9ca651569",
    "name": "Potrdi Izbiro",
    "version": 6,
    "entityType": "button",
    "haConfig": [
      {
        "property": "name",
        "value": "Potrdi Izbiro Načina"
      },
      {
        "property": "icon",
        "value": "mdi:button"
      },
      {
        "property": "entity_picture",
        "value": ""
      },
      {
        "property": "entity_category",
        "value": ""
      },
      {
        "property": "device_class",
        "value": ""
      }
    ],
    "resend": false,
    "debugEnabled": false
  },
  {
    "id": "116c04f6442dc194",
    "type": "ha-entity-config",
    "server": "b09259d4.60b188",
    "deviceConfig": "91b7b4b9ca651569",
    "name": "Mala Hitrost Vklopljena",
    "version": 6,
    "entityType": "binary_sensor",
    "haConfig": [
      {
        "property": "name",
        "value": "Mala Hitrost Vklopljena"
      },
      {
        "property": "icon",
        "value": "mdi:switch"
      },
      {
        "property": "entity_picture",
        "value": ""
      },
      {
        "property": "entity_category",
        "value": ""
      },
      {
        "property": "device_class",
        "value": ""
      }
    ],
    "resend": false,
    "debugEnabled": false
  },
  {
    "id": "a865c9ec458968fe",
    "type": "ha-entity-config",
    "server": "b09259d4.60b188",
    "deviceConfig": "91b7b4b9ca651569",
    "name": "Velika Hitrost Vklopljena",
    "version": 6,
    "entityType": "binary_sensor",
    "haConfig": [
      {
        "property": "name",
        "value": "Velika Hitrost Vklopljena"
      },
      {
        "property": "icon",
        "value": "mdi:switch"
      },
      {
        "property": "entity_picture",
        "value": ""
      },
      {
        "property": "entity_category",
        "value": ""
      },
      {
        "property": "device_class",
        "value": ""
      }
    ],
    "resend": false,
    "debugEnabled": false
  },
  {
    "id": "e5e1b4c1fb7a3ec7",
    "type": "ha-entity-config",
    "server": "b09259d4.60b188",
    "deviceConfig": "91b7b4b9ca651569",
    "name": "Vklop Male Hitrost",
    "version": 6,
    "entityType": "switch",
    "haConfig": [
      {
        "property": "name",
        "value": "Vklop Male Hitrost"
      },
      {
        "property": "icon",
        "value": "mdi:switch"
      },
      {
        "property": "entity_picture",
        "value": ""
      },
      {
        "property": "entity_category",
        "value": ""
      },
      {
        "property": "device_class",
        "value": ""
      }
    ],
    "resend": false,
    "debugEnabled": false
  },
  {
    "id": "9f7d7744.697db8",
    "type": "ui_tab",
    "name": "Klima",
    "icon": "dashboard",
    "order": 1,
    "disabled": false,
    "hidden": false
  },
  {
    "id": "b09259d4.60b188",
    "type": "server",
    "name": "Home Assistant",
    "addon": true
  },
  {
    "id": "91b7b4b9ca651569",
    "type": "ha-device-config",
    "name": "Kontrola Prezračevanja",
    "hwVersion": "",
    "manufacturer": "Node-RED",
    "model": "",
    "swVersion": ""
  }
]

The full CODE is posted here for the NodeRed:

Any solutions, tips etc. as it’s my first time with NodeRed would be helpful!

The value going to the binary sensor, needs to be a boolean value. From what I can see 2 was sent to the binary sensor. That would need to be converted to true or false depending on what the value represents.

That is very possible… But same goes for all other buttons i’ve now implemented they don’t send thru the signal and don’t flick the switch on the dashboard
example:



The input for Text (Minutes, Seconds) works but the reset timer same as the “izklop hlajenja…” one doesn’t seem to work.

Would this also be an issue regarding the Bool compared to string function?

I didn’t notice this at first for the binary sensor you need to set the state to msg. This is what will allow you to send in the value to the entity.

image

payload tells the node which message to use for it’s state, that needs to be a boolean value.

The switch you created will act as a gate or a trigger that would then send a value defined in another node. see edit below.

E. If you check the output inside the switch you can then assign a value to be sent when the state changes.

This doesn’t seem to be working still for the binary sensor - not sure as to why i’m complicating it or why it seems complicated, shouldn’t it just follow the output of the element beforehand (switch) and just show yes or no, 0 or 1



Would it be viable trashing the program made by person before me and creating it myself? - Or removing dashboard control, i am just unsure how the modbus read/write’s work… Since it seems that the READ’s are the inputs from the dashboard not a physical item

Change payload to entity state, you have it set as sent data


Seems to not be an option for me…

The one below that msg.payload

Shows the same as top…

That is wrong node, the switch node. If you want the switch node to send a value when switched, you need to enable output.

this node is the one you need to edit to send a value


So something like this… But i get the random error on binary sensor due to probs not being configured right

Try this without sending it through the function.

[{"id":"69f4cdd437f07e09","type":"ha-switch","z":"8e6ef4f6cbb13d83","name":"Vklop Male Hitrosti","version":0,"debugenabled":false,"inputs":0,"outputs":2,"entityConfig":"e5e1b4c1fb7a3ec7","enableInput":false,"outputOnStateChange":true,"outputProperties":[{"property":"outputType","propertyType":"msg","value":"state change","valueType":"str"},{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"x":330,"y":1780,"wires":[["8151a789e7acf2ce"],["8151a789e7acf2ce"]]},{"id":"8151a789e7acf2ce","type":"ha-binary-sensor","z":"8e6ef4f6cbb13d83","name":"Mala Hitrost Vklopljena","entityConfig":"116c04f6442dc194","version":0,"state":"payload","stateType":"msg","attributes":[],"inputOverride":"merge","outputProperties":[],"x":700,"y":1780,"wires":[[]]},{"id":"e5e1b4c1fb7a3ec7","type":"ha-entity-config","server":"","deviceConfig":"91b7b4b9ca651569","name":"Vklop Male Hitrost","version":6,"entityType":"switch","haConfig":[{"property":"name","value":"Vklop Male Hitrost"},{"property":"icon","value":"mdi:switch"},{"property":"entity_picture","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":""}],"resend":false,"debugEnabled":false},{"id":"116c04f6442dc194","type":"ha-entity-config","server":"","deviceConfig":"91b7b4b9ca651569","name":"Mala Hitrost Vklopljena","version":6,"entityType":"binary_sensor","haConfig":[{"property":"name","value":"Mala Hitrost Vklopljena"},{"property":"icon","value":"mdi:switch"},{"property":"entity_picture","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":""}],"resend":false,"debugEnabled":false},{"id":"91b7b4b9ca651569","type":"ha-device-config","name":"Kontrola Prezračevanja","hwVersion":"","manufacturer":"Node-RED","model":"","swVersion":""}]

This works! So the function is doin something weird for it to not be able to read the output at the end?

I actually got it TO FUNCTION FINALLY! Thank you so much for the help!!

Only issue is that it doesn’t go offline now…


When all is OFF it stays ON (dashboard view)

Right. You need to connect it to the ethernet and see if it connects to the modbus. I can see that it is trying to connect, as long as user/passwords weren’t changed it should connect.

Once it is connected then once you get the actual message from the modbus node into the function. From there you can use a switch and a change node to alter the value.

Say 2 is on and 0 was off.

[{"id":"611a53bf4b4c4060","type":"inject","z":"8e6ef4f6cbb13d83","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"2","payloadType":"num","x":270,"y":1060,"wires":[["0560d4e850246a79"]]},{"id":"bb00e6ab75f9e64b","type":"inject","z":"8e6ef4f6cbb13d83","name":"0","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"num","x":270,"y":1120,"wires":[["0560d4e850246a79"]]},{"id":"0560d4e850246a79","type":"switch","z":"8e6ef4f6cbb13d83","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"2","vt":"num"},{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":490,"y":1100,"wires":[["38b2214147d70611"],["2720552b06b6ab92"]]},{"id":"38b2214147d70611","type":"change","z":"8e6ef4f6cbb13d83","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":1060,"wires":[["bb61fcde5c9f50dc"]]},{"id":"2720552b06b6ab92","type":"change","z":"8e6ef4f6cbb13d83","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":1140,"wires":[["bb61fcde5c9f50dc"]]},{"id":"bb61fcde5c9f50dc","type":"debug","z":"8e6ef4f6cbb13d83","name":"binary sensor","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1010,"y":1100,"wires":[]}]

I see so currently it would need the ModBus IP’s etc. to function properly and display the right OFF / ON values in the dashboard
Similiar to this part - it doesn’t want to flick OFF / ON and i copy pasted the function from the other part, it should be the same concept
function is:

return { payload: msg.payload[0] }

With the switch node the top outputs on, the bottom sends off.

Would i have to connect both? I thought it would automatically recognise OFF / ON from the ON part, this way turning it off wouldn’t work?

The first input also stays ON the whole time (on dashboard) but it’s all OFF in the NodeRed Programming View

I connected both ON / OFF from Switch it now switches inbetween - yet on the other image i sent (Copy pasted nodes) it doesn’t seem to function the same way and doesn’t turn off / on at all

What i did for that part is:

[{"id":"98deb14.0a7b05","type":"ui_switch","z":"66edcd13.55f854","name":"","label":"<font size = 6>izklop hlajenja glede na želeno temperaturo","tooltip":"izklop hlajenja glede na želeno temperaturo","group":"5703a672.163828","order":22,"width":16,"height":1,"passthru":false,"decouple":"false","topic":"","topicType":"str","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":true,"className":"","x":1270,"y":1260,"wires":[["cd8ca1d6.224cd"]]},{"id":"2ef6b5c9.de543a","type":"modbus-read","z":"66edcd13.55f854","name":"","topic":"","showStatusActivities":false,"logIOActivities":false,"showErrors":false,"showWarnings":true,"unitid":"1","dataType":"Coil","adr":"76","quantity":"1","rate":"1","rateUnit":"s","delayOnStart":false,"startDelayTime":"","server":"10bb4c8a.889823","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"x":690,"y":1280,"wires":[["c60f55b7.759dd8"],[]]},{"id":"cd8ca1d6.224cd","type":"modbus-write","z":"66edcd13.55f854","name":"","showStatusActivities":false,"showErrors":false,"showWarnings":true,"unitid":"1","dataType":"Coil","adr":"76","quantity":"1","server":"10bb4c8a.889823","emptyMsgOnFail":false,"keepMsgProperties":false,"delayOnStart":false,"startDelayTime":"","x":1620,"y":1260,"wires":[[],[]]},{"id":"c60f55b7.759dd8","type":"function","z":"66edcd13.55f854","name":"","func":"return { payload: msg.payload[0] }","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":920,"y":1260,"wires":[["98deb14.0a7b05"]]},{"id":"56d5b8ceba03e66c","type":"ha-switch","z":"66edcd13.55f854","name":"Izklop Hlajenja Na Želeno Temperaturo","version":0,"debugenabled":false,"inputs":0,"outputs":2,"entityConfig":"b0bc769d2282d392","enableInput":false,"outputOnStateChange":true,"outputProperties":[{"property":"outputType","propertyType":"msg","value":"state change","valueType":"str"},{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"x":710,"y":1380,"wires":[["98deb14.0a7b05","22a57ea6a7ec5aeb"],["22a57ea6a7ec5aeb"]]},{"id":"22a57ea6a7ec5aeb","type":"ha-binary-sensor","z":"66edcd13.55f854","name":"Izklop Hlajenja Na Želeno Temperaturo","entityConfig":"b5b22b9f952a7d6e","version":0,"state":"payload","stateType":"msg","attributes":[],"inputOverride":"merge","outputProperties":[],"x":1250,"y":1380,"wires":[[]]},{"id":"5703a672.163828","type":"ui_group","name":"Ročno/auto/temperatura","tab":"9f7d7744.697db8","order":2,"disp":true,"width":16,"collapse":true},{"id":"10bb4c8a.889823","type":"modbus-client","name":"LOGO","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"192.168.2.50","tcpPort":"505","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":"1","commandDelay":"1","clientTimeout":"1000","reconnectOnTimeout":true,"reconnectTimeout":"2000","parallelUnitIdsAllowed":true},{"id":"b0bc769d2282d392","type":"ha-entity-config","server":"aadc97cc1869071b","deviceConfig":"91b7b4b9ca651569","name":"Izklop Hlajenja Na Želeno Temperaturo","version":6,"entityType":"switch","haConfig":[{"property":"name","value":"Izklop Hlajenja Na Želeno Temperaturo"},{"property":"icon","value":"mdi:switch"},{"property":"entity_picture","value":""},{"property":"entity_category","value":"config"},{"property":"device_class","value":"switch"}],"resend":false,"debugEnabled":false},{"id":"b5b22b9f952a7d6e","type":"ha-entity-config","server":"aadc97cc1869071b","deviceConfig":"","name":"Izklop Hlajenja Na Želeno Temperaturo","version":6,"entityType":"binary_sensor","haConfig":[{"property":"name","value":"Izklop Hlajenja Na Želeno Temperaturo"},{"property":"icon","value":"mdi:electric_switch"},{"property":"entity_picture","value":""},{"property":"entity_category","value":"diagnostic"},{"property":"device_class","value":""}],"resend":false,"debugEnabled":false},{"id":"9f7d7744.697db8","type":"ui_tab","name":"Klima","icon":"dashboard","order":1,"disabled":false,"hidden":false},{"id":"aadc97cc1869071b","type":"server","name":"Home Assistant","addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"","connectionDelay":false,"cacheJson":false,"heartbeat":false,"heartbeatInterval":"","statusSeparator":"","enableGlobalContextStore":false},{"id":"91b7b4b9ca651569","type":"ha-device-config","name":"Kontrola Prezračevanja","hwVersion":"","manufacturer":"Node-RED","model":"","swVersion":""}]

The pastebin flow does not look like it used home assistant. That light blue switch is for nodered’s dashboard which I do not use.

You don’t need to use it unless you want to. Home assistants dashboard options are much more customizable.

The overall program was made to be controlled only by NodeRed i am trying to now implement HA into it and the switches etc. to be controlled on the Home Assistant system, but i am trying to do it so i still have the NodeRed dashboard available.

For some things maybe it’d be more viable just to remove them sadly?
Like currently for this part i am unable to switch the above switch

Fixed it! It was set to OUTPUT not INPUT

1 Like

I would need to see what comes out of that light blue node and the function to be able to tell you how to swap out the NR dash switch to home assistant

[{"id":"f47838212cd596d7","type":"ui_switch","z":"b41aca381a06aa53","name":"","label":"<font size = 6>Izklop ročnega upravljanja","tooltip":"","group":"5703a672.163828","order":2,"width":16,"height":1,"passthru":false,"decouple":"true","topic":"","topicType":"str","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":true,"className":"","x":840,"y":1240,"wires":[["8aa24e3797dff0e8","2d7cac8589ca9fcf"]]},{"id":"8aa24e3797dff0e8","type":"modbus-write","z":"b41aca381a06aa53","name":"","showStatusActivities":false,"showErrors":false,"showWarnings":true,"unitid":"1","dataType":"Coil","adr":"40","quantity":"1","server":"10bb4c8a.889823","emptyMsgOnFail":false,"keepMsgProperties":false,"delayOnStart":false,"startDelayTime":"","x":1240,"y":1240,"wires":[[],[]]},{"id":"bb3f7c4ca3610aec","type":"modbus-read","z":"b41aca381a06aa53","name":"Ročno izklop","topic":"","showStatusActivities":false,"logIOActivities":false,"showErrors":false,"unitid":"1","dataType":"Coil","adr":"40","quantity":"1","rate":"1","rateUnit":"s","delayOnStart":false,"startDelayTime":"","server":"10bb4c8a.889823","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"x":230,"y":1240,"wires":[["93ee4c753ab7d46b"],[]]},{"id":"93ee4c753ab7d46b","type":"function","z":"b41aca381a06aa53","name":"","func":"let v1 = msg.payload[0];\nreturn { payload: v1 }\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":480,"y":1240,"wires":[["f47838212cd596d7","5010ce14ed4f85e2"]]},{"id":"2d7cac8589ca9fcf","type":"debug","z":"b41aca381a06aa53","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1190,"y":1300,"wires":[]},{"id":"5010ce14ed4f85e2","type":"debug","z":"b41aca381a06aa53","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":650,"y":1300,"wires":[]},{"id":"5703a672.163828","type":"ui_group","name":"Ročno/auto/temperatura","tab":"9f7d7744.697db8","order":2,"disp":true,"width":16,"collapse":true},{"id":"10bb4c8a.889823","type":"modbus-client","name":"LOGO","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"192.168.2.50","tcpPort":"505","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":"1","commandDelay":"1","clientTimeout":"1000","reconnectOnTimeout":true,"reconnectTimeout":"2000","parallelUnitIdsAllowed":true},{"id":"9f7d7744.697db8","type":"ui_tab","name":"Klima","icon":"dashboard","order":1,"disabled":false,"hidden":false}]