pdmangel / node-red-contrib-openhab2

Other
21 stars 15 forks source link

openhab2 IN #37

Open overdrive69 opened 5 years ago

overdrive69 commented 5 years ago

It would be usefull that the IN node also sends the msg on statusupdate. At the moment the IN node sends the message only when the NODE changes from ON to OFF or OFF to ON.

some one already has this done. But there a few other features missing.

https://github.com/jeroenhendricksen/node-red-contrib-openhab2

Configuration:

Name : Optionally specify a name Controller : Select the openHAB controller Item : Select the Item to monitor Send initial state at node startup (will set msg.event to "InitialStateEvent") Only when Changed : Only send a message when the state changes (eventtype == "ItemStateChangedEvent") when set to true, otherwise only sends state updates (eventtype == "ItemStateEvent") (Optional, when 'Only when Changed' is checked) Changed from: the old (previous) state. Ignored when left empty. (Optional, when 'Only when Changed' is checked) Changed to: the new state where it changed to. Ignored when left empty. Messages injected in NodeRED flows (1 channel):

Channel 1:

msg.item : the item's itemname (not label) msg.topic : "StateEvent" msg.event : "InitialStateEvent" | "ItemStateEvent" | "ItemStateChangedEvent" msg.payload : the new state of the selected item msg.oldValue : the previous value (state) of the item (when 'Only when Changed' is checked), otherwise null