# \[V4\] Dev-Dienst RFlink

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

<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:** [17. Februar 2020 um 08:42 UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/22 "2020-02-17T08:42:23Z")

</div>

> [@joeypic](#):
>
> et j’ai regardé c’est la même chose pour le service zwave qui recupère un 404 aussi sur sa route :

Keine Ahnung, wo du das her hast, aber bei mir ist das nicht so! Die Route des Z-Wave-Dienstes funktioniert.

 ![Screenshot 2020-02-17 at 09.39.55](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/9/966bc62a279ac5139b8f05a7dd7fae3785f3c1c7.png)

> [@joeypic](#):
>
> @pierre-gilles J’aimerai bien savoir si c’est possible dans mon service de faire une condition pour savoir si un device existe dans la BDD ou pas ?

Alles ist möglich ^^

> [@joeypic](#):
>
> c’est juste que comme la RC sort le 21 je voulais voir si j’étais capable de sortir le service avant

Ich habe gerade ein kleines Update im Forum gepostet, das Veröffentlichungsdatum wurde verschoben, du hast also noch Zeit 🙂

---

<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:** [17. Februar 2020 um 10:03 UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/23 "2020-02-17T10:03:28Z")

</div>

Ich muss wohl ein Problem haben, alle Anfragen, die in den Controllern aller Module deklariert sind, geben 404 zurück, die anderen funktionieren.  
Zum Beispiel für den zwave-Service:

 ![Capture](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/7/70516630e715f67c33e60cfe12af87f4a5786ff9.png)  
Immer 404

Cool, vielleicht habe ich Zeit, meinen Service vor der RC fertigzustellen 😛

---

<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:** [19. Februar 2020 um 08:32 UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/25 "2020-02-19T08:32:00Z")

</div>

Schließlich habe ich die gesamte Gladys-Entwicklungsumgebung neu erstellt und die 404-Fehler für das Z-Wave-Modul sind verschwunden. Allerdings habe ich noch andere auf meinem Weg.

> /api/v1/service/rflink/status

Ich verstehe nicht, warum diese Anfrage immer eine NOT\_FOUND-Meldung zurückgibt, während andere funktionieren.

Falls jemand Zeit hat, den Code anzusehen, wäre das super, dann könnte ich meinen Dienst abschließen 😀

Der GitHub: [GitHub - mTondenier/Gladys at rflink · GitHub](https://github.com/mTondenier/Gladys/tree/rflink)

---

<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:** [20. Februar 2020 um 08:32 UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/26 "2020-02-20T08:32:35Z")

</div>

Dein Service wurde nie gestartet, er ist nicht in der Liste der Dienste hier =\>

[https://github.com/mTondenier/Gladys/blob/rflink/server/services/index.js](https://github.com/mTondenier/Gladys/blob/rflink/server/services/index.js)

---

<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:** [20. Februar 2020 um 08:34 UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/27 "2020-02-20T08:34:50Z")

</div>

Das ist korrigiert  
Entschuldigung, ich habe vergessen, die index.js auf GitHub hochzuladen, aber sie ist gestartet  
Das Problem liegt in der controllers.js oder in der actions.js des Frontends

---

<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:** [20. Februar 2020 um 08:42 UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/28 "2020-02-20T08:42:58Z")

</div>

![Screenshot 2020-02-20 at 09.42.29](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/d/de1234552f7cefe6070f441b46ae282c03033388.png)

Siehst du keine Probleme? ^^

---

<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:** [20. Februar 2020 um 08:46 UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/29 "2020-02-20T08:46:17Z")

</div>

🤯 Danke 😀 Ich hätte eine Woche lang suchen können

---

<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:** [20. Februar 2020 um 08:50 UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/30 "2020-02-20T08:50:24Z")

</div>

Es gibt 2 Fehler auf dem Bild! «&nbsp;sevice&nbsp;» statt «&nbsp;service&nbsp;» und das «&nbsp;/&nbsp;» am Ende von «&nbsp;rflink/remove&nbsp;», das sollte nicht da sein.

Ich sehe, dass du keine Unit-Tests geschrieben hast, das hätte dir hier wahrscheinlich geholfen 🙂 Denk daran, sie zu schreiben, bevor du deinen PR machst.

---

<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:** [1. März 2020 um 13:41 UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/31 "2020-03-01T13:41:10Z")

</div>

Nach einer Woche Skiurlaub nehme ich die Entwicklung des Dienstes wieder auf und würde gerne wissen, ob jemand mit einer Entwicklungsumgebung den Dienst testen und mir Feedback geben kann.

- 433 MHz funktioniert vollständig ( @JPL ich erinnere mich, dass du Stecker hattest )
- Milight ist fast funktionsfähig

Ich muss nur die Tests schreiben (ich weiß nicht, wie man das macht) und die Möglichkeit hinzufügen, ein Gerät manuell zu erstellen

---

<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:** [7. März 2020 um 18:17 UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/32 "2020-03-07T18:17:58Z")

</div>

Hallo,  
@joeypic ich habe ein Docker-Image deiner RFlink-Integration über mein GitLab erstellt. Das Bild wird gebaut! 👍

[EDIT] : Hmmm.. es scheint, dass ich etwas voreilig war, indem ich den Master in den rflink-Zweig zusammengeführt habe. Ich teste es noch einmal nur mit deinem Zweig… Ich werde diesen Beitrag aktualisieren, sobald ich fertig bin! 🙂

Aber ich habe einen Fehler beim Starten des Moduls `serialport`. Hast du eine Idee?

```auto
Error: Cannot find module 'serialport'
Require stack:
- /src/server/services/rflink/lib/commands/rflink.connect.js
- /src/server/services/rflink/lib/index.js
- /src/server/services/rflink/index.js
- /src/server/services/index.js
- /src/server/lib/index.js
- /src/server/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
    at Function.Module._load (internal/modules/cjs/loader.js:864:27)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (/src/server/services/rflink/lib/commands/rflink.connect.js:2:20)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (/src/server/services/rflink/lib/index.js:12:21)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (/src/server/services/rflink/index.js:2:23)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (/src/server/services/index.js:11:25)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/src/server/services/rflink/lib/commands/rflink.connect.js',
    '/src/server/services/rflink/lib/index.js',
    '/src/server/services/rflink/index.js',
    '/src/server/services/index.js',
    '/src/server/lib/index.js',
    '/src/server/index.js'
  ]
}

```

Vielen Dank im Voraus für die Hilfe! 😉

---

<div class="post-metadata">

**Author:** ![Reno](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/reno/32/5939_2.png) [@Reno](https://community.gladysassistant.com/u/Reno)\
**Post date:** [7. März 2020 um 19:27 UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/33 "2020-03-07T19:27:08Z")

</div>

Guten Abend,

> npm install serialport

vielleicht?

---

<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:** [8. März 2020 um 10:37 UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/34 "2020-03-08T10:37:17Z")

</div>

Gut gesehen, ich habe vergessen, die Installation von serialport beim Build des Docker-Images hinzuzufügen! Danke! 👍

Okay, es lädt, aber jetzt habe ich einen 404-Fehler auf der Seite der RFLink-Integration (dashboard/integration/device/rflink).

---

<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:** [8. März 2020 um 10:46 UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/35 "2020-03-08T10:46:08Z")

</div>

> [@peb](#):
>
> at Function.Module.\_resolveFilename (internal/modules/cjs/loader.js:982:15) at Function.Module.\_load (internal/modules/cjs/loader.js:864:27) at Module.require (internal/modules/cjs/loader.js:1044:19)

Ich werde ein Update durchführen, also warte 15 Minuten und lade es dann erneut herunter.

---

<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:** [10. März 2020 um 17:26 UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/36 "2020-03-10T17:26:47Z")

</div>

Beim Service ist es fast fertig, es fehlt nur noch die Farbverwaltung für die Lampen. Ich habe den Eindruck, dass die Farb- und Helligkeitsfunktionen in Gladys derzeit keine Benutzeroberfläche haben. Ist das normal?

Ich suche immer noch Tester mit einer Rflink-Installation. Das Modul ist fertig, aber ich würde gerne Feedback zum 433-MHz und zum Pairing der Milights erhalten.

---

<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:** [10. März 2020 um 18:30 UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/37 "2020-03-10T18:30:25Z")

</div>

> [@joeypic](#):
>
> Die Funktionen Farbe und Helligkeit haben im Moment keine Benutzeroberfläche in Gladys, ist das normal?

Ja, das ist normal, niemand hat das programmiert 🙂 Im Moment funktioniert nur das Ein- und Ausschalten der Lampen.

---

<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:** [12. März 2020 um 18:35 UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/38 "2020-03-12T18:35:41Z")

</div>

Ich habe endlich ein Docker-Image, das läuft 🙌

✅ Ich kann auf die RFlink-Integration zugreifen  
✅ Der Arduino wird korrekt erkannt

Jetzt, wenn ich ein Gerät hinzufügen möchte, wie läuft das ab? 😃 (Ich bin noch relativ neu mit RFlink 😅)  
Welchem Feld entspricht „The feature external ID“? Dem Namen? Oder wird es automatisch generiert?  
Wenn ich eine On/Off-Steckdose „Zap“ hinzufügen möchte, welche Auswahl muss ich im Dropdown-Menü unter „room“ treffen?  
Ich nehme an, die zugehörige Funktion wird „Switch“ sein

Aktuell leitet der Link zur RFLink-API auf die MQTT-API um, aber da die Dokumentation noch nicht online ist, ist das wahrscheinlich normal 🙂

So, so, es geht voran! 🙂  
Vielen Dank im Voraus für deine Hilfe!

---

<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:** [13. März 2020 um 18:11 UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/39 "2020-03-13T18:11:31Z")

</div>

Für die Hinzufügung eines Geräts muss der Typ Tristate gewählt werden und für die ID:

> rflink:«&nbsp;ID deiner Steckdose&nbsp;»:switch:«&nbsp;Nummer deiner Steckdose auf der Fernbedienung&nbsp;»

Ja, für den Link ist das normal 😀

---

<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:** [14. März 2020 um 09:22 UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/40 "2020-03-14T09:22:52Z")

</div>

@joeypic könnte der Service nicht etwas Einfacheres für den Benutzer machen?

Zum Beispiel zwei Felder «&nbsp;Socket-ID&nbsp;» und «&nbsp;Socket-Nummer auf der Fernbedienung&nbsp;» einfügen?

Und dann setzt das Frontend automatisch die externe\_id zusammen?

In der v4 versuchen wir, interne Mechanismen nicht offenzulegen, alles muss getan werden, um das Leben des Benutzers zu vereinfachen!

---

<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:** [14. März 2020 um 12:20 UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/41 "2020-03-14T12:20:49Z")

</div>

Dafür müsste ich im Block der Gerätefunktionen etwas ändern, aber das ist eine gute Idee, ich schau mal.

---

<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:** [14. März 2020 um 12:22 UTC](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186/42 "2020-03-14T12:22:57Z")

</div>

Warum ist das nicht pro Gerät? (einfache Frage!)

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

[Nächste Seite](https://community.gladysassistant.com/t/v4-dev-service-rflink/5186.md?page=3)
