# \[V4\] Dev service RFlink

**URL:** <https://community.gladysassistant.com/t/v4-dev-service-rflink/5186>\
**Category:** Développement\
**Tags:** rflink\
**Created:** [January 26, 2020, 10:19am UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186 "2020-01-26T10:19:39Z")\
**Posts on this page:** 20\
**Page:** 6

<div class="post-metadata">

**Author:** ![jojolll](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/j/c68b51/32.png) [@jojolll](https://community.gladysassistant.com/u/jojolll)\
**Post date:** [May 4, 2020, 7:44am UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/104 "2020-05-04T07:44:36Z")

</div>

> [@joeypic](#):
>
> Perhaps I need to add an option directly in the service that regularly resets the value of the door opening detectors to 0, since the cheap ones send a message when a door is opened but not when you close it.

For information, on Gladys 3, the RFLink module did not have this type of processing (having this option may still be a good idea!), but in my use, it never caused any issues since the ON command on each reception still triggered the scenarios.  
In V4, on the other hand, I still don’t know how it works.

> [@joeypic](#):
>
> If it interests anyone, I am at the same time modeling a case for RPI + RFLINK that I will print in 3D.

Absolutely yes! 🙂

---

<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:** [May 4, 2020, 7:48am UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/105 "2020-05-04T07:48:00Z")

</div>

> [@joeypic](#):
>
> @pierre-gilles Do you have a date for the development of the color and brightness part of the bulbs?

I’m working on other topics right now (Listed in the milestone → [GitHub · Where software is built](https://github.com/GladysAssistant/Gladys/milestone/6)), I have no dates at all!

However, if you want to work on it, don’t hesitate 🙂 It’s not very complicated ^^ You can create a specific topic if you want to discuss it before implementation.

---

<div class="post-metadata">

**Author:** ![joeypic](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/j/5e9695/32.png) [@joeypic](https://community.gladysassistant.com/u/joeypic)\
**Post date:** [May 10, 2020, 7:51am UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/106 "2020-05-10T07:51:02Z")

</div>

@pierre-gilles, I have a problem in my service that I’m having trouble understanding.

When my service detects a new device, I send this to the front end:

```javascript
this.gladys.event.emit(EVENTS.WEBSOCKET.SEND_ALL, {
      type: WEBSOCKET_MESSAGE_TYPES.RFLINK.NEW_DEVICE,
    });

```

This allows the user to see their devices directly when they press the button on their remote without refreshing the page.

It works fine when I refresh Gladys directly on the page like this:

![Works](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/7/72c379205c91a5b9bf9c57c4a38da93964c71b87.gif)

However, sometimes I get messages in the console and the events are not received by the front end, as if the front end can no longer receive websockets until I refresh the page:

![Doesn't Work](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/e/e34db6d94f1ee487159371f39098d151c42fadcd.gif)

This happens quite frequently and forces a page refresh each time, whereas the goal is to never need to do this.

I don’t know if the testers of my service have had this problem, but I hope it’s just from my installation.

---

<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:** [May 11, 2020, 8:46am UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/107 "2020-05-11T08:46:38Z")

</div>

The access\_token used by Gladys has an expiration date, I think it’s 1 hour. Then, Gladys uses the refresh token to automatically get a new access\_token.

All of this is transparent normally and should not cause any issues.

However, there can always be bugs. Right now, it’s hard to debug without more information…

---

<div class="post-metadata">

**Author:** ![gaetanb76](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/gaetanb76/32/5911_2.png) [@gaetanb76](https://community.gladysassistant.com/u/gaetanb76)\
**Post date:** [July 15, 2020, 5:58pm UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/108 "2020-07-15T17:58:02Z")

</div>

Hello,  
I installed Gladys v4 a week ago.  
In Zwave, my Fibaro roller shutter contacts and Qubino heating contacts are detected, but not fully operational as they are only On/Off (no intermediate position or comfort/reduced setpoint).  
However, my RFXCOM and Oregon 433 Mhz temperature sensors are not detected.

I had created a Domoticz installation with a camera that sent captures to my Dropbox, then created a timelapse every day. It managed my heating hour by hour and my roller shutters.  
I am a bit frustrated not to be able to do the same with Gladys… I will have to wait for the developments.  
Thanks in advance for your answers.

How can I enter the test program?  
I have never used Dockers.

---

<div class="post-metadata">

**Author:** ![VonOx](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/vonox/32/10128_2.png) [@VonOx](https://community.gladysassistant.com/u/VonOx)\
**Post date:** [July 16, 2020, 8:57am UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/109 "2020-07-16T08:57:40Z")

</div>

Z-Wave is currently in development, it is about consolidating compatible equipment and features, so for now it is «&nbsp;in progress&nbsp;».

For Docker, everything is in the documentation =\> [A privacy-first, open-source home assistant | Gladys Assistant](https://documentation.gladysassistant.com/fr/installation#raspberry-pi)

---

<div class="post-metadata">

**Author:** ![ProtZ](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/protz/32/1641_2.png) [@ProtZ](https://community.gladysassistant.com/u/ProtZ)\
**Post date:** [July 19, 2020, 7:03pm UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/110 "2020-07-19T19:03:21Z")

</div>

Hello,  
I left from the branch of @joeypic to merge the latest changes on G4 [here](https://github.com/ngeissel/Gladys/tree/rflink), then fix the milight and the debug option in the configuration. The tests grandeurs natures on CHACON and MiLight work well.  
@joeypic: I made a PR for you, let me know what you need

@All: I tried to add some tests in the code, unfortunately I don’t have the required level. If someone wants to take care of it, I’m lost 🙂

---

<div class="post-metadata">

**Author:** ![joeypic](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/j/5e9695/32.png) [@joeypic](https://community.gladysassistant.com/u/joeypic)\
**Post date:** [July 21, 2020, 9:35am UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/111 "2020-07-21T09:35:19Z")

</div>

Hi,  
It’s true that I hadn’t pushed the code for the milight to the repo 🙄, thanks for your help 😁 I took your PR, the only task left to code is the tests, I tried to learn and it really bored me so I gave up (it’s silly I only had that left to do to release the service)

I’m going to try to continue the tests because I think it’s not easy to test someone else’s functions but if someone knows how to write tests it would be faster

---

<div class="post-metadata">

**Author:** ![ProtZ](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/protz/32/1641_2.png) [@ProtZ](https://community.gladysassistant.com/u/ProtZ)\
**Post date:** [July 21, 2020, 1:13pm UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/112 "2020-07-21T13:13:01Z")

</div>

I don’t know Mocha well enough, nor JavaScript for that matter… but I do like testing.  
What I hate is when the test returns an error while the light in the living room comes on 🙂

---

<div class="post-metadata">

**Author:** ![peb](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/peb/32/3480_2.png) [@peb](https://community.gladysassistant.com/u/peb)\
**Post date:** [February 23, 2021, 1:37pm UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/113 "2021-02-23T13:37:01Z")

</div>

Hello!

Still interested in this service, I wonder if the PR could be updated with the aim of integrating Gladys soon.

Thank you 🙂

---

<div class="post-metadata">

**Author:** ![ProtZ](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/protz/32/1641_2.png) [@ProtZ](https://community.gladysassistant.com/u/ProtZ)\
**Post date:** [February 25, 2021, 1:15am UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/114 "2021-02-25T01:15:55Z")

</div>

Hello,

I’m still interested too 😃 …  
I added a few tests on my branch, but it’s far from complete:

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/0/0135b6eecf0f6b5243f0cf81a9b4604b6b180751.png)

I’ll work on it a bit more tomorrow and push to @joeypic (he’s the one who holds the PR)

---

<div class="post-metadata">

**Author:** ![peb](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/peb/32/3480_2.png) [@peb](https://community.gladysassistant.com/u/peb)\
**Post date:** [May 17, 2021, 6:44pm UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/115 "2021-05-17T18:44:16Z")

</div>

Hello @ProtZ,

I’m not sure if @joeypic is very active right now, maybe you can «&nbsp;take over the PR&nbsp;» by creating a new PR to the main repo and submit it for review?

Thanks for the work done on this integration 😃

---

<div class="post-metadata">

**Author:** ![ProtZ](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/protz/32/1641_2.png) [@ProtZ](https://community.gladysassistant.com/u/ProtZ)\
**Post date:** [May 26, 2021, 8:02pm UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/116 "2021-05-26T20:02:47Z")

</div>

Hello @peb

Sorry I took so long to reply (on a personal note, I’ve been a dad again for 2 weeks, so I’m a bit busy)

I don’t know if this is the right way to proceed, I made a new PR:  
[https://github.com/GladysAssistant/Gladys/pull/1204](https://github.com/GladysAssistant/Gladys/pull/1204)

On test coverage, it’s perfectible, but I’ve made a lot of progress since the last time.

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

I’ll continue to try to get closer to 100%.

---

<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:** [May 27, 2021, 1:48am UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/117 "2021-05-27T01:48:44Z")

</div>

Hi @ProtZ! Great job on all this. Just a small note, be careful, your PR says it adds 12,000 lines of code. That seems huge for an integration (in comparison, the MQTT integration PR was 1,700 lines of code). In my opinion, you must have integrated files not necessary for your PR. Think about doing a small clean-up so that there is really only the strict minimum in the PR 🙂

---

<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:** [May 27, 2021, 7:36am UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/118 "2021-05-27T07:36:17Z")

</div>

Congratulations @ProtZ!

---

<div class="post-metadata">

**Author:** ![ProtZ](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/protz/32/1641_2.png) [@ProtZ](https://community.gladysassistant.com/u/ProtZ)\
**Post date:** [August 27, 2021, 5:45pm UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/119 "2021-08-27T17:45:34Z")

</div>

Hey!

First of all: thank you @Tlse-vins!  
I’m dropping by here to share some updates.

**Tests & corrections**  
I’m really proud to have completed the service tests while respecting the quality ratio:

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/f/f92abb8a60d4e9d7d1ee46db329543315581c448.png)  
The few remaining points are beyond my capacity, but I would be happy if someone could explain them to me.

I have added corrections, especially for the milight, whose color management remains unfortunately very imperfect to this day (roughly: I tried to convert the color picker values into 8-bit colors by approximation because that’s what the milights require).

**PR**  
The status of the PR seems okay to me, let me know if something is missing  
[https://github.com/GladysAssistant/Gladys/pull/1204](https://github.com/GladysAssistant/Gladys/pull/1204)

I generated [a test docker image](https://hub.docker.com/layers/163396315/ngeissel/gladys/rflinkdev/images/sha256-970b2bc03e3c217df08f1d881ac4f363cf751f80b22b7c7f60f7ac55f3c40d16?context=repo) for those who want to test. It has been running successfully at my place for a few days.

I’m waiting for your feedback, especially from those who have rflink gateway + device hardware (@peb?).

**Documentation**  
WIP: I am writing the documentation and plan a small presentation video.

---

<div class="post-metadata">

**Author:** ![syper](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/s/22d042/32.png) [@syper](https://community.gladysassistant.com/u/syper)\
**Post date:** [August 28, 2021, 7:09am UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/120 "2021-08-28T07:09:33Z")

</div>

It’s really coming along!!! I just need this integration to migrate to Gladys!

Thanks to the dev/testers!

---

<div class="post-metadata">

**Author:** ![cicoub13](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/cicoub13/32/4482_2.png) [@cicoub13](https://community.gladysassistant.com/u/cicoub13)\
**Post date:** [August 28, 2021, 10:43am UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/121 "2021-08-28T10:43:29Z")

</div>

Hi. Great work 💪 . I don’t have RFLink hardware but I’ll take a look at your PR

---

<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:** [August 30, 2021, 5:19am UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/122 "2021-08-30T05:19:33Z")

</div>

Great job @ProtZ!! 🙂

> [@ProtZ](#):
>
> WIP: I’m working on writing the documentation and plan to make a short presentation video.

Top! Don’t hesitate to post the video on Github and then share a link here so we can check it out.

I don’t have an RFlink, so I won’t be able to test it, but I can provide feedback on the UI and functionality.

---

<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:** [September 9, 2021, 11:10am UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/123 "2021-09-09T11:10:46Z")

</div>

For those who don’t know how to launch a test image, I wrote a small post describing how to test a test image with Docker, and I took the example of RFLink for the demo 🙂

To read here:

> [@Lancer une image Gladys de test?](https://community.gladysassistant.com/t/lancer-une-image-gladys-de-test/6509/7?u=pierre-gilles):
>
> Alors si c’est dans un but uniquement de test (pas pour développer), il vaut mieux lancer une image Docker «&nbsp;en condition réelle&nbsp;» plutôt que de faire ça dans un environnement de développement (ce qui ne reflète pas vraiment la réalité et n’est pas forcément facile à mettre en place) Pour lancer une image Docker, c’est le même process que décrit sur la page d’installation de Gladys via Docker ( [Installation avec Docker | Gladys Assistant](https://gladysassistant.com/fr/docs/installation/docker) ), à savoir lancer un container Docker sur la machine ou …

[Previous page](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186.md?page=5)

[Next page](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186.md?page=7)
