Thanks @Spaceman_Spiff again for your great work. HABApp 1.1.0 is running on my production system without any issues (so far still on OH 3.4).
I really like I could also get rid of some of my threaded rules!
It seems like nobody payed attention to the change log because I obviously did not rename ItemStateEvent to ItemStateUpdatedEvent. It still gets emitted as expected on OH3 instances.
So HABApp 1.1.2 is out, which fixes the information in the change log and as a small bonus improves the DateTime value parsing.
I saw that in 1.1.2 the event continues to be ItemStateEvent. However in OH4, I see this note:
Rules are now triggered by ItemStateUpdatedEvent instead of ItemStateEvent. If you use JSR223 scripting without helper libraries and expect a certain Java type, code changes might be needed.
After 15’, it looks like my system continues to function. So I am a bit at loss on the impact of the above statement from the release note. I think perhaps it is JSR223 specific.
With OH4 the ItemStateEvent is automatically discharged and the ItemStateUpdatedEvent is used. If you use the ValueUpdateEvent there are no changes needed and and subscribing will work as before, if you migrate from OH3 and use the ItemStateEvent you need to replace it with the ItemStateUpdatedEvent. If you use the event value you have to check your code, too (e.g. if event.value == 'ON') because the event now reports the item state instead e.g. the command.
Hi all,
I already use Habapp together with OH3.4. This installation is still running.
In parallel I setup a new Hardware ( New Pi) installed OH4 from scratch and
first time installed Habapp from openhabian.
Now I have problems that habapp is not able to connect to openhab.
In the config.yml I entred the username and pw for OH. But everytime get get Errors with 401 for access to rest api.
If I did thjis from my pc just with http://x.x.x.x:8080/restapi I saw the answer.
Also I tried all combinations from username and pw inside the config file.
Username/PW from openhab and Username/PW from RaspPi.
I also change the url setting from localhost to the real ip adr.
So what could be wrong?
Again, on OH3.4 it is still running. Only diffrence: in the old setup I have habapp and OH running on diffrent pi’s. Now it is on the same machine
OK, that was it. Thanks.
Could not remember to use this setting before But as you mentioned it, I simply forget it, because the old OH version was running for a long time.
So everything is working perfect .
So if I want the equivalent of a trigger when ‘received command’ rule, for a switch item, what is the appropriate way to actually get the command sent, not the value of the item state. I’m having problems where using item.value or event.value give me the old state because they haven’t had time to update yet. How do I get the commanded state if I don’t care about the value (yet). Is there a event.commanded_state or something like it?
I just read the source code on ItemCommandEvent() and it appears that it’s only methods (not the right word?) are name and value, and value doesn’t actually hold the commanded value from what you’re saying above.
In rules dsl and jython we could get the actual received command regardless of what the state was using ‘receivedCommand’ or something like it. I’m sure I’m missing something here…