Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse SmartHome » Unable to receive Events(itemCommandEvent,ItemStateEvent) from ESH
Unable to receive Events(itemCommandEvent,ItemStateEvent) from ESH [message #1792988] Fri, 27 July 2018 05:31 Go to next message
Paramesh  Surakod is currently offline Paramesh SurakodFriend
Messages: 15
Registered: January 2018
Junior Member
Hi sir,

I am trying to receive the events using the ESH Event Bus through the following method. I Followed the instructions from the Event Section of ESH Documentation.

public class CloudService implements ActionService, CloudClientListener, EventSubscriber {
...........


@Override
public void receive(Event event) {
String topic = event.getTopic();
String type = event.getType();
String payload = event.getPayload();
if (event instanceof ItemCommandEvent) {
ItemCommandEvent itemCommandEvent = (ItemCommandEvent) event;
String itemName = itemCommandEvent.getItemName();
Command command = itemCommandEvent.getItemCommand();
// ...
} else if (event instanceof ItemStateEvent) {
ItemStateEvent itemStateEvent = (ItemStateEvent) event;
// ...
}
else if (event instanceof ItemStateChangedEvent) {
ItemStateChangedEvent ItemStateChangedEvent = (ItemStateChangedEvent) event;
// ...
}
}
}


The above code works only for "ItemStateEvent".

I would like to get all event types.

Please help me to resolve this issue.

Thanks
Re: Unable to receive Events(itemCommandEvent,ItemStateEvent) from ESH [message #1793074 is a reply to message #1792988] Mon, 30 July 2018 14:12 Go to previous message
Stefan Triller is currently offline Stefan TrillerFriend
Messages: 29
Registered: April 2017
Junior Member
Hello Paramesh,

since you only posted half of your class (also without code tags, please add them next time to make it more readable), what do you return in your getEventFilter() method? You should return null in order to receive all events.

Regards,

Stefan
Previous Topic:Bridge Handler adding discovered ChildThing.
Next Topic:Auto created Items are not editable
Goto Forum:
  


Current Time: Thu Apr 25 11:56:04 GMT 2024

Powered by FUDForum. Page generated in 0.02987 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top