codmpm / node-red-contrib-loxone

Connect the Loxone Miniserver to node-red via the Websocket API
MIT License
74 stars 24 forks source link

Control-In connection lost after deployment #41

Closed yenzor closed 4 years ago

yenzor commented 4 years ago

Hi Patrik,

I am experiencing an issue with the Control-In nodes. While at first everything is working fine, meaning I receive status changes from a Loxone Virtual In- or Output via the Control-In Node, they stop working after I deploy changes in Node-RED (even if it's just moving the position of a comment). The Control-Out as well as the Online Node are still working, so there obviously still is a connection to the miniserver. If I restart Node-RED or the miniserver everything is working again. Until I do another deployment in Node-RED...

Interestingly enough, when I changed RedMatics log level from info to debug, to look for anything helpful, I could deploy several times without an issue. But after changing back to info log mode I have again this issue.

I can't say for certain if this started with v0.10.4, but I am experieninge this issue only recently. And it sounds pretty much that this could have to do with the latest changes made regarding #33 ?!

Best Regards, Jens

P.S.: Thank you for all your work on the Loxone nodes! I am really happy with the Loxone<>Node-RED integration.


node-red-contrib-loxone v0.10.4 Node-RED v1.0.3 using RedMativ v5.3.10

codmpm commented 4 years ago

Hey Jens,

thank you. Sadly I can not reproduce the problem here. My control-in-node is hooked to a simple switch and I've full-deployed like 15-20 times without any hassle.

Bildschirmfoto 2020-01-27 um 11 11 25

[{"id":"f5537e07.fb3d98","type":"loxone-control-in","z":"74df0efa.a9c5b8","name":"","miniserver":"640a19c6.12bc7","control":"10965a26-0124-4b65-ffff403fb0c34b9e","state":"10965a26-0124-4b62-ffff90eb033172c2","x":160,"y":920,"wires":[["6527b07e.c391a"]]},{"id":"6527b07e.c391a","type":"debug","z":"74df0efa.a9c5b8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":350,"y":920,"wires":[]},{"id":"640a19c6.12bc7","type":"loxone-miniserver","z":"","host":"nodelox.codm.de","port":"80","enctype":"0","active":true}]

Does this only happen on a full-deploy or also when deploying only changes? I personally don't worked with RedMatic. Which nodeJS version do you run?

~Just saw that I'm using node-red 0.20.5 and nodeJS v8.15.1. Will update and try again.~ nodeJS v12.14.1, node-red 1.0.3, node-red-contrib-loxone 0.10.4... still can not reproduce this :-|

yenzor commented 4 years ago

Hey Patrik, thank you for your fast response! Currently nodeJS v10.18.1 is installed with RedMatic. I have the issue with all Control-In nodes, no matter if it is connected to a switch, virtual input or virtual output. However, I now realize it appears only if I do a full deploy. If I just deploy changed nodes or flows it seems to be working fine. Another effect that happens in parallel is that all room, category etc. information in all (Loxone) nodes gets lost (after full deploy). Though its only the Control-In nodes not working afterwards. If I do an "Update" in the miniserver config nodes properties then all information is back. If I then do a flow or node only deploy everything is actually working again without a restart. But if I do a full deploy the information gets lost again and the Control-In nodes are not working.

Maybe some weird timing behaviour during initialization of the nodes? Some very few times it was actually working also with a full deploy and contrary to what I wrote yesterday I also had this issue now once with RedMatic in debug log mode. (However there was no further information in those logs).

With the workaround of doing a restart or just a flow deploy to have the system running it is not that urgent an issue.

codmpm commented 4 years ago

Hey @yenzor,

could you spare some time for a short teamviewer session to tackle this behavior? Just get in touch with me either via the LoxForum of the node-red Slack channel.

Cheers

mapchen commented 4 years ago

Hi, how can I help with debugging?

codmpm commented 4 years ago

What you posted in #45 helped a lot. The propblem lies on a little change that I made in 0.10.5 about when the connection is set connected. Thus active is not properly initialised.

As a workaround do not use full-deploy but only deploy changed flows.

codmpm commented 4 years ago

Please check with 0.10.6, should be fixed.