pdmangel / node-red-contrib-openhab2

Other
21 stars 15 forks source link

openhab2-in does not handle state changes #57

Open ckarras opened 3 years ago

ckarras commented 3 years ago

I created a simple Node-RED flow that uses openhab2-in to watch updates to an item and uses the "debug" node to log the updated value. When I first deploy the flow, I see the value is read and logged as expected. However, when I do any updates to the value, the flow never sees the update unless I deploy the flow again to force it to re-execute.

image

I have confirmed that the update is a real update (the value actually changed, it's not simply the same value that has been rewritten again). Also, if I use openhab rules to watch for the same updates, I confirmed that the rules can successfully be notified immediately of updates to the same item.

I have also confirmed that the flow is still running after the initial update, by also adding to the same flow a simple http listener that sends back the request to the caller. I can then call, for example /testnodered?test=1234, and get back a response multiple times, which confirms the flow is still running (the same flow that contains the openhab2-in node) image

Am I missing something to make the flow run continuously and receive updates, in opposition to just getting the initial values? Or is something wrong that prevents receiving updates? If something is wrong, what should I do to investigate? (Are there logs I can enable, etc). Also, are there complete sample Node-RED flows using the openhab2 nodes I could review to compare them with what I did?

I'm using the following versions:

Thanks

posseydon6891 commented 3 years ago

just had same issue with node-red-contrib-openhab2 v. 1.1.8 and openHAB 2.5 - no state updates

after upgrading to openHAB 3 it works fine

lavirott commented 3 years ago

I had the same issue after upgrading to openhab3 and installing the new node-red-contrib-openhab2 v. 1.1.8. In fact, after upgrading to node-red-contrib-openhab2 v. 1.1.8, it seems, I did not restarted node-red. The issue did not persits after restarting node-red.

poki123 commented 3 years ago

I have the same issue after upgrading node-red-contrib-openhab2 1.1.8 - update state for OpenHAB 2 (2.5.11-1) is not working anymore :-(.

lavirott commented 3 years ago

Yes, I confirm that upgrading to node-red-contrib-openhab2 1.1.8 can not work with openhab2. The REST API was modified from openhab2 to openhab3, modifing /rest/smarthome/... to /rest/openhab/... So installing version 1.1.8 will not work with openhab2 anymore. Why not rolling back node-red-contrib-openhab2 to 1.1.7 and creating a node-red-contrib-openhab3 corresponding to v1.1.8. My 2 cts.

guny74 commented 3 years ago

I also have the same issue. Upgrading to 1.1.8 my openhab nodes does not work anymore. For a smooth migration, I also have an Openhab3 Instance...but with this the nodes also do not work.

I Always get debugmessage ""ERROR {"type":"error","status":404}" from config Node (Openhab 2)

shutterfreak commented 3 years ago

Thanks to this thread I managed to find the culprit, as I'm still running openHAB2 and things were broken with the upgrade to 1.1.8.

Probably version 1.1.8 should have been labelled 2.x (or even 3.x to comply with openHAB versioning).

celevra commented 3 years ago

is there a way to downgrade?

celevra commented 3 years ago
cd .node-red/node_modules
rm node-red-contrib-openhab2/ -R
wget https://codeload.github.com/pdmangel/node-red-contrib-openhab2/zip/ebbe638fc03705c6bc7668b035e3d222be8c4e49 -O tmp.zip
unzip tmp.zip
mv node-red-contrib-openhab2* node-red-contrib-openhab2/
rm tmp.zip

service nodered restart
jwillhoeft commented 2 years ago

Had the same problem. Thanks for the analysis and downgrade instructions!

I also agree that such a breaking change should definitely put into a separate add-on. In my case an upgrade to Openhab3 seems to require a complete new setup / configuration.