# \[V4\] Reflection on remote control integration

**URL:** <https://community.gladysassistant.com/t/v4-reflexion-integration-telecommande/5002>\
**Category:** Développement\
**Created:** [October 23, 2019, 7:37pm UTC](https://community.gladysassistant.com/t/v4-reflexion-integration-telecommande/5002 "2019-10-23T19:37:42Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlexTrovato](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/alextrovato/32/10705_2.png) [@AlexTrovato](https://community.gladysassistant.com/u/AlexTrovato)\
**Post date:** [October 23, 2019, 7:37pm UTC](https://community.gladysassistant.com/t/v4-reflexion-integration-telecommande/5002/1 "2019-10-23T19:37:43Z")

</div>

Hello everyone,  
I am currently setting up the integration of Broadlink and its infrared gateway.  
I thought about allowing the construction of a remote control.

Here’s what it looks like today:

![broadlink_demo](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/e/e4e470f406d6319d7fcb767158de28db9512ad97.gif)

Now, I’m stuck with the device integration.  
This is indeed a remote control, but it controls a device (a TV, a light bulb…).  
What type should this new device to be integrated in Gladys be?

Moreover, being a remote control, only buttons should be available, no switch button (ON/OFF) as this technology does not allow to know the state of the real device.

Additionally, it would be interesting to be able to tell Gladys «&nbsp;Turn off the TV&nbsp;», and have the signal sent with this remote control.

In short, my problem is at the design, development level.  
A device does not have a type, a category. Its features do. But the feature cannot be of two different categories (remote control and TV), and I can’t see myself adding the «&nbsp;button&nbsp;» (or click) type in all types of feature…

I therefore call on the community to think about this new need.

Thank you all.

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [October 24, 2019, 6:56am UTC](https://community.gladysassistant.com/t/v4-reflexion-integration-telecommande/5002/2 "2019-10-24T06:56:58Z")

</div>

Hello @AlexTrovato!

Another great integration here 😛 it looks great with the gif you added!

Here’s what I would do (at first glance, but it’s debatable):

- We create a `television` category
- In this category, we create a set of quite specific types related to what a TV can do: `channel`, `volume`, etc… We can also create features related to specific buttons, such as `next-channel-button`, `volume-up-button`, etc…

All this must be defined/managed at the Gladys core level, and then in your `device.setValue` function for your TV, you will have a big switch with all possible commands.

The advantage of this solution is that in the Device we will have all the information about the «&nbsp;capabilities&nbsp;» of the TV. For example, if your TV does not support the «&nbsp;next-channel-button&nbsp;», then you just don’t create the feature, and the UI can deduce that the button is not available.

This is a first draft off the top of my head, what do you think? (I’m still thinking about it too)

---

<div class="post-metadata">

**Author:** ![AlexTrovato](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/alextrovato/32/10705_2.png) [@AlexTrovato](https://community.gladysassistant.com/u/AlexTrovato)\
**Post date:** [October 24, 2019, 7:58am UTC](https://community.gladysassistant.com/t/v4-reflexion-integration-telecommande/5002/3 "2019-10-24T07:58:56Z")

</div>

Hi,  
This is a good first approach, but the issue will arise at the level of the display on the dashboard. I was thinking of displaying the buttons in the form of a remote control (button matrix). To do this, I tried to draw inspiration from what was done for the cameras, and I don’t see how to indicate that it is a remote control type.

For the feature, the category will be TV, the type push-button, but I’m missing the «&nbsp;remote&nbsp;» information.

I was thinking about `device.model` but that will cause all the boxes already in place to be re-examined.

This is mainly where I’m stuck. We control a TV well, but the device remains a remote control.

I’m not sure that adding a new field to the model is a good idea (even if it is the simplest solution).

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [October 24, 2019, 8:45am UTC](https://community.gladysassistant.com/t/v4-reflexion-integration-telecommande/5002/4 "2019-10-24T08:45:02Z")

</div>

> [@AlexTrovato](#):
>
> This is a good first approach, but the issue will arise at the dashboard rendering level. I was thinking of displaying the buttons in the form of a remote control (button matrix). To do this, I tried to draw inspiration from what was done for the cameras, and I don’t see how to indicate that it’s a remote control type.

I don’t see the issue!

Just like it’s done for the cameras, the «&nbsp;television&nbsp;» category already indicates that this kind of UI is needed to control it. We have no interest in displaying the TV room UI here:

 ![27](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/c/c94a3c6fa9ff59b2210e4cd60f46822762d9f3eb.png)

---

<div class="post-metadata">

**Author:** ![AlexTrovato](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/alextrovato/32/10705_2.png) [@AlexTrovato](https://community.gladysassistant.com/u/AlexTrovato)\
**Post date:** [October 24, 2019, 10:13am UTC](https://community.gladysassistant.com/t/v4-reflexion-integration-telecommande/5002/5 "2019-10-24T10:13:17Z")

</div>

OK for the TV, no problem, but I also have an IR remote-controlled LED strip. The lights are already managed by the core…

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [October 24, 2019, 10:28am UTC](https://community.gladysassistant.com/t/v4-reflexion-integration-telecommande/5002/6 "2019-10-24T10:28:22Z")

</div>

> [@AlexTrovato](#):
>
> but I also have an IR remote-controlled LED strip. The lights are already managed by the core…

And? That’s perfect, it will be well managed by the core too

---

<div class="post-metadata">

**Author:** ![AlexTrovato](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/alextrovato/32/10705_2.png) [@AlexTrovato](https://community.gladysassistant.com/u/AlexTrovato)\
**Post date:** [October 24, 2019, 10:37am UTC](https://community.gladysassistant.com/t/v4-reflexion-integration-telecommande/5002/7 "2019-10-24T10:37:56Z")

</div>

Ok, so I’ll keep going 😉

---

<div class="post-metadata">

**Author:** ![Jean34](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/jean34/32/3349_2.png) [@Jean34](https://community.gladysassistant.com/u/Jean34)\
**Post date:** [October 24, 2019, 12:45pm UTC](https://community.gladysassistant.com/t/v4-reflexion-integration-telecommande/5002/8 "2019-10-24T12:45:32Z")

</div>

Hi, cool this integration. I have a rm pro 3 that also does RF if it can help you for tests, I have gladys 4 installed on a pi 🙂

---

<div class="post-metadata">

**Author:** ![AlexTrovato](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/alextrovato/32/10705_2.png) [@AlexTrovato](https://community.gladysassistant.com/u/AlexTrovato)\
**Post date:** [October 24, 2019, 4:45pm UTC](https://community.gladysassistant.com/t/v4-reflexion-integration-telecommande/5002/9 "2019-10-24T16:45:42Z")

</div>

Thanks @Jean34,  
I’m also on the RM Pro 3 team, I’ll definitely ask you to validate the handover 😉

---

<div class="post-metadata">

**Author:** ![spenceur](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/spenceur/32/1961_2.png) [@spenceur](https://community.gladysassistant.com/u/spenceur)\
**Post date:** [October 24, 2019, 6:09pm UTC](https://community.gladysassistant.com/t/v4-reflexion-integration-telecommande/5002/10 "2019-10-24T18:09:34Z")

</div>

This brings back memories with the v3 (remote control API, @Jean34 testing for RM Pro 3 with @piznel) :p.  
Good luck @AlexTrovato :).  
If I may, I don’t find the remote control «&nbsp;pretty&nbsp;».  
I’m not really into this Lego-type HMI ^^.  
Let’s see how it turns out in the end 🙂

---

<div class="post-metadata">

**Author:** ![AlexTrovato](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/alextrovato/32/10705_2.png) [@AlexTrovato](https://community.gladysassistant.com/u/AlexTrovato)\
**Post date:** [October 24, 2019, 7:19pm UTC](https://community.gladysassistant.com/t/v4-reflexion-integration-telecommande/5002/11 "2019-10-24T19:19:36Z")

</div>

Thanks, I admit that I draw a lot of inspiration from the V3 module 😉  
For the Lego HMI, we can always adjust it at the end.  
I will post an image to get your opinions.

---

<div class="post-metadata">

**Author:** ![AlexTrovato](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/alextrovato/32/10705_2.png) [@AlexTrovato](https://community.gladysassistant.com/u/AlexTrovato)\
**Post date:** [November 4, 2019, 6:32pm UTC](https://community.gladysassistant.com/t/v4-reflexion-integration-telecommande/5002/12 "2019-11-04T18:32:43Z")

</div>

Finally no Lego HMI, too complex and not pretty at all.

Here is a nice remote control with lots of buttons.

 ![remote-tv](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/7/7ae0a28a7326fe856bdeb0d4a27a29a59f53196f.png)

---

<div class="post-metadata">

**Author:** ![Tlse-vins](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/tlse-vins/32/6054_2.png) [@Tlse-vins](https://community.gladysassistant.com/u/Tlse-vins)\
**Post date:** [November 4, 2019, 7:14pm UTC](https://community.gladysassistant.com/t/v4-reflexion-integration-telecommande/5002/13 "2019-11-04T19:14:16Z")

</div>

Good evening @AlexTrovato, you said that the service will be done via infrared to control a TV.  
But now most of the time we don’t control the TV but the box. And they are in Bluetooth.

Hence my question, will we be able to use it in Bluetooth?

---

<div class="post-metadata">

**Author:** ![AlexTrovato](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/alextrovato/32/10705_2.png) [@AlexTrovato](https://community.gladysassistant.com/u/AlexTrovato)\
**Post date:** [November 4, 2019, 9:01pm UTC](https://community.gladysassistant.com/t/v4-reflexion-integration-telecommande/5002/14 "2019-11-04T21:01:18Z")

</div>

Hello @Tlse-vins,  
the remote control part is just a visual facade, linked to `features`.  
If your Bluetooth remote control defines these `features`, it will be possible.

A new integration service (for example `BBox` or `Livebox`) will then be needed to integrate this remote control.

However, I think that most boxes can be controlled directly via the network and allow you to have a status.  
The remote control system I propose does not know the status of the device.

For Bluetooth, I have already started an integration service, but the BLE library used is a bit outdated, new ones are planned, so it remains on standby for the moment.

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [November 5, 2019, 7:37am UTC](https://community.gladysassistant.com/t/v4-reflexion-integration-telecommande/5002/15 "2019-11-05T07:37:10Z")

</div>

> [@AlexTrovato](#):
>
> Here is a nice remote control with lots of buttons.

It’s pretty! 🙂 Great job!

---

<div class="post-metadata">

**Author:** ![spenceur](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/spenceur/32/1961_2.png) [@spenceur](https://community.gladysassistant.com/u/spenceur)\
**Post date:** [November 5, 2019, 7:51am UTC](https://community.gladysassistant.com/t/v4-reflexion-integration-telecommande/5002/16 "2019-11-05T07:51:26Z")

</div>

I really like it but how does it work on responsive? 🙂

---

<div class="post-metadata">

**Author:** ![AlexTrovato](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/alextrovato/32/10705_2.png) [@AlexTrovato](https://community.gladysassistant.com/u/AlexTrovato)\
**Post date:** [November 5, 2019, 10:07am UTC](https://community.gladysassistant.com/t/v4-reflexion-integration-telecommande/5002/17 "2019-11-05T10:07:16Z")

</div>

Good question.  
For now, I’ve just planned a single display on all compatible screens, all in length… but this will require scrolling as it is so long.  
I will draw inspiration from existing applications so that this one fits on a pocket screen.

---

<div class="post-metadata">

**Author:** ![AlexTrovato](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/alextrovato/32/10705_2.png) [@AlexTrovato](https://community.gladysassistant.com/u/AlexTrovato)\
**Post date:** [November 19, 2019, 10:39pm UTC](https://community.gladysassistant.com/t/v4-reflexion-integration-telecommande/5002/18 "2019-11-19T22:39:37Z")

</div>

Hello everyone,  
if someone is motivated to test the Broadlink service, 2 remote controls are available, TV and light bulb.  
A box is also available on the dashboard.

[https://github.com/atrovato/Gladys/tree/broadlink](https://github.com/atrovato/Gladys/tree/broadlink)

Thanks in advance, looking forward to your feedback 🙂

PS: for my needs, 2 more remote controls will be created, air conditioner and vacuum cleaner, but they will not be specific to the Broadlink service.

---

<div class="post-metadata">

**Author:** ![AlexTrovato](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/alextrovato/32/10705_2.png) [@AlexTrovato](https://community.gladysassistant.com/u/AlexTrovato)\
**Post date:** [November 23, 2019, 9:08pm UTC](https://community.gladysassistant.com/t/v4-reflexion-integration-telecommande/5002/19 "2019-11-23T21:08:31Z")

</div>

I am resending my request. I see that the brave ones are busy at the moment, but Broadlink device owners (IR emitters, plugs, multi-plugs, etc.) are eagerly awaited as testers.

Thank you.

---

<div class="post-metadata">

**Author:** ![Jean34](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/jean34/32/3349_2.png) [@Jean34](https://community.gladysassistant.com/u/Jean34)\
**Post date:** [November 25, 2019, 12:05pm UTC](https://community.gladysassistant.com/t/v4-reflexion-integration-telecommande/5002/21 "2019-11-25T12:05:39Z")

</div>

Hi, I recently moved, family has grown so very little time at the moment but I will do my best to check on my side 😉

[Next page](https://community.gladysassistant.com/t/v4-reflexion-integration-telecommande/5002.md?page=2)
