# Bluetooth zu Gladys 4 hinzufügen

**URL:** <https://community.gladysassistant.com/t/ajouter-le-bluetooth-a-gladys-4/5501>\
**Category:** Demandes livrées\
**Created:** [3. September 2020 um 15:58 UTC](https://community.gladysassistant.com/t/ajouter-le-bluetooth-a-gladys-4/5501 "2020-09-03T15:58:18Z")\
**Posts on this page:** 20\
**Page:** 3

<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:** [3. Oktober 2020 um 20:01 UTC](https://community.gladysassistant.com/t/ajouter-le-bluetooth-a-gladys-4/5501/42 "2020-10-03T20:01:55Z")

</div>

Echt seltsam… Ich habe es auch auf einem Rpi 3b+ getestet, ohne Probleme.  
Hast du noch eine andere Gladys, die auf demselben Gerät Bluetooth nutzt?

Bist du sicher, dass Bluetooth aktiviert ist?

```bash
bluetoothctl
> agent on
> power on

```

---

<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:** [3. Oktober 2020 um 20:23 UTC](https://community.gladysassistant.com/t/ajouter-le-bluetooth-a-gladys-4/5501/43 "2020-10-03T20:23:58Z")

</div>

```
pi@gladys:~ $ bluetoothctl
Agent registriert
[bluetooth]# agent on
Agent ist bereits registriert
[bluetooth]# power on
Ändern des Stroms auf ein erfolgreich
[bluetooth]#

```

Das ist die einzige VM, die Bluetooth verwendet

---

<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:** [3. Oktober 2020 um 20:28 UTC](https://community.gladysassistant.com/t/ajouter-le-bluetooth-a-gladys-4/5501/44 "2020-10-03T20:28:34Z")

</div>

In den Diskussionen auf dem edlen GitHub habe ich das hier gelesen

> Darf ich vorschlagen, einen Hinweis in deiner Readme hinzuzufügen, dass der BLE-Adapter nicht läuft, wenn dein Container nicht im _Host-Modus_ läuft?

Also, ich glaube, du wirst dein Docker-Netzwerk ändern müssen 😕

---

<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:** [3. Oktober 2020 um 20:29 UTC](https://community.gladysassistant.com/t/ajouter-le-bluetooth-a-gladys-4/5501/45 "2020-10-03T20:29:30Z")

</div>

Kann man das zum Beispiel am Port 80 ändern?

edit, gladys-net durch host ersetzen, ich verstehe und teste das mal.

---

<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:** [3. Oktober 2020 um 20:50 UTC](https://community.gladysassistant.com/t/ajouter-le-bluetooth-a-gladys-4/5501/46 "2020-10-03T20:50:45Z")

</div>

Da gibt es eine Berechtigungsgeschichte (Docker), wenn man etwas haben will, das unabhängig vom Netzwerkmodus ist. Ich kümmere mich darum, so schnell wie möglich.

---

<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:** [7. Oktober 2020 um 19:34 UTC](https://community.gladysassistant.com/t/ajouter-le-bluetooth-a-gladys-4/5501/47 "2020-10-07T19:34:01Z")

</div>

Also, keine Neuigkeiten? Ich veröffentliche gerade die Version v4.0.0-bluetooth.4 mit einigen grafischen Korrekturen und Code-Bereinigungen.

---

<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:** [9. Oktober 2020 um 08:22 UTC](https://community.gladysassistant.com/t/ajouter-le-bluetooth-a-gladys-4/5501/48 "2020-10-09T08:22:35Z")

</div>

Ich habe gerade den Fortschritt gesehen, wirklich cool!

> [@AlexTrovato](#):
>
> @pierre-gilles ich greife ein Thema wieder auf, das für den Bluetooth-Service aktuell wird: Abonnieren eines Events auf Serverseite, um die Erstellung eines neuen Geräts über die klassische API zu erkennen.

Am Ende hast du dich für welche Option in deinem PR entschieden?

---

<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:** [9. Oktober 2020 um 11:15 UTC](https://community.gladysassistant.com/t/ajouter-le-bluetooth-a-gladys-4/5501/49 "2020-10-09T11:15:55Z")

</div>

Schon wieder zurück? Ich habe die Option „Ich mache nichts ohne PG zu konsultieren“ gewählt 🙂  
Daher fehlt dieser Teil.  
Parallel arbeite ich an Awox Bluetooth, um zu sehen, ob in der Bluetooth-PR etwas vergessen wurde, und habe bestätigt, dass die Bluetooth-abhängigen Dienste gut funktionieren.  
Aber Noble ist voller Bugs, ich bin auf eine Verbindung pro Gerät beschränkt, danach ist es verloren… Ich warte auf eine neue Version, die dies beheben wird.

---

<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:** [9. Oktober 2020 um 11:46 UTC](https://community.gladysassistant.com/t/ajouter-le-bluetooth-a-gladys-4/5501/50 "2020-10-09T11:46:34Z")

</div>

> [@AlexTrovato](#):
>
> Schon wieder zurück?

Ja! Nach dem Urlaub antworte ich heute nur auf Nachrichten, aber ab Montag arbeite ich ernsthaft an Gladys weiter.

> [@AlexTrovato](#):
>
> - entweder einen neuen Endpunkt im Bluetooth-Dienst erstellen, um die Erstellung des Geräts zu verwalten (aber ich mag diese Option nicht),
> - oder über die Erstellung eines neuen Geräts benachrichtigt werden

Ich bin für Lösung Nr. 2, aber nur, wenn es ordentlich gemacht wird.

Meiner Meinung nach sollte kein „generisches“ Event gesendet werden, sondern ein anderes Event pro Dienst. Es wäre zu aufwendig, allen Diensten alle neu erstellten Geräte zu senden. Jeder Dienst sollte nur die neuen Geräte seines eigenen Dienstes erhalten.

Es könnte so etwas sein wie:

```javascript
this.gladys.event.emit(`${EVENTS.DEVICE.DEVICE_CREATED}.${device.service}`, device);

```

Was denkst du?

---

<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:** [9. Oktober 2020 um 15:21 UTC](https://community.gladysassistant.com/t/ajouter-le-bluetooth-a-gladys-4/5501/51 "2020-10-09T15:21:55Z")

</div>

Ich denke, es wäre trotzdem interessant, ein generisches Event zu haben, denn für den Google Home könnte man die neuen Geräte aller Dienste automatisch hinzufügen, damit sie ab ihrer Erstellung berücksichtigt werden, außer durch Benutzeraktionen.  
Daher wären beide Typen gut!

---

<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:** [9. Oktober 2020 um 15:35 UTC](https://community.gladysassistant.com/t/ajouter-le-bluetooth-a-gladys-4/5501/52 "2020-10-09T15:35:51Z")

</div>

Kannst du mir mehr über den Google Home Use Case erzählen?

---

<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:** [10. Oktober 2020 um 16:30 UTC](https://community.gladysassistant.com/t/ajouter-le-bluetooth-a-gladys-4/5501/53 "2020-10-10T16:30:48Z")

</div>

Wie du sehen konntest (ich erwähne das für die anderen) habe ich auf den Use Case GH im GH-Topic geantwortet:

> [@Gladys in GoogleHome integrieren](https://community.gladysassistant.com/t/integrer-gladys-dans-googlehome/5553/2?u=alextrovato):
>
> @pierre-gilles parlons en ici. Les services Google Home et Smartthings permettront de synchroniser Gladys avec les applis connues, plus particulièrement l’assistant vocal de Google qui a comprend plutôt bien quand on lui parle. Aujourd’hui sur la v3, je contrôle déjà mes devices avec Google Home mais je suis obligé de scanner manuellement les nouveaux devices. Avec la v4, et l’OAuth, il serait judicieux que ce soit Gladys qui gère les devices disponibles dans Google Home. Une fois la connexio…

Ansonsten, um auf deine Frage zum Stand der Dinge zu antworten, ich korrigiere kleine Dinge am Bluetooth mit der Integration des AwoX-Unterdienstes, aber ich warte vor allem auf Feedback von den Testern 🙂

Ich denke, ich werde den PR so schnell wie möglich überprüfen, falls es Änderungen gibt, werden sie geringfügig sein oder in einem PR eines Bluetooth-Unterdienstes integriert werden.

---

<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. Oktober 2020 um 14:46 UTC](https://community.gladysassistant.com/t/ajouter-le-bluetooth-a-gladys-4/5501/54 "2020-10-12T14:46:18Z")

</div>

Hallo!

Toll, toll dieser Fortschritt!

Beendest du die AwoX-Integration in diesem Bluetooth-PR?  
Falls nicht, werde ich versuchen, einige BT-Geräte zu testen, die ich habe! 🙂

Ich möchte die BeeWi/Otio-Geräte integrieren, wie gehe ich vor?  
Die Geräte: [Steckdosen](https://www.otio.com/produits/otiohome/energie1/prise-connectee-eco-energie/), Feuchtigkeits-/Temperatursensor und Türöffner.

Ich sollte einige Informationen zu den verwendbaren UUIDs und deren Funktion extrahieren können. Aber wie integriere ich sie in einen Subservice? Hast du schon eine Idee für ein Template?

---

<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:** [12. Oktober 2020 um 17:26 UTC](https://community.gladysassistant.com/t/ajouter-le-bluetooth-a-gladys-4/5501/55 "2020-10-12T17:26:36Z")

</div>

Hallo,  
AwoX benötigt Webseiten und einen sehr spezifischen Workflow, das wird also in einem anderen PR sein, aber du kannst dich schon an dem inspirieren, was ich gemacht habe, um deine eigenen „spezifischen“ Dienste zu erstellen. Schau dir nur den AwoX-Teil an (da Bluetooth noch nicht auf master ist, habe ich AwoX ausgehend vom Bluetooth-Zweig begonnen).

> <https://github.com/GladysAssistant/Gladys/pull/892>
>
> \### Pull Request check-list
> 
> To ensure your Pull Request can be accepted as fa…st as possible, make sure to review and check all of these items:
> 
> \- \[\] If your changes affects code, did your write the tests?
> \- \[\] Are tests passing? (\`npm test\` on both front/server)
> \- \[\] Is the linter passing? (\`npm run eslint\` on both front/server)
> \- \[\] Did you run prettier? (\`npm run prettier\` on both front/server)
> \- \[\] If you are adding a new features/services, did you run integration comparator? (\`npm run compare-translations\` on front)
> \- \[\] If your changes modify the API (REST or Node.js), did you modify the API documentation? (Documentation is based on comments in code)
> \- \[\] If you are adding a new features/services which needs explanation, did you modify the user documentation? See \[the GitHub repo\](https://github.com/GladysAssistant/v4-website) and the \[website\](https://gladysassistant.com).
> \- \[\] Did you add fake requests data for the demo mode (\`front/src/config/demo.json\`) so that the demo website is working without a backend? (if needed) See \[https://demo.gladysassistant.com\](https://demo.gladysassistant.com).
> 
> NOTE: these things are not required to open a PR and can be done afterwards / while the PR is open.
> 
> \### Description of change
> 
> Please provide a description of the change here. It's always best with screenshots, so don't hesitate to add some!

---

<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:** [16. Oktober 2020 um 07:03 UTC](https://community.gladysassistant.com/t/ajouter-le-bluetooth-a-gladys-4/5501/56 "2020-10-16T07:03:14Z")

</div>

@AlexTrovato Ich habe deine Arbeit auf Github gesehen, das ist wirklich toll!

Kann ich jetzt zusammenführen oder hast du noch andere Dinge damit zu tun? 🙂

---

<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:** [16. Oktober 2020 um 10:43 UTC](https://community.gladysassistant.com/t/ajouter-le-bluetooth-a-gladys-4/5501/57 "2020-10-16T10:43:56Z")

</div>

Für mich ist es im Moment in Ordnung, auch wenn es noch keine Rückmeldung von den Tests gibt.

---

<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:** [16. Oktober 2020 um 11:19 UTC](https://community.gladysassistant.com/t/ajouter-le-bluetooth-a-gladys-4/5501/58 "2020-10-16T11:19:30Z")

</div>

🤩

 ![Screenshot 2020-10-16 at 14.18.49](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/e/ed9dabac5175bdc2c9dfaa8d3dcdf43d1a84ad28.png)

---

<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:** [16. Oktober 2020 um 20:06 UTC](https://community.gladysassistant.com/t/ajouter-le-bluetooth-a-gladys-4/5501/59 "2020-10-16T20:06:37Z")

</div>

Gladys ist bei mir seit dem letzten Build kaputt. Der Container startet nicht mehr.

```auto
/src/server/services/bluetooth/node_modules/@abandonware/noble/lib/hci-socket/hci.js:100
    this._deviceId = this._socket.bindRaw(deviceId);
                                  ^

Error: ENODEV, No such device
    at Hci.init (/src/server/services/bluetooth/node_modules/@abandonware/noble/lib/hci-socket/hci.js:100:35)
    at NobleBindings.init (/src/server/services/bluetooth/node_modules/@abandonware/noble/lib/hci-socket/bindings.js:78:13)
    at /src/server/services/bluetooth/node_modules/@abandonware/noble/lib/noble.js:60:24
    at processTicksAndRejections (internal/process/task_queues.js:79:11) {
  errno: 19,
  code: 'ENODEV',
  syscall: 'bind'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gladys-server@ start:prod: `cross-env NODE_ENV=production node index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the gladys-server@ start:prod script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-10-16T20_07_23_616Z-debug.log

```

Edit: Ich habe ein GitHub-Issue erstellt, um dies zu verfolgen

---

<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:** [17. Oktober 2020 um 09:33 UTC](https://community.gladysassistant.com/t/ajouter-le-bluetooth-a-gladys-4/5501/60 "2020-10-17T09:33:29Z")

</div>

Hallo, ist das nicht das Problem, das wir mit der Netzwerkgeschichte des Containers hatten, der ‹&nbsp;host&nbsp;› sein sollte?

Bist du unter Docker?

Falls nicht, muss man bei manueller Ausführung  
`​sudo setcap cap_net_raw+eip ​$(​eval readlink -f ​"which node​"​)`  
ausführen.

---

<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:** [17. Oktober 2020 um 09:59 UTC](https://community.gladysassistant.com/t/ajouter-le-bluetooth-a-gladys-4/5501/61 "2020-10-17T09:59:34Z")

</div>

Ach, aber ich bin auf dem Host. (Docker auf Ubuntu Server 20.04 amd64)

Heute Morgen habe ich versucht, einen Bluetooth-4.0-Dongle anzuschließen, aber auch das stürzt beim Start ab. Auf dem Host kann ich ihn nicht erkennen, also könnte das Problem vielleicht nicht bei Gladys liegen. Ich werde weiter recherchieren 😕

[Vorherige Seite](https://community.gladysassistant.com/t/ajouter-le-bluetooth-a-gladys-4/5501.md?page=2)

[Nächste Seite](https://community.gladysassistant.com/t/ajouter-le-bluetooth-a-gladys-4/5501.md?page=4)
