Somfy-Developer / Somfy-TaHoma-Developer-Mode

A collection of requests to use a local API with Somfy TaHoma gateways
147 stars 12 forks source link

Events #91

Closed arikadiusz closed 1 year ago

arikadiusz commented 1 year ago

When I register for an event all I get is listnerId. How'Where are these events sent? Shouldn't there be a variable for a hook address available here in parameters or content body or am I misunderstanding how events work on this API?

qelanhari commented 1 year ago

https://somfy-developer.github.io/Somfy-TaHoma-Developer-Mode/#/Event/post_events__listenerId__fetch

arikadiusz commented 1 year ago

Thanks. I am getting responses with empty json table for fetch. Should I see something more here? I don't have any IO or Zigbee devices available for testing only RTS awning.

qelanhari commented 1 year ago

If it's empty, there is no events/no update in states. RTS devices don't reports their states when operated with physical (or remote) buttons. You'll only have events if you operate your awning using the API.

arikadiusz commented 1 year ago

ok thank you. And if I had IO device avilable. Where do these events are sent to, IP/Port?

adriweb commented 1 year ago

To yourself (the api client) when you request them-- Thank you, Adrien Bertrand

qelanhari commented 1 year ago

ok thank you. And if I had IO device avilable. Where do these events are sent to, IP/Port?

Some IO devices don't report either, it will depend on the device.

arikadiusz commented 1 year ago

ok, so events are sent back to the client - got it. What about the port number, is this at all flexible or is it just using 8443 like the main api?

qelanhari commented 1 year ago

I don't understand why you are talking about IP/Port.

When RTS/IO devices are controlled by the Tahoma, the API will store informations as events. When you register a listener and fetch events using the API, you'll get a list of events that happened between now and the previous time you fetched events.

arikadiusz commented 1 year ago

hold on. So I still have to fetch (pull) states periodically? that's not much of an event driven design then is it.... I was expecting something you see everywhere else, a simple hook. Where you specify IP/Port to where box sends these events and you don't have to send feedback requests every few seconds.

qelanhari commented 1 year ago

Yes you have to fetch events periodically. The idea is to fetch events at a relatively low rate when you're not expecting to follow an action (like 1 fetch every 30sec for example), and more intensively when you know something is happening, to get almost real time updates (like 1 fetch every seconds).

qelanhari commented 1 year ago

Push/Webhook have been requested here https://github.com/Somfy-Developer/Somfy-TaHoma-Developer-Mode/issues/2

llavorel-somfy commented 1 year ago

Push/Webhook have been requested here #2