# Controller for a remote Call

**URL:** <https://community.openems.io/t/controller-for-a-remote-call/2421>\
**Category:** Software-Development\
**Created:** [February 21, 2024, 3:42pm UTC](https://community.openems.io/t/controller-for-a-remote-call/2421 "2024-02-21T15:42:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dsen](https://community.openems.io/letter_avatar_proxy/v4/letter/d/6de8d8/32.png) [@dsen](https://community.openems.io/u/dsen)\
**Post date:** [February 21, 2024, 3:42pm UTC](https://community.openems.io/t/controller-for-a-remote-call/2421/1 "2024-02-21T15:42:25Z")

</div>

Hi,

I would like to trigger a remote service from OpenEMS, maybe by sending a request to the remote server at a predefined time or at regular intervals. Could I subclass a Controller for this purpose?  
If the controller is the right interface for the task, should the logic to execute the controller on time be within the controller or do I have to use a separate scheduler (eg the Daily scheduler)?

Thank you

---

<div class="post-metadata">

**Author:** ![stefan.feilmeier](https://community.openems.io/user_avatar/community.openems.io/stefan.feilmeier/32/2585_2.png) [@stefan.feilmeier](https://community.openems.io/u/stefan.feilmeier)\
**Post date:** [February 23, 2024, 11:19pm UTC](https://community.openems.io/t/controller-for-a-remote-call/2421/2 "2024-02-23T23:19:35Z")

</div>

Hi dsen,

we recently implemented a “HTTP Bridge” that unifies communication over HTTP (just as the Modbus brige standardizes Modbus communiation in OpenEMS).

> <https://github.com/OpenEMS/openems/tree/develop/io.openems.edge.bridge.http>
>
> //github.com/OpenEMS/openems/tree/develop/io.openems.edge.bridge.http

We are just now starting to migrate all Components slowly. See the updated Shelly implementation for an example → [openems/io.openems.edge.io.shelly/src/io/openems/edge/io/shelly/shellyplug/IoShellyPlugImpl.java at develop · OpenEMS/openems · GitHub](https://github.com/OpenEMS/openems/blob/develop/io.openems.edge.io.shelly/src/io/openems/edge/io/shelly/shellyplug/IoShellyPlugImpl.java#L84)

Also the Tibber implementation is a good example - though not yet migrated to HTTP bridge - for querying a web-service regularly (e.g. every hour) → [openems/io.openems.edge.timeofusetariff.tibber/src/io/openems/edge/timeofusetariff/tibber/TimeOfUseTariffTibberImpl.java at develop · OpenEMS/openems · GitHub](https://github.com/OpenEMS/openems/blob/develop/io.openems.edge.timeofusetariff.tibber/src/io/openems/edge/timeofusetariff/tibber/TimeOfUseTariffTibberImpl.java#L142)

HTTP requests always must be in a separate thread, so that they cannot interrupt/pause the core cycle. HTTP bridge takes care of this.

Implementation of a `Controller` is only required if you really plan to **control** something (and want to make use of the ProcessImage), e.g. activate a digital output etc. Your case doesn’t sound like that.

Regards,  
Stefan

---

<div class="post-metadata">

**Author:** ![dsen](https://community.openems.io/letter_avatar_proxy/v4/letter/d/6de8d8/32.png) [@dsen](https://community.openems.io/u/dsen)\
**Post date:** [February 26, 2024, 9:36am UTC](https://community.openems.io/t/controller-for-a-remote-call/2421/3 "2024-02-26T09:36:39Z")

</div>

Hallo @stefan.feilmeier,  
The HTTP Bridge sounds perfect for my use case. 🙂

I’m using a slightly older version of the OpenEMS code (no upgrade possible due to stability reasons). Is the process for adding the HTTP Bridge library to my setup similar to [Implement New Device](https://openems.github.io/openems.io/openems/latest/edge/implement.html)?

Thank you
