node-red-contrib-state-machine icon indicating copy to clipboard operation
node-red-contrib-state-machine copied to clipboard

State machine makes use of a deprecated function

Open wauswaus opened this issue 4 years ago • 13 comments

I'm running Node RED 7.2.6 and since then i'm getting the following log message:

"[RED.events] Deprecated use of "nodes-started" event from "/opt/node_modules/node-red-contrib-state-machine/state-machine.js:98:20". Use "flows:started" instead."

wauswaus avatar Oct 25 '20 11:10 wauswaus

I am facing exactly the same issue on the same version of Node RED.

CMDR-Sloma avatar Oct 29 '20 12:10 CMDR-Sloma

@DeanCording I don't think changing it is a lot of work (one line of code). I have no idea how to do it and get it back into node-red so your help is highly appreciated

wauswaus avatar Nov 03 '20 15:11 wauswaus

Mate, can you please react on this issue? I can see in GitHub you are actively working on other issues so why are you ignoring this? Please help out the user of this nice peace of code you made for Node-Red.

wauswaus avatar Nov 21 '20 18:11 wauswaus

Yet another try...

wauswaus avatar Dec 13 '20 09:12 wauswaus

Hello, first of all, thank you very much for the work. It saved me from a lot of headache. I see the same message in my logs and I am worried that the flows will not work in the future.

"[RED.events] Deprecated use of "nodes-started" event from "/opt/node_modules/node-red-contrib-state-machine/state-machine.js:98:20". Use "flows:started" instead."

Thanks again, stay healthy and kind regards

tomyumtinker avatar Jan 15 '21 11:01 tomyumtinker

This repo appears to be abandoned. Some others have created their own repos with the deprecated usage removed. I have opted to create an entirely new node based off of this repo and one other. I have also added a few other new features. It is available in the Node-RED palette as node-red-contrib-persistent-fsm. Or see the repo at https://github.com/hufftheweevil/node-red-contrib-persistent-fsm. Many thanks to DeanCording for his open-source work.

hufftheweevil avatar Jan 18 '21 02:01 hufftheweevil

Thanks for the work! Any idea how to get the old one removed from Home Assistant's Node-RED add on and get yours @hufftheweevil 's added? I added this one as an npm-package in the config and it seems to work, but I'm getting a conflict error with the old FSM.

sgruby avatar Jan 18 '21 04:01 sgruby

npm un node-red-contrib-state-machine --save in your node-red directory should do it.

hufftheweevil avatar Jan 18 '21 04:01 hufftheweevil

Thanks! I added:

npm_packages: - node-red-contrib-persistent-fsm init_commands: - npm un node-red-contrib-state-machine --save

To my configuration for the Hass add-on and it appears to work fine.

sgruby avatar Jan 18 '21 04:01 sgruby

Thanks for the tip! I'm also going to try this.

wauswaus avatar Jan 18 '21 06:01 wauswaus

@hufftheweevil - First, nice job on the new module. I love the visualizer!

Your node module works just fine save for one thing (really noticable when used with Home Assistant)... the "Persist state on redeploy" option fires a message out during node.startup... which sends a message down the flow before the flow signals flow:started.

This will often bypass other nodes that haven't enabled themselves yet (queue or break nodes) or error out on nodes that are awaiting a service connection on redeployment (the Home Assistant call-service node). At any rate, it'd be better to fire it after flows:started (or at least onTimeout delay a bit) because the alternative is unpredictable.

joelmoses avatar Jan 26 '21 07:01 joelmoses

@hufftheweevil - sent you a pull request with a simple async delay fix. I've tested it and it works with switch-break, queue-nodes, and Home Assistant API call-state.

joelmoses avatar Jan 28 '21 20:01 joelmoses

Thanks! I can't take credit for the visualizer, though. That is from https://github.com/lutzer/node-red-contrib-finite-statemachine

Sorry I forgot to enable Issues on my repo. Enabled now.

And conversation continues at https://github.com/hufftheweevil/node-red-contrib-persistent-fsm/pull/1

hufftheweevil avatar Jan 28 '21 23:01 hufftheweevil