Change Node outputting multiple times

I am new to all of this and seeing unexpected behavior from the output of a change node. It's a simple "move" but the output fires many times (around 20). Is this normal? Here's a screenshot of the debug output.

And the change node config

As you can see I've resorted to using a filter to not spam my device which was seemingly not happy about it. I just find the behavior odd. You can also see debug 12 only fires a single time from the same out from the HomeKit node.

Can you both the debug nodes and set them to output the 'complete msg object' to see what it actually produces ?

Also please show us the node-red startup log. It should start with the Welcome to node-red message. Copy/paste please, not a screenshot.

So I have since restarted node-red (running via Docker) and noticed when I went to collect this the message was only repeating twice. Then I tried again and it repeated 3x, then 4x, then 5x.... and it's doing it for both debug statements now, so it seems related to the node-red-contrib-homekit-bridged status node. Homebridge is involved so there's an additional layer of complexity as well.

It's odd that the debug12 statement was not firing multiple times yesterday, though.

Here's 4 what came from debug12 when the switch was toggled once from the Home app.

{"payload":{"On":true},"hap":{"session":{"sessionID":"e68c9691-6e8b-4f00-9c4c-49d0fb311ad9","username":"17835B04-2904-4928-B67D-8471EE7C95FE","remoteAddress":"::ffff:192.168.1.145","localAddress":"::ffff:192.168.1.2","httpPort":52514},"context":{},"allChars":{"Name":"NR-Kitchen Pendant","On":true},"reachable":true,"newValue":true},"name":"NR-Kitchen Pendant","_msgid":"71d60de9b5eec37a"}

{"payload":{"On":true},"hap":{"session":{"sessionID":"e68c9691-6e8b-4f00-9c4c-49d0fb311ad9","username":"17835B04-2904-4928-B67D-8471EE7C95FE","remoteAddress":"::ffff:192.168.1.145","localAddress":"::ffff:192.168.1.2","httpPort":52514},"context":{},"allChars":{"Name":"NR-Kitchen Pendant","On":true},"reachable":true,"newValue":true},"name":"NR-Kitchen Pendant","_msgid":"d74c3b4c48afe774"}

{"payload":{"On":true},"hap":{"session":{"sessionID":"e68c9691-6e8b-4f00-9c4c-49d0fb311ad9","username":"17835B04-2904-4928-B67D-8471EE7C95FE","remoteAddress":"::ffff:192.168.1.145","localAddress":"::ffff:192.168.1.2","httpPort":52514},"context":{},"allChars":{"Name":"NR-Kitchen Pendant","On":true},"reachable":true,"newValue":true},"name":"NR-Kitchen Pendant","_msgid":"e22e755701a6d906"}

{"payload":{"On":true},"hap":{"session":{"sessionID":"e68c9691-6e8b-4f00-9c4c-49d0fb311ad9","username":"17835B04-2904-4928-B67D-8471EE7C95FE","remoteAddress":"::ffff:192.168.1.145","localAddress":"::ffff:192.168.1.2","httpPort":52514},"context":{},"allChars":{"Name":"NR-Kitchen Pendant","On":true},"reachable":true,"newValue":true},"name":"NR-Kitchen Pendant","_msgid":"eb20fa91c99b420f"}

Same form debug11

{"payload":true,"hap":{"session":{"sessionID":"e68c9691-6e8b-4f00-9c4c-49d0fb311ad9","username":"17835B04-2904-4928-B67D-8471EE7C95FE","remoteAddress":"::ffff:192.168.1.145","localAddress":"::ffff:192.168.1.2","httpPort":52514},"context":{},"allChars":{"Name":"NR-Kitchen Pendant","On":true},"reachable":true,"newValue":true},"name":"NR-Kitchen Pendant","_msgid":"71d60de9b5eec37a"}

{"payload":true,"hap":{"session":{"sessionID":"e68c9691-6e8b-4f00-9c4c-49d0fb311ad9","username":"17835B04-2904-4928-B67D-8471EE7C95FE","remoteAddress":"::ffff:192.168.1.145","localAddress":"::ffff:192.168.1.2","httpPort":52514},"context":{},"allChars":{"Name":"NR-Kitchen Pendant","On":true},"reachable":true,"newValue":true},"name":"NR-Kitchen Pendant","_msgid":"d74c3b4c48afe774"}

{"payload":true,"hap":{"session":{"sessionID":"e68c9691-6e8b-4f00-9c4c-49d0fb311ad9","username":"17835B04-2904-4928-B67D-8471EE7C95FE","remoteAddress":"::ffff:192.168.1.145","localAddress":"::ffff:192.168.1.2","httpPort":52514},"context":{},"allChars":{"Name":"NR-Kitchen Pendant","On":true},"reachable":true,"newValue":true},"name":"NR-Kitchen Pendant","_msgid":"e22e755701a6d906"}

{"payload":true,"hap":{"session":{"sessionID":"e68c9691-6e8b-4f00-9c4c-49d0fb311ad9","username":"17835B04-2904-4928-B67D-8471EE7C95FE","remoteAddress":"::ffff:192.168.1.145","localAddress":"::ffff:192.168.1.2","httpPort":52514},"context":{},"allChars":{"Name":"NR-Kitchen Pendant","On":true},"reachable":true,"newValue":true},"name":"NR-Kitchen Pendant","_msgid":"eb20fa91c99b420f"}

The only value that changes is the _msgid

nodered  | 29 Jul 08:53:03 - [info]
nodered  |
nodered  | Welcome to Node-RED
nodered  | ===================
nodered  |
nodered  | 29 Jul 08:53:03 - [info] Node-RED version: v4.0.2
nodered  | 29 Jul 08:53:03 - [info] Node.js  version: v20.15.1
nodered  | 29 Jul 08:53:03 - [info] Linux 6.5.0-41-generic x64 LE
nodered  | 29 Jul 08:53:03 - [info] Loading palette nodes
nodered  | (node:7) NOTE: The AWS SDK for JavaScript (v2) will enter maintenance mode
nodered  | on September 8, 2024 and reach end-of-support on September 8, 2025.
nodered  |
nodered  | Please migrate your code to use AWS SDK for JavaScript (v3).
nodered  | For more information, check blog post at https://a.co/cUPnyil
nodered  | (Use `node --trace-warnings ...` to show where the warning was created)
nodered  | 29 Jul 08:53:04 - [info] Settings file  : /data/settings.js
nodered  | 29 Jul 08:53:04 - [info] Context store  : 'default' [module=memory]
nodered  | 29 Jul 08:53:04 - [info] User directory : /data
nodered  | 29 Jul 08:53:04 - [warn] Projects disabled : editorTheme.projects.enabled=false
nodered  | 29 Jul 08:53:04 - [info] Flows file     : /data/flows.json
nodered  | 29 Jul 08:53:04 - [info] Server now running at http://127.0.0.1:1880/
nodered  | 29 Jul 08:53:04 - [warn]
nodered  |
nodered  | ---------------------------------------------------------------------
nodered  | Your flow credentials file is encrypted using a system-generated key.
nodered  |
nodered  | If the system-generated key is lost for any reason, your credentials
nodered  | file will not be recoverable, you will have to delete it and re-enter
nodered  | your credentials.
nodered  |
nodered  | You should set your own key using the 'credentialSecret' option in
nodered  | your settings file. Node-RED will then re-encrypt your credentials
nodered  | file using your chosen key the next time you deploy a change.
nodered  | ---------------------------------------------------------------------
nodered  |
nodered  | 29 Jul 08:53:04 - [info] Starting flows
nodered  | [Demo 1@@Hardware Revision] characteristic value expected string and received undefined
nodered  | [Demo 1@@Software Revision] characteristic value expected string and received undefined
nodered  | 29 Jul 08:53:04 - [info] [ui-base:My Dashboard] Node-RED Dashboard 2.0 (v1.14.0) started at /dashboard
nodered  | 29 Jul 08:53:04 - [info] [ui-base:My Dashboard] Created socket.io server bound to Node-RED port at path /dashboard/socket.io
nodered  | [CO detector@@Serial Number] [Serial Number] characteristic must have a length of more than 1 character otherwise         HomeKit will reject this accessory, ignoring new value
nodered  | [CO detector@@Model] [Model] characteristic must have a length of more than 1 character otherwise         HomeKit will reject this accessory, ignoring new value
nodered  | [Demo 1@CO detector@CO detector@Carbon Dioxide Level] Characteristic not in required or optional characteristic section for service CarbonMonoxideSensor. Adding anyway.
nodered  | [Demo 1@CO detector@CO detector@Carbon Dioxide Peak Level] Characteristic not in required or optional characteristic section for service CarbonMonoxideSensor. Adding anyway.
nodered  | 29 Jul 08:53:04 - [info] Started flows
nodered  | 29 Jul 08:53:04 - [info] [avr-yamaha:Living Room AVR] Failed to get device description with error: Error: connect ECONNREFUSED 192.168.1.15:8080
nodered  | 29 Jul 08:53:05 - [error] [hb-status:Pool] Homebridge not initialized

(from out of nowhere)

Hi.

Ok, you are new here and this is annoying to you.

Small suggestion:

Delete the connection from the NR kitchen pendant node.
Put in an inject node.

Open it and edit the value.

Screenshot from 2024-07-30 12-53-53
Ok, sorry, I goofed with the name.

msg.payload.On

Connect that and DEPLOY and see what happens.

Then change it from true to false and repeat.

Excellent troubleshooting/debugging advice. Not sure why it didn't hit me.

Anyway, yes this confirms the Change node is not doing anything unexpected. The HomeKit node is indeed publishing more than it should...

I guess I can move the filter up for the time being... in any case this makes me feel better

1 Like

I suspect the output(node4) is some how feeding each back to the input(node1), causing a infinite loop. This need sorting as this may eventually crash node-red or hog resources.

Glad I could help.

Yeah, look deeper at the node's output (that is disconnected) and see what is happening.

It could be something to do with the topic.

Screenshot from 2024-07-31 14-48-36

Try it with the option shown (default) not selected.

and set it to look at msg.payload.On too.

Ok I've figured out what is going on and in my opinion it's a bug with partial deployment. The "Modified Flow" deployment does not properly deploy wire removals.

If you have a wire setup, deploy, then remove the wire, re-deploy using the Modified Flow option, that wire will remain active. I guess I'll avoid partial deployments for sanity sake.

Here's a demonstration:

Filed bug: Wire removal not deployed on partial deployment · Issue #4842 · node-red/node-red · GitHub

1 Like

Good find!

I am even more lazy and only do changed nodes.

Not sure if you can, but maybe mark that as the solution.
Then if anyone else has a similar problem it could help them too.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.