SNIPS: Sprachsteuerung (mittlerweile auch per Textcommands) über snips.ai

Begonnen von Thyraz, 21 Juli 2018, 20:28:48

Vorheriges Thema - Nächstes Thema

rischbiter123

Moin,

mal ne andere Frage. Warum installierst Du eigentlich Snips nicht auf dem gleichen Rechner wie Fhem und Mosquitto? Wenn Du nur die Sprachsteuerung in einem anderen Raum brauchst, kannst Du den zweiten Rechner doch als Satellit konfigurieren.

Die Warnmeldungen habe ich übrigens auch seit gestern, k.A. warum, Snips funktioniert aber. Seltsamerweise auch wieder mit nur einer Antwort, ohne das ich was gemacht habe.

LG

Andreas
4*Raspi, Max Thermostate und Fensterkontakte, FB7590, Mysensors und NanoCUL, IT und Sonoff, zigbee2mqtt2

der_da

Zitat von: rischbiter123 am 08 März 2019, 13:02:50
Moin,

mal ne andere Frage. Warum installierst Du eigentlich Snips nicht auf dem gleichen Rechner wie Fhem ...
Das geht nicht. An meinem FHEM-Raspi hängen an den GPIOs eine Latte an Relais-Boards, die meine Rollläden ansteuern. Und ich möchte gern das Re-Speaker-Board nutzen.
Stimmt, könnte man tun.

Zitat
... und Mosquitto? Wenn Du nur die Sprachsteuerung in einem anderen Raum brauchst, kannst Du den zweiten Rechner doch als Satellit konfigurieren.
Die Warnmeldungen habe ich übrigens auch seit gestern, k.A. warum, Snips funktioniert aber. Seltsamerweise auch wieder mit nur einer Antwort, ohne das ich was gemacht habe.
Außerdem nahm ich an, es wäre kein Problem, FHEM und Snips auf getrennten Rechnern zu haben.

jowe

Zitat von: der_da am 08 März 2019, 13:32:35
Stimmt, könnte man tun.
Außerdem nahm ich an, es wäre kein Problem, FHEM und Snips auf getrennten Rechnern zu haben.
Das ist auch kein Problem. Nachdem ich am Anfang Snips auch mehrfach neu aufsetzen musste und jedes Mal FHEM auch wieder einrichten musste habe ich das auch getrennt. Bei mir funktioniert das auch problemlos. Ich würde an deiner Stelle einfach den Snips-Pi neu aufsetzen, geht ja eigentlich mit SAM sehr schnell. Ich denke dein Problem liegt irgendwo in der Snips-Installation..

der_da

Zitat von: jowe am 08 März 2019, 14:23:15
Das ist auch kein Problem. Nachdem ich am Anfang Snips auch mehrfach neu aufsetzen musste und jedes Mal FHEM auch wieder einrichten musste habe ich das auch getrennt. Bei mir funktioniert das auch problemlos. Ich würde an deiner Stelle einfach den Snips-Pi neu aufsetzen, geht ja eigentlich mit SAM sehr schnell. Ich denke dein Problem liegt irgendwo in der Snips-Installation..
So - es geht wieder nicht. Was habe ich gemacht?

- raspbian auf die SD-Karte geschoben
- eingeloggt auf dem Raspi
- sudo apt-get-update && sudo apt-get upgrade -y
- sudo raspi-config --> Localisation: deutsch, TZ: Berlin, feste IP, hostname=snips-base - reboot
- sudo apt install npm
- sudo npm install -g snips-sam
- sam connect snips-base
- sam init
- sam setup audio
- sam install assistant
- sudo apt install snips-injection (war schon vorhanden, nicht notwendig)
- sudo apt-get install mosquitto-clients
- mosquitto_sub -v -h 127.0.0.1 -p 1883 -t hermes/injection/perform/#

Und danach updateModel in FHEM ausgelöst - es passiert - NICHTS  :-\
Der Rest funktioniert - d.h. Wetter-Apps oder andere, nur die Injection geht nicht, was dazu führt, das Thyraz FHEM-App natürlich meine Räume nicht kennt. PLÖT!

Gäbe es die Möglichkeit, den String, der in der FHEM.log auftaucht, auf anderem Weg (direkt über die Konsole?) in Snips zu "injizieren"?
So langsam habe ich ja eher das Gefühl, dass das ein Problem auf dem FHEM-Rechner ist. Ist da noch mehr zu machen als die 10_SNIPS.pm in den FHEM-Ordner zu schieben?

der_da

Für andere snips-Apps finde ich Verzeichnisse unter
/var/lib/snips/skills
Warum gibt es da kein Verzeichnis für FHEM?
Wo legt die FHEM-App ihre Daten ab? Ich bin auf der Suche nach irgendwelchen Konfig-Dateien, denn schließlich muss es irgendwo auf dem Weg zwischen FHEM (Injection taucht im FHEM.Log auf) und Snips (Injection-Service läuft auf dem Snips-Rechner, aber es kommt nix an (mosquitto.log zeigt nur 1552141963: New connection from 192.168.178.103 on port 1883 wobei diese IP mein FHEM-Server ist)) ein Problem geben.

Die FHEM-App ist installiert, denn bei der Spracheingabe "Schalte das Licht im Flur ein!" wird folgendes bei sam watch angezeigt:

[14:47:38] [Asr] was asked to stop listening on site default
[14:47:38] [Hotword] was asked to toggle itself 'on' on site default
[14:47:40] [Hotword] detected on site default, for model hey_snips
[14:47:40] [Asr] was asked to stop listening on site default
[14:47:40] [Hotword] was asked to toggle itself 'off' on site default
[14:47:40] [Dialogue] session with id '87a1562b-fec6-4c63-ab8e-e21394c10cba' was started on site default
[14:47:40] [AudioServer] was asked to play a wav of 41.1 kB with id 'bce9d5ca-158f-4a1b-88aa-768b392ef6ea' on site default
[14:47:41] [AudioServer] finished playing wav with id 'bce9d5ca-158f-4a1b-88aa-768b392ef6ea'
[14:47:41] [Asr] was asked to listen on site default
[14:47:45] [Asr] captured text "schalte das im vier uhr ein" in 3.0s
[14:47:45] [Asr] was asked to stop listening on site default
[14:47:45] [AudioServer] was asked to play a wav of 93.1 kB with id '53a063e2-d17b-4255-89aa-83ffd6652f6c' on site default
[14:47:46] [AudioServer] finished playing wav with id '53a063e2-d17b-4255-89aa-83ffd6652f6c'
[14:47:46] [Nlu] was asked to parse input "schalte das im vier uhr ein"
[14:47:46] [Nlu] detected intent Thyraz:SetOnOff with confidence score 0.149 for input "schalte das im vier uhr ein"
              Slots ->
                 Value -> an (confidence: 0.652)
[14:47:46] [Dialogue] New intent detected Thyraz:SetOnOff with confidence 0.149
              Slots ->
                 Value -> an (confidence: 0.652)
[14:47:52] [Dialogue] session with id '87a1562b-fec6-4c63-ab8e-e21394c10cba' was ended on site default. The session was ended because one of the component didn't respond in a timely manner
[14:47:52] [Asr] was asked to stop listening on site default
[14:47:52] [Hotword] was asked to toggle itself 'on' on site default

Muss man da noch irgendwas konfigurieren, damit über die MQTT-Verbindung Daten fließen?

jowe

Also das scheint ja an einem Problem bei der MQTT Bridge zu liegen. Bekommst du denn über Mqtt publish und subscribe von anderen topics hin? Ist Mqtt mit der IP von Snips konfiguriert? Ich denke du solltest erstmal testen, ob die Verbindung zu dem Snips Broker tatsächlich funktionier

hkspks

Hallo zusammen,

bei mir läuft snips soweit ganz gut (OK, etwas Geduld muss man schon mitbringen ;-)) Frage: Ich hätte gerne noch eine einfache Timerfunktion. Wenn ich sage "Timer eine Minute" sehe ich in sam watch
[Nlu] detected intent Thyraz:SetTimer with confidence score 1.000 for input "timer eine minute"
              Slots ->
                 Duration -> 1 minutes (confidence: 0.847)
[12:41:58] [Dialogue] New intent detected Thyraz:SetTimer with confidence 1.000
              Slots ->
                 Duration -> 1 minutes (confidence: 0.847)
[12:41:58] [Nlu] was asked to parse input "timer eine minute"
[12:41:58] [Nlu] detected intent Thyraz:SetTimer with confidence score 1.000 for input "timer eine minute"
              Slots ->
                 Duration -> 1 minutes


Ich denke, das passt soweit. Was muss ich denn in FHEM noch machen, um eine Aktion auszuführen? Ein einfaches klingeln würde mir ausreichen, z.B. über mcp.

Kann mir jemand helfen?

der_da

Zitat von: jowe am 09 März 2019, 20:46:38
Also das scheint ja an einem Problem bei der MQTT Bridge zu liegen. Bekommst du denn über Mqtt publish und subscribe von anderen topics hin?
Wie kann ich denn Mqtt publish und subscribe von anderen topics testen?
Zitat
Ist Mqtt mit der IP von Snips konfiguriert?
Das steht in der mosquitto.log (auf dem Snips-Rechner) als erstes drin.
1552061885: mosquitto version 1.4.10 (build date Wed, 13 Feb 2019 00:45:38 +0000) starting
1552061885: Config loaded from /etc/mosquitto/mosquitto.conf.
1552061885: Opening ipv4 listen socket on port 1883.
1552061885: Opening ipv6 listen socket on port 1883.

Gibt es noch weitere Stellen, an denen etwas konfiguriert werden muss? Wenn ja, was?
/etc/mosquitto/mosquitto.conf sieht so aus:
# Place your local configuration in /etc/mosquitto/conf.d/
#
# A full description of the configuration file is at
# /usr/share/doc/mosquitto/examples/mosquitto.conf.example
pid_file /var/run/mosquitto.pid
persistence false
persistence_location /var/lib/mosquitto/
log_dest file /var/log/mosquitto/mosquitto.log
include_dir /etc/mosquitto/conf.d


Ich hänge hier mal die komplette mosquitto.log an. Vielleicht sieht ja der eine oder andere ein Problem (IP 192.168.178.103 ist mein FHEM-Rechner), der Rest sind lokale Verbindungen auf dem Snips-Rechner selbst.
1552061885: mosquitto version 1.4.10 (build date Wed, 13 Feb 2019 00:45:38 +0000) starting
1552061885: Config loaded from /etc/mosquitto/mosquitto.conf.
1552061885: Opening ipv4 listen socket on port 1883.
1552061885: Opening ipv6 listen socket on port 1883.
1552061895: New connection from ::1 on port 1883.
1552061895: New connection from ::1 on port 1883.
1552061895: New connection from ::1 on port 1883.
1552061895: New connection from ::1 on port 1883.
1552061895: New client connected from ::1 as snips-audio-server|483-snips-base-1 (c0, k10).
1552061895: New client connected from ::1 as snips-dialogue|487-snips-base-1 (c0, k10).
1552061895: New client connected from ::1 as snips-analytics|484-snips-base-1 (c0, k10).
1552061895: New client connected from ::1 as snips-tts|488-snips-base-1 (c0, k10).
1552061895: Socket error on client snips-analytics|484-snips-base-1, disconnecting.
1552061895: New connection from ::1 on port 1883.
1552061895: New client connected from ::1 as snips-hotword|490-snips-base-1 (c0, k10).
1552061895: New connection from ::1 on port 1883.
1552061895: New client connected from ::1 as snips-nlu|493-snips-base-1 (c0, k10).
1552061895: Socket error on client snips-audio-server|483-snips-base-1, disconnecting.
1552061895: New connection from 192.168.178.223 on port 1883.
1552061895: New client connected from 192.168.178.223 as 9a4LnN2Gpt (c0, k400, u'').
1552061897: New connection from ::1 on port 1883.
1552061897: New client connected from ::1 as snips-asr|486-snips-base-1 (c0, k10).
1552061897: New connection from ::1 on port 1883.
1552061897: New client connected from ::1 as snips-injection|496-snips-base-1 (c0, k10).
1552061898: New connection from ::1 on port 1883.
1552061898: New client connected from ::1 as 65653959-5ce0-48b2-8b16-eaa180879b10 (c1, k60).
1552061898: New connection from ::1 on port 1883.
1552061898: New client connected from ::1 as 7dfa495e-eb02-442b-a276-e894da43915e (c1, k60).
1552061898: New connection from ::1 on port 1883.
1552061898: New connection from ::1 on port 1883.
1552061898: New connection from ::1 on port 1883.
1552061898: New connection from ::1 on port 1883.
1552061898: New connection from ::1 on port 1883.
1552061898: New connection from ::1 on port 1883.
1552061898: New client connected from ::1 as python3.5|579-snips-base-0 (c0, k10).
1552061898: New client connected from ::1 as python3.5|561-snips-base-0 (c0, k10).
1552061898: New client connected from ::1 as python3.5|563-snips-base-0 (c0, k10).
1552061898: New client connected from ::1 as python3.5|572-snips-base-0 (c0, k10).
1552061898: New client connected from ::1 as python3.5|573-snips-base-0 (c0, k10).
1552061898: New client connected from ::1 as python3.5|560-snips-base-0 (c0, k10).
1552061898: New connection from ::1 on port 1883.
1552061898: New client connected from ::1 as python3.5|562-snips-base-0 (c0, k10).
1552061899: New connection from ::1 on port 1883.
1552061899: New connection from ::1 on port 1883.
1552061899: New connection from ::1 on port 1883.
1552061899: New client connected from ::1 as python2|559-snips-base-0 (c0, k10).
1552061899: New client connected from ::1 as python2|557-snips-base-0 (c0, k10).
1552061899: New client connected from ::1 as python2|571-snips-base-0 (c0, k10).
1552061901: New connection from ::1 on port 1883.
1552061901: New client connected from ::1 as snips-audio-server|822-snips-base-1 (c0, k10).
1552061901: New connection from ::1 on port 1883.
1552061901: New client connected from ::1 as snips-asr|486-snips-base-3 (c0, k10).
1552061940: New connection from 192.168.178.103 on port 1883.
1552061940: New client connected from 192.168.178.103 as Net::MQTT::Message[1251] (c1, k60).
1552063927: New connection from ::1 on port 1883.
1552063927: New client connected from ::1 as snips-watch|1033-snips-base-1 (c0, k10).
1552065271: Client Net::MQTT::Message[1251] has exceeded timeout, disconnecting.
1552065271: Socket error on client Net::MQTT::Message[1251], disconnecting.
1552065294: New connection from 192.168.178.103 on port 1883.
1552065294: New client connected from 192.168.178.103 as Net::MQTT::Message[1251] (c1, k60).
1552077038: Socket error on client snips-watch|1033-snips-base-1, disconnecting.
1552078913: Client Net::MQTT::Message[1251] disconnected.
1552078929: New connection from 192.168.178.103 on port 1883.
1552078929: New client connected from 192.168.178.103 as Net::MQTT::Message[1251] (c1, k60).
1552084804: New connection from ::1 on port 1883.
1552084804: New client connected from ::1 as snips-watch|2628-snips-base-1 (c0, k10).
1552118183: New connection from ::1 on port 1883.
1552118183: New client connected from ::1 as snips-watch|3021-snips-base-1 (c0, k10).
1552126143: Socket error on client snips-watch|2628-snips-base-1, disconnecting.
1552126143: Socket error on client snips-watch|3021-snips-base-1, disconnecting.
1552128902: New connection from 127.0.0.1 on port 1883.
1552128902: New client connected from 127.0.0.1 as mosqsub/3195-snips-base (c1, k60).
1552130333: Socket error on client mosqsub/3195-snips-base, disconnecting.
1552130351: Client Net::MQTT::Message[1251] disconnected.
1552130356: New connection from 192.168.178.103 on port 1883.
1552130356: New client connected from 192.168.178.103 as Net::MQTT::Message[1251] (c1, k60).
1552138328: Socket error on client 9a4LnN2Gpt, disconnecting.
1552138328: Socket error on client 65653959-5ce0-48b2-8b16-eaa180879b10, disconnecting.
1552138328: Socket error on client 7dfa495e-eb02-442b-a276-e894da43915e, disconnecting.
1552138328: Socket error on client python3.5|561-snips-base-0, disconnecting.
1552138328: Socket error on client python3.5|563-snips-base-0, disconnecting.
1552138328: Socket error on client python3.5|562-snips-base-0, disconnecting.
1552138328: Socket error on client python2|557-snips-base-0, disconnecting.
1552138328: Socket error on client python3.5|573-snips-base-0, disconnecting.
1552138328: Socket error on client python2|571-snips-base-0, disconnecting.
1552138328: Socket error on client python3.5|579-snips-base-0, disconnecting.
1552138328: Socket error on client python2|559-snips-base-0, disconnecting.
1552138328: Socket error on client python3.5|560-snips-base-0, disconnecting.
1552138328: Socket error on client python3.5|572-snips-base-0, disconnecting.
1552138394: Socket error on client snips-tts|488-snips-base-1, disconnecting.
1552138394: Socket error on client snips-dialogue|487-snips-base-1, disconnecting.
1552138394: New connection from ::1 on port 1883.
1552138394: New client connected from ::1 as snips-tts|3711-snips-base-1 (c0, k10).
1552138394: Socket error on client snips-hotword|490-snips-base-1, disconnecting.
1552138394: Socket error on client snips-audio-server|822-snips-base-1, disconnecting.
1552138394: Socket error on client snips-asr|486-snips-base-1, disconnecting.
1552138394: Socket error on client snips-asr|486-snips-base-3, disconnecting.
1552138394: Socket error on client snips-injection|496-snips-base-1, disconnecting.
1552138394: New connection from ::1 on port 1883.
1552138394: New connection from ::1 on port 1883.
1552138394: New client connected from ::1 as snips-dialogue|3715-snips-base-1 (c0, k10).
1552138394: New client connected from ::1 as snips-hotword|3724-snips-base-1 (c0, k10).
1552138394: New connection from ::1 on port 1883.
1552138394: New client connected from ::1 as snips-audio-server|3723-snips-base-1 (c0, k10).
1552138394: Socket error on client snips-nlu|493-snips-base-1, disconnecting.
1552138394: New connection from ::1 on port 1883.
1552138394: New client connected from ::1 as snips-nlu|3749-snips-base-1 (c0, k10).
1552138394: New connection from ::1 on port 1883.
1552138394: New client connected from ::1 as snips-injection|3733-snips-base-1 (c0, k10).
1552138394: New connection from ::1 on port 1883.
1552138394: New client connected from ::1 as snips-asr|3726-snips-base-1 (c0, k10).
1552138394: New connection from 192.168.178.223 on port 1883.
1552138394: New client connected from 192.168.178.223 as x45B6tbQjh (c0, k400, u'').
1552138395: New connection from ::1 on port 1883.
1552138395: New client connected from ::1 as snips-asr|3726-snips-base-3 (c0, k10).
1552138395: New connection from ::1 on port 1883.
1552138395: New client connected from ::1 as 586ea170-8c7c-4ff4-a24d-098a1f6d6953 (c1, k60).
1552138395: New connection from ::1 on port 1883.
1552138395: New client connected from ::1 as python3.5|3837-snips-base-0 (c0, k10).
1552138395: New connection from ::1 on port 1883.
1552138395: New client connected from ::1 as python3.5|3854-snips-base-0 (c0, k10).
1552138396: New connection from ::1 on port 1883.
1552138396: New client connected from ::1 as b5bb7b2c-5d81-4653-a184-90387a9d6a01 (c1, k60).
1552138396: New connection from ::1 on port 1883.
1552138396: New client connected from ::1 as python3.5|3841-snips-base-0 (c0, k10).
1552138396: New connection from ::1 on port 1883.
1552138396: New client connected from ::1 as python3.5|3845-snips-base-0 (c0, k10).
1552138396: New connection from ::1 on port 1883.
1552138396: New client connected from ::1 as python3.5|3850-snips-base-0 (c0, k10).
1552138396: New connection from ::1 on port 1883.
1552138396: New client connected from ::1 as python3.5|3833-snips-base-0 (c0, k10).
1552138396: New connection from ::1 on port 1883.
1552138396: New client connected from ::1 as python3.5|3858-snips-base-0 (c0, k10).
1552138396: New connection from ::1 on port 1883.
1552138396: New client connected from ::1 as python2|3825-snips-base-0 (c0, k10).
1552138396: New connection from ::1 on port 1883.
1552138396: New client connected from ::1 as python2|3824-snips-base-0 (c0, k10).
1552138396: New connection from ::1 on port 1883.
1552138396: New client connected from ::1 as python2|3846-snips-base-0 (c0, k10).
1552138505: Socket error on client 586ea170-8c7c-4ff4-a24d-098a1f6d6953, disconnecting.
1552138505: Socket error on client python3.5|3837-snips-base-0, disconnecting.
1552138505: Socket error on client b5bb7b2c-5d81-4653-a184-90387a9d6a01, disconnecting.
1552138505: Socket error on client python3.5|3850-snips-base-0, disconnecting.
1552138505: Socket error on client python3.5|3833-snips-base-0, disconnecting.
1552138505: Socket error on client python3.5|3858-snips-base-0, disconnecting.
1552138505: Socket error on client python2|3824-snips-base-0, disconnecting.
1552138505: Socket error on client python3.5|3845-snips-base-0, disconnecting.
1552138505: Socket error on client x45B6tbQjh, disconnecting.
1552138505: Socket error on client python3.5|3854-snips-base-0, disconnecting.
1552138505: Socket error on client python2|3846-snips-base-0, disconnecting.
1552138505: Socket error on client python2|3825-snips-base-0, disconnecting.
1552138505: Socket error on client python3.5|3841-snips-base-0, disconnecting.
1552139003: New connection from 192.168.178.223 on port 1883.
1552139003: New client connected from 192.168.178.223 as Y49rAOS2z7 (c0, k400, u'').
1552139003: Socket error on client snips-tts|3711-snips-base-1, disconnecting.
1552139003: New connection from ::1 on port 1883.
1552139003: New client connected from ::1 as snips-tts|4196-snips-base-1 (c0, k10).
1552139003: Socket error on client snips-hotword|3724-snips-base-1, disconnecting.
1552139003: Socket error on client snips-audio-server|3723-snips-base-1, disconnecting.
1552139003: Socket error on client snips-asr|3726-snips-base-3, disconnecting.
1552139003: Socket error on client snips-asr|3726-snips-base-1, disconnecting.
1552139003: New connection from ::1 on port 1883.
1552139003: New client connected from ::1 as snips-hotword|4201-snips-base-1 (c0, k10).
1552139003: Socket error on client Y49rAOS2z7, disconnecting.
1552139003: Socket error on client snips-dialogue|3715-snips-base-1, disconnecting.
1552139003: Socket error on client snips-injection|3733-snips-base-1, disconnecting.
1552139003: New connection from ::1 on port 1883.
1552139003: New client connected from ::1 as snips-audio-server|4205-snips-base-1 (c0, k10).
1552139003: Socket error on client snips-nlu|3749-snips-base-1, disconnecting.
1552139003: New connection from ::1 on port 1883.
1552139003: New client connected from ::1 as snips-dialogue|4208-snips-base-1 (c0, k10).
1552139003: New connection from ::1 on port 1883.
1552139003: New client connected from ::1 as snips-nlu|4214-snips-base-1 (c0, k10).
1552139004: New connection from ::1 on port 1883.
1552139004: New client connected from ::1 as snips-injection|4210-snips-base-1 (c0, k10).
1552139004: New connection from ::1 on port 1883.
1552139004: New client connected from ::1 as snips-asr|4204-snips-base-1 (c0, k10).
1552139004: New connection from 192.168.178.223 on port 1883.
1552139004: New client connected from 192.168.178.223 as i5nyxIr6Uv (c0, k400, u'').
1552139004: New connection from ::1 on port 1883.
1552139004: New client connected from ::1 as python3.5|4246-snips-base-0 (c0, k10).
1552139004: New connection from ::1 on port 1883.
1552139004: New client connected from ::1 as snips-asr|4204-snips-base-3 (c0, k10).
1552139023: New connection from ::1 on port 1883.
1552139023: New client connected from ::1 as snips-watch|4280-snips-base-1 (c0, k10).
1552139237: New connection from ::1 on port 1883.
1552139237: New client connected from ::1 as snips-watch|4319-snips-base-1 (c0, k10).
1552139249: Socket error on client snips-watch|4280-snips-base-1, disconnecting.
1552141959: Client Net::MQTT::Message[1251] disconnected.
1552141963: New connection from 192.168.178.103 on port 1883.
1552141963: New client connected from 192.168.178.103 as Net::MQTT::Message[1251] (c1, k60).
1552142116: Socket error on client snips-watch|4319-snips-base-1, disconnecting.
1552159658: Socket error on client i5nyxIr6Uv, disconnecting.
1552159658: Socket error on client python3.5|4246-snips-base-0, disconnecting.
1552159746: Socket error on client snips-injection|4210-snips-base-1, disconnecting.
1552159746: Socket error on client snips-tts|4196-snips-base-1, disconnecting.
1552159746: Socket error on client snips-dialogue|4208-snips-base-1, disconnecting.
1552159746: Socket error on client snips-audio-server|4205-snips-base-1, disconnecting.
1552159746: New connection from ::1 on port 1883.
1552159746: New client connected from ::1 as snips-tts|5005-snips-base-1 (c0, k10).
1552159746: New connection from ::1 on port 1883.
1552159746: New client connected from ::1 as snips-dialogue|5006-snips-base-1 (c0, k10).
1552159746: Socket error on client snips-asr|4204-snips-base-3, disconnecting.
1552159746: Socket error on client snips-hotword|4201-snips-base-1, disconnecting.
1552159746: Socket error on client snips-asr|4204-snips-base-1, disconnecting.
1552159746: Socket error on client snips-nlu|4214-snips-base-1, disconnecting.
1552159746: New connection from ::1 on port 1883.
1552159746: New client connected from ::1 as snips-injection|5004-snips-base-1 (c0, k10).
1552159746: New connection from ::1 on port 1883.
1552159746: New client connected from ::1 as snips-hotword|5019-snips-base-1 (c0, k10).
1552159746: New connection from ::1 on port 1883.
1552159746: New client connected from ::1 as snips-audio-server|5011-snips-base-1 (c0, k10).
1552159746: New connection from 192.168.178.223 on port 1883.
1552159746: New connection from ::1 on port 1883.
1552159746: New client connected from 192.168.178.223 as 5UBJ44K29M (c0, k400, u'').
1552159746: New client connected from ::1 as snips-nlu|5028-snips-base-1 (c0, k10).
1552159746: New connection from ::1 on port 1883.
1552159746: New client connected from ::1 as snips-asr|5018-snips-base-1 (c0, k10).
1552159746: Socket error on client 5UBJ44K29M, disconnecting.
1552159746: New connection from 192.168.178.223 on port 1883.
1552159746: Client 5UBJ44K29M disconnected.
1552159746: New client connected from 192.168.178.223 as 5UBJ44K29M (c0, k400, u'').
1552159746: New connection from ::1 on port 1883.
1552159746: New client connected from ::1 as snips-asr|5018-snips-base-3 (c0, k10).
1552159747: New connection from ::1 on port 1883.
1552159747: New client connected from ::1 as python3.5|5083-snips-base-0 (c0, k10).
1552159747: New connection from ::1 on port 1883.
1552159747: New client connected from ::1 as python2|5084-snips-base-0 (c0, k10).
1552159747: New connection from ::1 on port 1883.
1552159747: New client connected from ::1 as python2|5078-snips-base-0 (c0, k10).
1552159747: New connection from ::1 on port 1883.
1552159747: New client connected from ::1 as python2|5080-snips-base-0 (c0, k10).
1552181978: Client Net::MQTT::Message[1251] has exceeded timeout, disconnecting.
1552181978: Socket error on client Net::MQTT::Message[1251], disconnecting.
1552181994: New connection from 192.168.178.103 on port 1883.
1552181994: New client connected from 192.168.178.103 as Net::MQTT::Message[1251] (c1, k60).
1552199306: Client Net::MQTT::Message[1251] has exceeded timeout, disconnecting.
1552199306: Socket error on client Net::MQTT::Message[1251], disconnecting.
1552199322: New connection from 192.168.178.103 on port 1883.
1552199322: New client connected from 192.168.178.103 as Net::MQTT::Message[1251] (c1, k60).
1552227660: Socket error on client snips-tts|5005-snips-base-1, disconnecting.
1552227660: Socket error on client snips-injection|5004-snips-base-1, disconnecting.
1552227660: Socket error on client snips-dialogue|5006-snips-base-1, disconnecting.
1552227660: Socket error on client python2|5080-snips-base-0, disconnecting.
1552227660: Socket error on client 5UBJ44K29M, disconnecting.
1552227660: Socket error on client python2|5084-snips-base-0, disconnecting.
1552227660: Socket error on client python2|5078-snips-base-0, disconnecting.
1552227660: Socket error on client snips-audio-server|5011-snips-base-1, disconnecting.
1552227660: Socket error on client snips-nlu|5028-snips-base-1, disconnecting.
1552227660: Socket error on client python3.5|5083-snips-base-0, disconnecting.
1552227660: New connection from 192.168.178.223 on port 1883.
1552227660: Socket error on client snips-asr|5018-snips-base-3, disconnecting.
1552227660: Socket error on client snips-asr|5018-snips-base-1, disconnecting.
1552227660: New client connected from 192.168.178.223 as p6Z2914s2V (c0, k400, u'').
1552227660: Socket error on client snips-hotword|5019-snips-base-1, disconnecting.
1552227660: Error in poll: Interrupted system call.
1552227660: mosquitto version 1.4.10 terminating
1552227663: mosquitto version 1.4.10 (build date Wed, 13 Feb 2019 00:45:38 +0000) starting
1552227663: Config loaded from /etc/mosquitto/mosquitto.conf.
1552227663: Opening ipv4 listen socket on port 1883.
1552227663: Opening ipv6 listen socket on port 1883.
1552227673: New connection from ::1 on port 1883.
1552227673: New connection from ::1 on port 1883.
1552227673: New client connected from ::1 as snips-audio-server|486-snips-base-1 (c0, k10).
1552227673: New client connected from ::1 as snips-dialogue|484-snips-base-1 (c0, k10).
1552227673: New connection from ::1 on port 1883.
1552227673: New connection from ::1 on port 1883.
1552227674: New client connected from ::1 as snips-tts|490-snips-base-1 (c0, k10).
1552227674: New client connected from ::1 as snips-analytics|491-snips-base-1 (c0, k10).
1552227674: Socket error on client snips-analytics|491-snips-base-1, disconnecting.
1552227674: New connection from ::1 on port 1883.
1552227674: New client connected from ::1 as snips-hotword|485-snips-base-1 (c0, k10).
1552227674: New connection from ::1 on port 1883.
1552227674: New client connected from ::1 as snips-nlu|487-snips-base-1 (c0, k10).
1552227674: New connection from 192.168.178.223 on port 1883.
1552227674: New client connected from 192.168.178.223 as 6255djQFP3 (c0, k400, u'').
1552227674: Socket error on client snips-audio-server|486-snips-base-1, disconnecting.
1552227675: New connection from ::1 on port 1883.
1552227675: New client connected from ::1 as snips-asr|482-snips-base-1 (c0, k10).
1552227675: New connection from ::1 on port 1883.
1552227675: New client connected from ::1 as snips-injection|492-snips-base-1 (c0, k10).
1552227676: New connection from ::1 on port 1883.
1552227676: New client connected from ::1 as python3.5|543-snips-base-0 (c0, k10).
1552227677: New connection from ::1 on port 1883.
1552227677: New connection from ::1 on port 1883.
1552227677: New connection from ::1 on port 1883.
1552227677: New client connected from ::1 as python2|546-snips-base-0 (c0, k10).
1552227677: New client connected from ::1 as python2|545-snips-base-0 (c0, k10).
1552227677: New client connected from ::1 as python2|544-snips-base-0 (c0, k10).
1552227679: New connection from ::1 on port 1883.
1552227680: New client connected from ::1 as snips-audio-server|773-snips-base-1 (c0, k10).
1552227680: New connection from ::1 on port 1883.
1552227680: New client connected from ::1 as snips-asr|482-snips-base-3 (c0, k10).
1552227725: New connection from 192.168.178.103 on port 1883.

der_da

Weitere Erkenntnis:
Ich habe auf dem Snips-Rechner den MQTT-Service angehalten und dann in der Kommandozeile eingegeben:
mosquitto
Anschließend kann man "live" zusehen, was da so passiert (im Prinzip das, was sonst in der log-Datei landet).
Wenn ich dann im FHEM folgendes mache:
set SnipsMQTT connect
dann erfolgt sofort in der Kommandozeile auf dem Snips-Rechner:
1552410145: New connection from 192.168.178.103 on port 1883.
1552410145: New client connected from 192.168.178.103 as Net::MQTT::Message[1251] (c1, k60).

ein
set SnipsMQTT publish irgendeintext
erzeugt dagegen nichts.
set SnipsMQTT disconnect
erzeugt dann
1552410241: Client Net::MQTT::Message[1251] disconnected.

Noch einmal die Frage an die MQTT-Profis: Was kann der Grund sein, dass offenbar die Verbindung hergestellt werden kann, Daten aber nicht übertragen werden?

hkspks

Noch jemand ein Beispiel/ kreativen Input für den Snips-Timer in FHEM?

laberlaib

Imho ist der SetTimer-Intent noch nicht fertig bzw. wird nicht fertig Verarbeitet.
Unter
https://github.com/Thyraz/Snips-Fhem/blob/master/FHEM/10_SNIPS.pm
Strg+F: "SetTimer" wird nichts gefunden.

D.h. - und jetzt bin ich gerade nicht ganz im Thema drin - du müsstest irgendwie anders auf dem MQTT-Topic lauschen und wenn "SetTimer" kommt darauf und auf die Slots (Duration) reagiern.
Oder vielleicht geht das auch schon mit der Shortcuts-Funktion?
--
Proxmox, Homematic, G-Tags, Zigbee2MQTT, Rhasspy Sprachsteuerung im Aufbau (beta)

hkspks

Zitat von: Thyraz am 10 September 2018, 17:23:02
Ok, das Umrechen ohne zu wissen wann das ganze stattfindet klappt durch einige der Werte ja gar nicht.
Thema Schaltjahr, Anzahl Tage im Monat usw.

Ich übergebe also doch den ganzen Hash.

Aktualisierte 10_SNIPS.pm auf Github verfügbar

Beispiel für die Abfrage:

# SetTimer Custom Intent
sub snipsSetTimer($) {
  # Übergebene Parameter in Variablen speichern
  my ($duration) = @_;

  # Standardantwort festlegen
  my $response = "Keine Zeit angegeben";

  if (defined($duration)) {
    my $seconds = $duration->{'seconds'};
    my $minutes = $duration->{'minutes'};
    my $hours = $duration->{'hours'};

    $response = "Timer soll $seconds Sekunden, $minutes Minuten und $hours Stunden laufen";
  }

  return $response;
}


Wundert mich, da es wohl eigentlich schon mal drin war...

laberlaib

--
Proxmox, Homematic, G-Tags, Zigbee2MQTT, Rhasspy Sprachsteuerung im Aufbau (beta)

hkspks

OK, wer sucht, der findet! Für die Allgemeinheit:

setTimer ist bereits ein Intent, der im FHEM-Snips-Modul auf snips.ai trainiert wurde, aber aktuell nicht in der snips.pm implementiert wird. Die aktuelle snips.pm (Commit on Feb 27, 2019) interpretiert diesen daher als customIntent (siehe github Doku). Um einen einfachen Timer zu implementieren (mpg123 spielt nach Timer-Zeit das file wecker.mp3) kann man folgendes Snippet verwenden:

99_myutils.pm
# SetTimer Custom Intent
sub snipsSetTimer($) {
  # Übergebene Parameter in Variablen speichern
  my ($duration) = @_;

  # Standardantwort festlegen
  my $response = "Leider habe ich die Dauer nicht verstanden.";

  if (defined($duration)) {
    my $seconds = $duration->{'seconds'};
    my $minutes = $duration->{'minutes'};
    my $hours = $duration->{'hours'};
    my $duration_export = strftime('%H:%M:%S', $seconds, $minutes, $hours, 1, 1, 1900);
    my $duration_secs = $seconds + 60 * $minutes + 3600 * $hours;

    fhem("defmod tmptimer at +$duration_export {system '/usr/bin/mpg123 /var/lib/mpd/music/wecker.mp3'}");

    if($duration_secs < 60){ $response = "Timer gesetzt auf $seconds Sekunden.";}
    elsif($duration_secs < 3600){ $response = "Timer gesetzt auf $minutes Minuten und $seconds Sekunden.";}
    else {$response = "Timer gesetzt auf $hours Stunden, $minutes Minuten und $seconds Sekunden.";}

  }
return $response;
}


Dann noch den custom intent dem Snips-device bekannt machen:
attr Snips snipsIntents SetTimer=snipsSetTimer(Duration)

Fallstricke: damit user fhem musik spielen kann über mpg123 muss man ihn noch der Gruppe audio hinzufügen: usermod -a -G audio fhem

der_da

#704
Ich kämpfe immer noch mit der Verbindung zwischen meinem FHEM uns SNIPS.
Noch mal zur Zusammenfassung:
fhem-pi unter Raspbian Jessie mit IP 192.168.178.103
snips-base unter Raspbian Stretch mit IP 192.168.178.223

Auf snips-base gebe ich ein:
mosquitto_sub -v -h 127.0.0.1 -d -t 'test'
Anschließend lauscht er auf die Dinge die da kommen:
Client mosqsub/15983-snips-bas sending CONNECT
Client mosqsub/15983-snips-bas received CONNACK
Client mosqsub/15983-snips-bas sending SUBSCRIBE (Mid: 1, Topic: test, QoS: 0)
Client mosqsub/15983-snips-bas received SUBACK
Subscribed (mid: 1): 0


Wenn ich auf fhem-pi eingebe:
mosquitto_pub -h 192.168.178.223 -m "test message" -t test -d
dann erscheint nach dem Enter:
Client mosqpub/6337-fhem-pi sending CONNECT
Client mosqpub/6337-fhem-pi received CONNACK
Client mosqpub/6337-fhem-pi sending PUBLISH (d0, q0, r0, m1, 'test', ... (12 bytes))
Client mosqpub/6337-fhem-pi sending DISCONNECT


und auf snips-base erscheint:
Client mosqsub/15986-snips-bas received PUBLISH (d0, q0, r0, m0, 'test', ... (12 bytes))
test test message


Ich kann also MQTT-Nachrichten von FHEM zu SNIPS senden!

Wenn in der FHEM-Oberfläche nacheinander:
set SNIPS say Das ist ein Test
set SNIPS sendTextmessage Schalte das Licht ein
set SNIPS updateModel

eingebe, dann erscheint bei verbose 5 folgendes:
2019.03.18 18:37:09 5: set say - value: Das ist ein Test
2019.03.18 18:37:19 5: set textCommand - value: Schalte das Licht ein
2019.03.18 18:37:19 5: Parsed value: Schalte das Licht ein for key: input
2019.03.18 18:37:19 5: Parsed value:  for key: intent
2019.03.18 18:37:19 5: Parsed value:  for key: sessionId
2019.03.18 18:37:19 5: Parsed value:  for key: probability
2019.03.18 18:37:19 5: Parsed value:  for key: siteId
2019.03.18 18:37:19 5: sending message to NLU: {"id":"{\u0022Channel\u0022:null,\u0022Color\u0022:null,\u0022Device\u0022:\u0022 licht\u0022,\u0022Room\u0022:null,\u0022Type\u0022:null,\u0022input\u0022:\u0022Schalte das Licht ein\u0022,\u0022sessionId\u0022:null,\u0022siteId\u0022:null}","input":"Schalte dasstandardgerät ein","sessionId":"fhem.textCommand"}
2019.03.18 18:37:23 5: set updateModel - value:
2019.03.18 18:37:23 5: Injecting data to ASR: {"operations":[["add",{"de.fhem.Device":["alle Rollläden hoch","Thermometer"," Licht"," Müll"," Lampe"," Robi","Kamin","Gast"]}],["add",{"de.fhem.Room":["Schlafzimmer","Wohnzimmer"," Draußen"," Straße","Draußen","Terrasse","Außen","Garage","Garten","Flur","Haus","Bad"]}],["add",{"de.fhem.NumericType":["Luftfeuchtigkeit","Temperatur","Helligkeit"]}],["add",{"de.fhem.Shortcuts":["Welcher Tag ist heute"]}]]}


Wer kann mir Hinweise geben, wo ich noch suchen kann und was ich tun kann, um das Problem weiter einzugrenzen?