rdmtc / node-red-contrib-ccu

Node-RED Nodes for the Homematic CCU
https://flows.nodered.org/node/node-red-contrib-ccu
MIT License
70 stars 13 forks source link

Error: Local address XXX not available. Using YYY instead. #155

Open Simon01011 opened 3 years ago

Simon01011 commented 3 years ago

Hello!

I have an issue with an error message I receive on every start of node red and on every single deploy of my flows. I'm running node-red-contrib-ccu version 3.4.2 on a node red installation on a raspberry pi. Besides the error message everything works as expected. The message in my case is: "Local address 192.168.10.101 not available. Using 192.168.10.22 instead." My node red is running on a machine with IP 192.168.10.22. The raspberrymatic is running on 192.168.30.10. The log after a deploy is (only relevant lines):

31 Aug 21:52:53 - [info] Flows werden gestartet
31 Aug 21:52:53 - [error] [ccu-connection:192.168.30.10] Local address 192.168.10.101 not available. Using 192.168.10.22 instead.
31 Aug 21:52:54 - [info] [ccu-connection:192.168.30.10] paramsets loaded from /home/pi/.node-red/paramsets.json
31 Aug 21:52:54 - [info] [ccu-connection:192.168.30.10] metadata loaded from /home/pi/.node-red/ccu_192.168.30.10.json
31 Aug 21:52:54 - [info] [ccu-connection:192.168.30.10] regadata loaded from /home/pi/.node-red/ccu_rega_192.168.30.10.json
31 Aug 21:52:54 - [info] [ccu-connection:192.168.30.10] values loaded from /home/pi/.node-red/ccu_values_192.168.30.10.json
...
31 Aug 21:52:54 - [info] Flows sind gestartet
31 Aug 21:52:55 - [info] [ccu-connection:192.168.30.10] rega getValues
31 Aug 21:52:55 - [info] [ccu-connection:192.168.30.10] values saved to /home/pi/.node-red/ccu_values_192.168.30.10.json
31 Aug 21:52:55 - [info] [ccu-connection:192.168.30.10] Interfaces: ReGaHSS, BidCos-RF, HmIP-RF, VirtualDevices
31 Aug 21:52:55 - [info] [ccu-connection:192.168.30.10] Interface ReGaHSS connected
31 Aug 21:52:55 - [info] [ccu-connection:192.168.30.10] init BidCos-RF http://192.168.10.22:2042 nr_7OdbGb_BidCos-RF
31 Aug 21:52:55 - [info] [ccu-connection:192.168.30.10] init HmIP-RF http://192.168.10.22:2042 nr_7OdbGb_HmIP-RF
31 Aug 21:52:56 - [info] [ccu-connection:192.168.30.10] init VirtualDevices http://192.168.10.22:2042 nr_7OdbGb_VirtualDevices
31 Aug 21:52:56 - [info] [ccu-connection:192.168.30.10] xmlrpc server listening on http://192.168.10.22:2042
31 Aug 21:52:56 - [info] [ccu-connection:192.168.30.10] Interface BidCos-RF http port 2001 connected
31 Aug 21:52:56 - [info] [ccu-connection:192.168.30.10] Interface VirtualDevices http port 9292 connected
31 Aug 21:52:56 - [info] [ccu-connection:192.168.30.10] Interface HmIP-RF http port 2010 connected
31 Aug 21:52:56 - [info] [ccu-connection:192.168.30.10] regadata saved to /home/pi/.node-red/ccu_rega_192.168.30.10.json
31 Aug 21:52:56 - [info] [ccu-connection:192.168.30.10] metadata saved to /home/pi/.node-red/ccu_192.168.30.10.json

The error occured after I changed the IP of the node red machine from 192.168.10.101 to 192.168.10.22. Looking at the config node I cannot see a setting with the 101 address: image Digging deeper I found in the file flows_automation.json (automation is the host name of the machine) this object:

{"id":"38263145.35ea0e","type":"ccu-connection","name":"192.168.30.10","host":"192.168.30.10","regaEnabled":true,"bcrfEnabled":true,"iprfEnabled":true,"virtEnabled":true,"bcwiEnabled":false,"cuxdEnabled":false,"regaPoll":true,"regaInterval":"30","rpcPingTimeout":"60","rpcInitAddress":"192.168.10.22","rpcServerHost":"192.168.10.101","rpcBinPort":"2041","rpcXmlPort":"2042","tls":false,"inSecure":false,"authentication":false,"username":"","password":"","queueTimeout":"5000","queuePause":"250","contextStore":""}

I don't know what this rpcServerHost is used for or why it has the old IP address set, but after backing up the flows file and changing 101 to 22, the error was gone.

Maybe there's a way to avoid this error. And last but not least thank you for the work on this great software!

Sineos commented 3 years ago

See here for some details: https://github.com/rdmtc/node-red-contrib-ccu#configuration-examples Could be because of the missing Listen address

Simon01011 commented 3 years ago

Okay, I changed the flow file back to the old state with "rpcServerHost":"192.168.10.101" and the error appeared again. Then I filled the empty listen address field in the config node and the error went away. Checking in the flow file the rpcServerHost was set to the listen address.

I didn't fill this field because it says in the help inside node red that this field may be left empty:

Init Address: entspricht normalerweise Listen address, Die Adresse unter der Node-RED von der CCU aus erreichbar ist. Das Eingabefeld kann leer gelassen werden.

But I cannot remember, maybe I filled the listen address field at the time the machine had its old IP address and cleared it after changing the IP to the new one... But for me the problem is solved now, thank you!