Hi all,
I’m starting with using the RestAPI. Getting and changing item state works fine already. Unfortunately I’m struggling with getting informed when an item state changes, hence events.
What I want to do:
I have a working switch (itemname: KG_Buero_Licht_Schalten) and I want to get informed via RestAPI when switch status changes. e.g. When switch is turned on by MainUI the RestAPI client should get the “ON” information.
What I did so far:
In RestAPI documentation I learned that this kind of functinality can be done by subscribing to events. From Event Bus dokumentation I got the information that the topic for my case is “openhab/items/{itemName}/statechanged” so I created the topic for my switch:
openhab/items/KG_Buero_Licht_Schalten/statechanged
Where is my problem
I want to try this RestAPI point, so I switch to the API Explorer. In Category events-> GET /events I added the topic from above in the corresponding input field and press Execute button. Now I see the Loading circle and nothing else happens (also when I use the switch from another browser). The loading never disappears/stops.
Now I’m a bit confused about what I am doing wrong. Or if I’m thinking completely in wrong direction how this mechanism works.
Maybe someone can bring me back on track.
Thanks a lot
Philipp
- openHAB version: 4.1.1 release