Skip to main content



      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 01:31 Go to next message
Eclipse UserFriend
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 10:12 Go to previous message
Eclipse UserFriend
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 Mar 20 15:33:13 EDT 2025

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

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

Back to the top