alexa-fhem: amazon alexa smart home skill für fhem

Begonnen von justme1968, 05 November 2016, 23:21:32

Vorheriges Thema - Nächstes Thema

Dave90

Frage zu fhemintents und mehreren Räumen
Zunächst: Großes Lob für die Alexa Fhem Skills, der Custom skill wächst ja immer weiter  :) Leider damit auch seine Komplexität, was mich direkt zu meiner Frage bringt:
Ich habe mehrere squeezeboxen in mehreren Räumen und würde diese gerne über den Alexa Custom Skill steuern, allerdings nicht nur ein aus, sondern auch spezielle Playlisten, Lautstärke etc. Ich hatte mir überlegt mehrere Custom Skills zu erstellen mit Invocation Names: Wohnzimmer, Schlafzimmer etc., wie es ja auch schon einige hier gemacht haben.
Die Steuerung würde dann so aussehen: Alexa, sage Wohnzimmer spiele entspannte Musik.
Nun würde ich die steuerung gerne über Intents und DoIfs machen, da dies recht einfach ist. Jedoch sind die Intents ja für alle Custom Skills übergreifend, wenn ich das richtig sehe? Oder gibt es eine Möglichkeit, Intents und Custom Skills eindeutig zuzuordnen? Oder kann ich mir evtl. mehrere Alexa Devices in Fhem anlegen und jedes einem Custom Skill zuordnen?
Oder gibt es eine bessere Möglichkeit? Die Alternative ist wahrscheinlich über das Homebridgemapping, da bin ich aber bis heute noch nicht richtig durchgestiegen und gerade kompliziertere Sachen wei Lautstärke, Playlisten etc. werden da wahrscheinlich zum ausarten...

Danke schonmal für die Hilfe  :)
Hardware:  FHEM-& LMS-Server + NAS: Banana Pi; Hyperion Ambilight Server + anderer Kleinkram: RPI Model B; Lampen: Philips Hue + Milight; Homematic Heizungssteuerung; Entertainment: Harmony Hub
sonstiges: Funksteckdosen

justme1968

du kannst im perl code des fhem intent nachschauen von welchem dot bzw. welchem skill das kommando gekommen ist und entsprechend das richtige device steuern.

gruss
  andre
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

Reinhart

ich würde es mit mehreren Custom Skills durchführen, weil das gut funktioniert und du besser die Übersicht hast.
Die Intents hast ja für jeden Skill separat und nicht übergreifend, also eine gute Trennung. Musst aber nicht jeden Device extra einen Skill geben, sondern nur jene die in diesem Raum oder Gruppe sind.

Auch die Fragestellung ist mit mehren Skills logischer aufgebaut, finde ich.

LG
Reinhart
FHEM auf Raspy4 mit Bullseye + SSD, Homematic, ESP8266, ESP32, Sonoff, eBus, NanoCUL, MapleCUL, , MQTT2, Alexa

Dave90

#2808
Oh ok, ich war mir nicht bewusst, dass ich für jeden Skill unterschiedliche Intents habe. Habe bisher nur einen eingerichtet und für mich sieht es so aus, dass jedes Alexa Device in Fhem Intents hat und ich dachte wenn ich nun mehrere Customskills habe unter dem gleichen alexa device werden diese zusammen gefasst. Aber bevor ich jetzt weiter lamentiere setze ich einfach mal einen zweiten Skill auf und schaue dann wie es aussieht  ;) Danke bis hierhin schon mal  :)

Ok es klappt! Falls sich nochmal jemand die gleiche Frage stellt:
Wenn ihr mehrere Custom Skills aktiviert habt, heißt das fhemintent nicht mehr nur "<intentname"> sondern "<intentname>:amzn1.ask.skill...."
Damit kann man dann differenzieren von welchem Skill aus das Intent ausging, auch wenn der Intentname gleich ist.

Danke nochmal  ;)
Hardware:  FHEM-& LMS-Server + NAS: Banana Pi; Hyperion Ambilight Server + anderer Kleinkram: RPI Model B; Lampen: Philips Hue + Milight; Homematic Heizungssteuerung; Entertainment: Harmony Hub
sonstiges: Funksteckdosen

Reinhart

genau, einfach probieren dann sieht man am Besten was man braucht und wie man es lösen soll. Andre hat das ja sehr flexibel aufgebaut, so dass jeder seinen idealen Lösungsweg finden kann, die Anforderungen sind ja doch sehr unterschiedlich.

Ich habe nur einen Custom Skill und den nenne ich "Smarthome", den Rest mache ich in den Intents und der 99_MyUtils, aber das muss jeder für seinen Anwendungszweck selber ausloten wie es besser passt.

Es muss dann auch für die Fragestellung Sinn ergeben, sonst merkt man sich das nur schwer.

"Alexa frage Smarthome, wie ist der Status der Heizung", das passt, aber
"Alexa frage Wohnzimmer, wie ist der Status der Heizung" würde sich von der Fragestellung nur auf das Wohnzimmer beziehen und nicht auf den Allgemein Zustand der Heizungsanlage.

LG
FHEM auf Raspy4 mit Bullseye + SSD, Homematic, ESP8266, ESP32, Sonoff, eBus, NanoCUL, MapleCUL, , MQTT2, Alexa

oeiber

#2810
Hallo Leute,

auch auf die Gefahr hin, dass ich langsam lästig werde  :-[ , brennt mir immer noch die Performance von alexa fhem bei mir unter den Nägeln:
Nach einem gewissen Leerlauf, liegt die Antwortzeit von alexa bei ca. 5-7 Sekunden. Gerade am Morgen fällt mir das immer auf.
Ich habe auch schon versucht, gewisse Dinge auszuschließen: Reverse Proxy umgangen (direkter Zugriff auf alexa fhem), VM auf meinem Notebook anstelle eines Pi 3, usw. Allerdings komme ich auf keinen grünen Zweig.
Wenn ich mir das Log am Apache und von alexa fhem ansehe, kommt die Anfrage nach ca. 4-6 Sekunden (Lauflicht am Echo Dot) am Apache rein, und wird in der gleichen Sekunden noch von alexa fhem beantwortet. Ich bin der Meinung, dass der Flaschenhals nicht bei mir ist.
Wenn allerdings Amazon der Flaschenhals wäre, dann müsste ja bei Euch ein ähnliches Verhalten auftreten.
Ich habe auch schon dran gedacht, dass es ein DNS-Cache Problem bei Amazon sein könnte.
Als DynDNS-Ersatz verwende ich myFRITZ.

Danke schon mal für Eure Hilfe!

LG

Olli

cc13

Hallo,

seit gestern habe ich meinen Echo und möchte ihn mit dem vorhandenen FHEM verbinden.

Bis ./bin/alexa sieht auf den ersten Blick alles gut aus. Allerdings kommt bei folgendem Punkt eine lange Liste an Meldungen, die für mich als Laien nicht gut aussehen:


sudo chmod 755 /etc/init.d/alexa
sudo update-rc.d alexa defaults



xbian@xbian /etc/init.d $ sudo update-rc.d alexa defaults
initctl: Unknown job: K01nfs-common
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'K01nfs-common' missing LSB tags and overrides
initctl: Unknown job: K01nfs-common
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
initctl: Unknown job: S01dbus
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'S01dbus' missing LSB tags and overrides
initctl: Unknown job: S01dbus
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
initctl: Unknown job: S01dbus
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
initctl: Unknown job: S01dbus
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
initctl: Unknown job: K01nfs-common
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
initctl: Unknown job: S05nfs-common
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
initctl: Unknown job: S05mountnfs-bootclean.sh
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'S05mountnfs-bootclean.sh' missing LSB tags and overrides
initctl: Unknown job: S05checkroot-bootclean.sh
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'S05checkroot-bootclean.sh' missing LSB tags and overrides
initctl: Unknown job: S05udev-finish
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'S05udev-finish' missing LSB tags and overrides
initctl: Unknown job: nfs-common
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'nfs-common' missing LSB tags and overrides
initctl: Unknown job: bootmisc.sh
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'bootmisc.sh' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `bootmisc.sh'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `bootmisc.sh'
initctl: Unknown job: checkroot-bootclean.sh
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'checkroot-bootclean.sh' missing LSB tags and overrides
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `checkroot-bootclean.sh'
initctl: Unknown job: mountall-bootclean.sh
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'mountall-bootclean.sh' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `mountall-bootclean.sh'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `mountall-bootclean.sh'
initctl: Unknown job: mountall.sh
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'mountall.sh' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `mountall.sh'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `mountall.sh'
initctl: Unknown job: mountnfs-bootclean.sh
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'mountnfs-bootclean.sh' missing LSB tags and overrides
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `mountnfs-bootclean.sh'
initctl: Unknown job: mountnfs.sh
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'mountnfs.sh' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `mountnfs.sh'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `mountnfs.sh'
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'dbus' missing LSB tags and overrides
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `dbus'
initctl: Unknown job: mtab.sh
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'mtab.sh' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `mtab.sh'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `mtab.sh'
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'hostname.sh' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `hostname.sh'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `hostname.sh'
initctl: Unknown job: mountkernfs.sh
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'mountkernfs.sh' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `mountkernfs.sh'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `mountkernfs.sh'
initctl: Unknown job: mountdevsubfs.sh
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'mountdevsubfs.sh' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `mountdevsubfs.sh'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `mountdevsubfs.sh'
initctl: Unknown job: checkroot.sh
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'checkroot.sh' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `checkroot.sh'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `checkroot.sh'
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'avahi-daemon' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `avahi-daemon'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `avahi-daemon'
initctl: Unknown job: rmnologin
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'rmnologin' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `rmnologin'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `rmnologin'
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'cron' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `cron'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `cron'
initctl: Unknown job: ssh
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'ssh' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `ssh'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `ssh'
initctl: Unknown job: kmod
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'kmod' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `kmod'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `kmod'
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'lirc' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `lirc'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `lirc'
initctl: Unknown job: motd
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'motd' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `motd'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `motd'
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'openbsd-inetd' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `openbsd-inetd'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `openbsd-inetd'
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'procps' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `procps'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `procps'
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'udev' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `udev'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `udev'
initctl: Unknown job: udev-finish
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'udev-finish' missing LSB tags and overrides
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `udev-finish'
initctl: Unknown job: fake-hwclock
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'fake-hwclock' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `fake-hwclock'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `fake-hwclock'
initctl: Unknown job: udev-mtab
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'udev-mtab' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `udev-mtab'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `udev-mtab'
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'autofs' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `autofs'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `autofs'
initctl: Unknown job: urandom
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'urandom' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `urandom'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `urandom'


Zugegen, ich habe auf dem Raspberry die letzten Wochen einiges ausprobiert, vielleicht hat sich da irgendwas im System verdreht. Ist hier jemand, der mir da bitte weiterhelfen kann?

VG
CC13

amenomade

Das hat vermutlich nix mit alexa oder fhem zu tun. Welche Version von xbian hast Du? Was sagt "uname -r" in einem Terminal?
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

cc13


amenomade

Ja, das hat mit xbian / sysv und Upstart zu tun.

Anscheinend kannst Du das ignorieren: http://forum.xbian.org/thread-3866.html
alexa taucht nicht in dem langen Output, dann wurde wahrscheinlich doch das alexa Service eingerichtet.
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

cc13

#2815
Ok, dann habe ich jetzt mal weiter gemacht. Den SmartHome Skill und die Lambda Sachen habe ich bei Amazon eingerichtet. In meiner Alexa-App sehe ich auch das FHEM Skill.

Allerdings kommt beim Aufruf von


./bin/alexa


folgende Fehlermeldung und ich bin sicher, dass es dieser Auftrag die Tage schon einmal ohne Fehlermeldung lief:


[2017-07-14 10:00:12] using /opt/fhem/.alexa/config.json
[2017-07-14 10:00:12] ---
[2017-07-14 10:00:12] this is alexa-fhem 0.3.4
[2017-07-14 10:00:12] Fetching FHEM devices...
[2017-07-14 10:00:12] [FHEM] starting longpoll: http://127.0.0.1:8083/fhem?XHR=1&inform=type=status;addglobal=1;filter=.*;since=null;fmt=JSON&timestamp=1500019212384
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE 0.0.0.0:3000
    at Object.exports._errnoException (util.js:1022:11)
    at exports._exceptionWithHostPort (util.js:1045:20)
    at Server._listen2 (net.js:1259:14)
    at listen (net.js:1295:10)
    at Server.listen (net.js:1391:5)
    at Server.startServer (/opt/fhem/alexa-fhem/lib/server.js:125:15)
    at Server.run (/opt/fhem/alexa-fhem/lib/server.js:240:8)
    at module.exports (/opt/fhem/alexa-fhem/lib/cli.js:30:10)
    at Object.<anonymous> (/opt/fhem/alexa-fhem/bin/alexa:17:22)
    at Module._compile (module.js:570:32)


Probiert habe ich es einmal mit fest eingetragener Portfreigabe in meiner Fritzbox und einmal mit UPNP.

edit: Ich hatte den Alexa-Dienst mit /etc/init.d/alexa Start noch am laufen. Diesen beendet, startet auch das ./bin/alexa script. So mal weiterschauen.

cc13

Zitat von: cc13 am 14 Juli 2017, 10:08:29
Ok, dann habe ich jetzt mal weiter gemacht. Den SmartHome Skill und die Lambda Sachen habe ich bei Amazon eingerichtet. In meiner Alexa-App sehe ich auch das FHEM Skill.

Allerdings kommt beim Aufruf von


./bin/alexa


folgende Fehlermeldung und ich bin sicher, dass es dieser Auftrag die Tage schon einmal ohne Fehlermeldung lief:


[2017-07-14 10:00:12] using /opt/fhem/.alexa/config.json
[2017-07-14 10:00:12] ---
[2017-07-14 10:00:12] this is alexa-fhem 0.3.4
[2017-07-14 10:00:12] Fetching FHEM devices...
[2017-07-14 10:00:12] [FHEM] starting longpoll: http://127.0.0.1:8083/fhem?XHR=1&inform=type=status;addglobal=1;filter=.*;since=null;fmt=JSON&timestamp=1500019212384
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE 0.0.0.0:3000
    at Object.exports._errnoException (util.js:1022:11)
    at exports._exceptionWithHostPort (util.js:1045:20)
    at Server._listen2 (net.js:1259:14)
    at listen (net.js:1295:10)
    at Server.listen (net.js:1391:5)
    at Server.startServer (/opt/fhem/alexa-fhem/lib/server.js:125:15)
    at Server.run (/opt/fhem/alexa-fhem/lib/server.js:240:8)
    at module.exports (/opt/fhem/alexa-fhem/lib/cli.js:30:10)
    at Object.<anonymous> (/opt/fhem/alexa-fhem/bin/alexa:17:22)
    at Module._compile (module.js:570:32)


Probiert habe ich es einmal mit fest eingetragener Portfreigabe in meiner Fritzbox und einmal mit UPNP.

edit: Ich hatte den Alexa-Dienst mit /etc/init.d/alexa Start noch am laufen. Diesen beendet, startet auch das ./bin/alexa script. So mal weiterschauen.

Ok, es funktioniert. Ich kann die Wohnzimmerlampe per Alexa an/aus schalten.

Noch eine Frage: Bei dem FHEM.Alexa.DOIF erscheint nur "cmd_1" bzw. "cmd_2" und die Icon-Lampe beim Dummy leuchtet nur kurz auf und zeigt nicht dauerhaft, dass der Dienst läuft. Ist das normal und nur ein Schönheitsfehler?

SaschaMzH

Hi zusammen,

ich finde Alexa auch klasse aber ich will das auch irgendwie zum laufen bekommen.  ;)

Ich habe das Problem das anscheinend die Geräte in alexa-fhem gefunden werden und das der Zugriff auch funktioniert aber wenn ich in der App oder auf der Webseite nach Geräten suche findet er nur ein video device obwohl ich keins habe.

Hier mal das Log wenn ich Alexa-fhem starte und in der App auf Geräte suchen gehen:

pi@frigg:/opt/alexa-fhem $ bin/alexa
[7/14/2017, 4:04:47 PM] using /home/pi/.alexa/config.json
[7/14/2017, 4:04:47 PM] ---
[7/14/2017, 4:04:47 PM] this is alexa-fhem 0.3.5
[7/14/2017, 4:04:47 PM] Fetching FHEM devices...
[7/14/2017, 4:04:47 PM] [FHEM] starting longpoll: http://127.0.0.1:8083/fhem?XHR=1&inform=type=status;addglobal=1;filter=.*;since=null;fmt=JSON&timestamp=1500041087772
[7/14/2017, 4:04:47 PM] Server listening on: https://:::3000
[7/14/2017, 4:04:47 PM] [FHEM] Checking devices and attributes...
[7/14/2017, 4:04:47 PM] [FHEM]   executing: http://127.0.0.1:8083/fhem?cmd=%7BAttrVal(%22global%22,%22userattr%22,%22%22)%7D&XHR=1
[7/14/2017, 4:04:47 PM] [FHEM]   executing: http://127.0.0.1:8083/fhem?cmd=jsonlist2%20TYPE=alexa&XHR=1
[7/14/2017, 4:04:47 PM] [FHEM] Fetching FHEM devices...
[7/14/2017, 4:04:47 PM] [FHEM] fetching: http://127.0.0.1:8083/fhem?cmd=jsonlist2%20room=AlexaRoom&XHR=1
[7/14/2017, 4:04:47 PM] [FHEM] alexa device is AlexaDevice
[7/14/2017, 4:04:48 PM] [FHEM] AlexaDevice is switch
[7/14/2017, 4:04:48 PM] [FHEM] AlexaDevice has
[7/14/2017, 4:04:48 PM] [FHEM] homebridgeMapping: #Characteristic=<name>=<value>,...
On=verb=schalte,valueOn=an;ein,valueOff=aus,valueToggle=um

Brightness=verb=stelle,property=helligkeit,valuePrefix=auf,values=AMAZON.NUMBER,valueSuffix=prozent

Hue=verb=stelle,valuePrefix=auf,values=rot:0;grün:128;blau:200
Hue=verb=färbe,values=rot:0;grün:120;blau:220

Saturation=verb=stelle,property=sättigung,valuePrefix=auf,values=AMAZON.NUMBER
Saturation=verb=sättige,values=AMAZON.NUMBER

TargetPosition=verb=mach,articles=den;die,values=auf:100;zu:0
TargetPosition=verb=stelle,valuePrefix=auf,values=AMAZON.NUMBER,valueSuffix=prozent

TargetTemperature=verb=stelle,valuePrefix=auf,values=AMAZON.NUMBER,valueSuffix=grad

Volume:verb=stelle,valuePrefix=auf,values=AMAZON.NUMBER,valueSuffix=prozent

#Weckzeit=verb=stelle,valuePrefix=auf;für,values=AMAZON.TIME,valueSuffix=uhr
[7/14/2017, 4:04:48 PM] [FHEM]   executing: http://127.0.0.1:8083/fhem?cmd=%7B$defs%7BAlexaDevice%7D-%3E%7B%22active%22%7D%20=%201;;undef%7D;%7B$defs%7BAlexaDevice%7D-%3E%7B%22alexa-fhem%20version%22%7D%20=%20%220.3.5%22%7D;%7B$defs%7BAlexaDevice%7D-%3E%7B%22active%22%7D%20=%200;;undef%7D&XHR=1
[7/14/2017, 4:04:48 PM] perfectOfVerb:
[7/14/2017, 4:04:48 PM] { stelle: 'gestellt',
  schalte: 'geschaltet',
  'färbe': 'gefärbt',
  mach: 'gemacht' }
[7/14/2017, 4:04:48 PM] verbsOfIntent:
[7/14/2017, 4:04:48 PM] [ OnIntent: [ 'schalte' ],
  prozentIntent: [ 'stelle' ],
  HueIntent: [ 'stelle' ],
  HueIntentB: [ 'färbe' ],
  SaturationIntent: [ 'stelle' ],
  SaturationIntentB: [ 'sättige' ],
  TargetPositionIntent: [ 'mach' ],
  gradIntent: [ 'stelle' ] ]
[7/14/2017, 4:04:48 PM] characteristicsOfIntent:
[7/14/2017, 4:04:48 PM] { OnIntent: [ 'On' ],
  prozentIntent: [ 'Brightness', 'TargetPosition', 'Volume' ],
  HueIntent: [ 'Hue' ],
  HueIntentB: [ 'Hue' ],
  SaturationIntent: [ 'Saturation' ],
  SaturationIntentB: [ 'Saturation' ],
  TargetPositionIntent: [ 'TargetPosition' ],
  gradIntent: [ 'TargetTemperature' ] }
[7/14/2017, 4:04:48 PM] prefixOfIntent:
[7/14/2017, 4:04:48 PM] { OnIntent: undefined,
  prozentIntent: 'auf',
  HueIntent: 'auf',
  HueIntentB: undefined,
  SaturationIntent: 'auf',
  SaturationIntentB: undefined,
  TargetPositionIntent: undefined,
  gradIntent: 'auf' }
[7/14/2017, 4:04:48 PM] suffixOfIntent:
[7/14/2017, 4:04:48 PM] { OnIntent: undefined,
  prozentIntent: 'prozent',
  HueIntent: undefined,
  HueIntentB: undefined,
  SaturationIntent: undefined,
  SaturationIntentB: undefined,
  TargetPositionIntent: undefined,
  gradIntent: 'grad' }
[7/14/2017, 4:04:48 PM] alexaTypes:
[7/14/2017, 4:04:48 PM] { light: [ 'licht', 'lampen' ],
  blind:
   [ 'rolladen',
     'rolläden',
     'jalousie',
     'jalousien',
     'rollo',
     'rollos' ] }
[7/14/2017, 4:04:48 PM] roomOfEcho:
[7/14/2017, 4:04:48 PM] {}
[7/14/2017, 4:04:48 PM] fhemIntents:
[7/14/2017, 4:04:48 PM] { FHEMgutenMorgenIntent: 'gutenMorgen',
  FHEMguteNachtIntent: 'guteNacht' }
[7/14/2017, 4:04:48 PM] [FHEM] got: 1 results
[7/14/2017, 4:04:48 PM] [FHEM] Alexa_Fernsehen is switch
[7/14/2017, 4:04:48 PM] [FHEM] Alexa_Fernsehen has
[7/14/2017, 4:04:48 PM] [FHEM]   On [state;on,off]
[7/14/2017, 4:04:48 PM] [FHEM] { reading: 'state',
  valueOff: '/off|A0|000000/',
  cmdOn: 'on',
  cmdOff: 'off',
  device: 'Alexa_Fernsehen',
  informId: 'Alexa_Fernsehen-state',
  characteristic_type: 'On',
  log:
   { [Function: bound ]
     debug: [Function],
     info: [Function],
     warn: [Function],
     error: [Function],
     log: [Function],
     prefix: 'FHEM' } }
  2017-07-14 16:04:48 caching: Alexa_Fernsehen-state: off
[7/14/2017, 4:04:57 PM] accepted new token
**** Received Directive: {"directive":{"header":{"namespace":"Alexa.Discovery","name":"Discover","payloadVersion":"3","messageId":"81092a78-8239-4b7a-82eb-9edf1b30d9f6"},"payload":{"scope":{"type":"BearerToken","token":"Atza|IwEBIJWaY7E6HeZ_BKy9qYmu4AdlCdfOvnmVXzKAZzEuxk2cb3RQBLpFOGDf8e4rmyBVRdAYzTnE0NOIrnIVVZ-gYwx1iZp8WAf0ecvNAq7MpXnBzDaJcT-fwODWePHtUtZj-1KXL34KFII5NoNA6y16nVv7aoM0M_LpNHv1anos0YNQKxDbWMl-TIMcok-aUIxRbCm821e86-a8LZyf2G1S8b4Bmh_OcN-r9b0F_Y6cyBlX6a0c6YKRcWXF8NQtv-1slJeOs8dSSjvWsJ6v5J_ghUBJRtJ48nauC2rbat-Lsm5NKcEPYbLmWejSTOGCv77sfhqUGP68E4Q-JQqXhqGq1kN2p0SiOmWJnCjB59EKfUDM3XiD-lzrhHNyDt_HXE2wtg1wUbfdwOfwrMmU10VMwsC466znrWsWmO1U_lDqRfepAueqy-1gMlqFWN2M4gQmLGUhu3BV6i5rwgMa3R7v2sor6rNy2ccPPq8v6uhJNQJAHzTLk7DD0fyCUtDXzL-bO-s"}}}}
response :{"event":{"header":{"name":"Discover.Response","payloadVersion":3,"namespace":"Alexa.Discovery","messageId":"3484c546-6008-4385-a14e-2fd5cdc7bb70"},"payload":{"endpoints":[{"capabilities":[{"interface":"Alexa.RemoteVideoPlayer","type":"AlexaInterface","version":"1.0"},{"interface":"Alexa.ChannelController","type":"AlexaInterface","version":"1.0"},{"interface":"Alexa.PlaybackController ","type":"AlexaInterface","version":"1.0"}],"endpointId":"videoDevice-001","description":"Device description for the customer","displayCategories":[],"friendlyName":"video","manufacturerName":"Amazon","cookie":{}}]}}}


Ich nutze die aktuellste Version von Alexa-fhem, Raspi node hat version v6.11.1

Bestimmt habt ihr eine Idee was ich noch probieren kann.

Vielen Dank

Thyrador

#2818
Hallo justme1968, vorab erstmal vielen Dank für dieses Plugin.

Im Moment bin ich noch drüber, mich an die vielen Möglichkeiten zu gewöhnen. Darüber hinaus habe ich schon konkrete Vorstellungen von Dingen, die über die Sprache gesteuert werden sollen.
Da merkt man natürlich schnell, dass der Standard-Homeautomation Skill von Alexa beiweitem nicht reicht.

Und zwar musste ich das feststellen, als ich meinen AV-Receiver dazu bewegen wollte, die Lautstärke zu ändern => ging natürlich nicht.
Also schnell einen Custom Skill angelegt und stelle fest: es will noch immer nicht. Aber bevor ich hier endlos weiterquassel, mal kurz ein paar snippets, um das ganze zu veranschaulichen:

Intent Schema:
[...]
    {
      "slots": [
        {
          "name": "article",
          "type": "FHEM_article"
        },
        {
          "name": "Device",
          "type": "FHEM_Device"
        },
        {
          "name": "preposition",
          "type": "FHEM_preposition"
        },
        {
          "name": "Room",
          "type": "FHEM_Room"
        },
        {
          "name": "prozent_Value",
          "type": "AMAZON.NUMBER"
        }
      ],
      "intent": "VolumeIntent"
    },
[...]


Sample Utterances:
[...]
VolumeIntent stelle lautstärke {Device} auf {prozent_Value}
VolumeIntent stelle lautstärke {Device} {preposition} {Room} auf {prozent_Value}
VolumeIntent stelle lautstärke {article} {Device} auf {prozent_Value}
VolumeIntent stelle lautstärke {article} {Device} {preposition} {Room} auf {prozent_Value}
[...]


homebridgeMapping:
Volume=state,cmd=volume

alexaMapping:
[...]
Volume=verb=stelle,property=lautstärke,valuePrefix=auf,values=AMAZON.NUMBER


Das ganze soll dann am Ende folgenden Befehl simulieren:
set DenonAVRX3300WBKE2 volume <WERT>

Leider bekomme ich als Rückgabe, im Service Simulator, immer nur:
{
  "version": "1.0",
  "response": {
    "outputSpeech": {
      "type": "PlainText",
      "text": "Ich habe Ich kann receiver nicht auf undefined schalten. auf undefined gestellt"
    },
    "card": {
      "content": "Ich kann receiver nicht auf undefined schalten. auf undefined gestellt",
      "title": "VolumeIntent",
      "type": "Simple"
    },
    "speechletResponse": {
      "outputSpeech": {
        "text": "Ich habe Ich kann receiver nicht auf undefined schalten. auf undefined gestellt"
      },
      "card": {
        "title": "VolumeIntent",
        "content": "Ich kann receiver nicht auf undefined schalten. auf undefined gestellt"
      },
      "shouldEndSession": true
    }
  },
  "sessionAttributes": {}
}


Interessanter wird es natürlich, wenn ich ich dem Echo das als Befehl mitgebe:
alexa sage fhem stelle lautstärke receiver auf 20

Dann kommt als Antwort: Du kannst die Lautstärke leider nur zwischen 0 und 10 einstellen.

Ne Ahnung was ich hier alles falsch mache? Ich blicke es noch nicht so ganz.
Was mich auch wundert, ist, dass ich mit dem Custom Skill leider keine Geräte in Alexa zu sehen bekomme. Bei der Abfrage wird auch nichts an das Modul geschickt um die Geräteliste zu übermitteln.
Mit dem Standard Skill hat das jedoch funktioniert.

Als Anleitung dafür hatte ich folgenden Blog verwendet: https://haus-automatisierung.com/hardware/fhem/2017/01/21/fhem-tutorial-reihe-part-24-amazon-echo-alexa-fhem-custom-skill.html


EDIT: Mittlerweile schaffe ich es, dass nicht mehr nur undefined als Wert mitkommt. Trotzdem bleibt die Meldung dieselbe, nur statt undefined eben der Wert, der mitgeliefert werden soll. Die Einstellung am AV Receiver setzt er dennoch nicht.
Ziel soll ja sein, auch die Quellen per Sprache umzustellen: "Alexe, sage FHEM stelle Quelle am Heimkino auf Musik"

jneroes

Hi,
Ich hab gesehen, dass man in der alexa App im Bereich Smart Home auch Szenen anlegen könnte. Klappt das bei euch oder was muss man tun um das zu verwenden.

Danke und Gruß

Sören