Google Assistant - GenShellSwitch - Gerät wird nicht angezeigt

Begonnen von RUDI-TERROR, 25 Januar 2020, 11:24:16

Vorheriges Thema - Nächstes Thema

RUDI-TERROR

Hallo zusammen,

ich bin vor kurzem auf die Information gestosen, dass es nun auch eine Schnittstelle zwischen Google Assistant und FHEM gibt, großartig!

https://wiki.fhem.de/wiki/Google_Assistant_FHEM_Connect

Ich habe Fhem Connect auf meinem Raspi installiert und erfolgreich mit dem Google Assistant verbunden (siehe Anhang).

Zum Testen wollte ich meine IP-Kamera, die ich über 433MHz ein- und ausschalten kann im GoogleAssistant einbinden:

### IP Camera###
define Kamera GenShellSwitch /opt/fhem/rcswitch-pi/send 10111 2 1 0
setuuid Kamera ####
attr Kamera group Geräte
attr Kamera room 01_Wohnzimmer,GoogleAssistant

Wenn ich den GoogleAssitant Connector neu starte, dann kann ich auch im Log sehen, dass der Kamera State ausgelesen wird: update reading: Kamera:state = on

Allerdings besteht nun das Problem, dass ich das neue Gerät im Google Home nicht finden kann (auch nicht über die Option, neue Geräte hinzuzufügen. Könnt Ihr mir auf die Sprünge helfen, ob ich meine Konfiguration für das Kamera-Objekt ergänzen muss, damit ich das Gerät im Google finden kann?

Vielen Dank für eure Unterstützung!

Rudi

Auszug aus dem LOG, nachdem der FHEM Connector neu gestartet wurde:
[25.1.2020, 10:58:08] reportstateall initiated
Loading cli.js...
Loading version.js...
Loading server.js...
Loading user.js...
Loading logger.js...
Loading fhem.js...
Loading database.js...
Loading localserver.js...
Loading localhandleEXECUTE.js...
[25.1.2020, 11:18:34] using ./gassistant-fhem.cfg
[25.1.2020, 11:18:34] ---
[25.1.2020, 11:18:34] config:
{"gassistant":{"description":"FHEM Connect"},"connections":[{"server":"127.0.0.1","port":"8083","filter":"room=GoogleAssistant","webname":"fhem","name":"FHEM"}]}

[25.1.2020, 11:18:34] ---
[25.1.2020, 11:18:34] Google Assistant FHEM Connect 2.3.0 started
[25.1.2020, 11:18:34] Fetching FHEM connections...
[25.1.2020, 11:18:34] [FHEM] starting longpoll: http://127.0.0.1:8083/fhem?XHR=1&inform=type=status;addglobal=1;filter=.*;since=null;fmt=JSON&timestamp=1579947514352
[25.1.2020, 11:18:35] [FHEM]   executing: http://127.0.0.1:8083/fhem?cmd=jsonlist2%20TYPE%3Dgassistant&fwcsrf=csrf_104679228366746&XHR=1
[25.1.2020, 11:18:35] [FHEM] FHEM Google Assistant device detected: gassistant
[25.1.2020, 11:18:35] [FHEM]   executing: http://127.0.0.1:8083/fhem?cmd=setreading%20gassistant%20gassistant-fhem-version%202.3.0&fwcsrf=csrf_104679228366746&XHR=1
[25.1.2020, 11:18:35] [FHEM]   executing: http://127.0.0.1:8083/fhem?cmd=setreading%20gassistant%20gassistant-fhem-lastServerError%20none&fwcsrf=csrf_104679228366746&XHR=1
[25.1.2020, 11:18:35] [FHEM]   executing: http://127.0.0.1:8083/fhem?cmd=set%20gassistant%20loginURL%20https%3A%2F%2Ffhemconnector.eu.auth0.com%2Fauthorize%3Faudience%3Dhttps%3A%2F%2Feurope-west1-fhem-ga-connector.cloudfunctions.net%2F%26scope%3Doffline_access%2520openid%2520profile%26response_type%3Dcode%26client_id%3DEI0TI2Y0W1743Ico53Nvsg1FsmoZniCC%26code_challenge%3DD_OWWRqT2tZc3ArfYA04RKAkl1uoQ61TVEMDeSUcNuk%26code_challenge_method%3DS256%26redirect_uri%3Dhttps%3A%2F%2Feurope-west1-fhem-ga-connector.cloudfunctions.net%2Fcodelanding%2Fstart&fwcsrf=csrf_104679228366746&XHR=1
[25.1.2020, 11:18:35] [FHEM] Get refresh token...
[25.1.2020, 11:18:35] [FHEM]   executing: http://127.0.0.1:8083/fhem?cmd=get%20gassistant%20refreshToken&fwcsrf=csrf_104679228366746&XHR=1
[25.1.2020, 11:18:35] [FHEM]   executing: http://127.0.0.1:8083/fhem?cmd=setreading%20gassistant%20gassistant-fhem-connection%20connecting...&fwcsrf=csrf_104679228366746&XHR=1
[25.1.2020, 11:18:35] [FHEM] Found refresh token in reading
[25.1.2020, 11:18:35] [FHEM]   executing: http://127.0.0.1:8083/fhem?cmd=setreading%20gassistant%20gassistant-fhem-versionAvailable%202.3.0&fwcsrf=csrf_104679228366746&XHR=1
[25.1.2020, 11:18:37] Refresh tokens finished. Next refresh in 86400 seconds.
[25.1.2020, 11:18:37] [FHEM] refreshAllTokens executed
[25.1.2020, 11:18:38] Start Connection and listen for Firebase
[25.1.2020, 11:18:39] [FHEM] Fetching FHEM devices...
[25.1.2020, 11:18:39] [FHEM] fetching: http://127.0.0.1:8083/fhem?cmd=jsonlist2%20room=GoogleAssistant&fwcsrf=csrf_104679228366746&XHR=1
[25.1.2020, 11:18:39] [FHEM]   executing: http://127.0.0.1:8083/fhem?cmd=setreading%20gassistant%20gassistant-fhem-lasterror%20none&fwcsrf=csrf_104679228366746&XHR=1
[25.1.2020, 11:18:39] [FHEM] Checking devices and attributes...
[25.1.2020, 11:18:39] [FHEM]   executing: http://127.0.0.1:8083/fhem?cmd=%7BAttrVal(%22global%22%2C%22userattr%22%2C%22%22)%7D&fwcsrf=csrf_104679228366746&XHR=1
[25.1.2020, 11:18:39] [FHEM] Connection: OK
[25.1.2020, 11:18:39] [FHEM]   executing: http://127.0.0.1:8083/fhem?cmd=%7B%20addToAttrList(%20%22homebridgeMapping%3AtextField-long%22%20)%20%7D&fwcsrf=csrf_104679228366746&XHR=1
[25.1.2020, 11:18:39] [FHEM] homebridgeMapping attribute created.
[25.1.2020, 11:18:39] [FHEM]   executing: http://127.0.0.1:8083/fhem?cmd=%7B%20addToAttrList(%20%22realRoom%3AtextField%22%20)%20%7D&fwcsrf=csrf_104679228366746&XHR=1
[25.1.2020, 11:18:39] [FHEM] realRoom attribute created.
[25.1.2020, 11:18:39] [FHEM]   executing: http://127.0.0.1:8083/fhem?cmd=%7B%20addToAttrList(%20%22gassistantName%3AtextField%22%20)%20%7D&fwcsrf=csrf_104679228366746&XHR=1
[25.1.2020, 11:18:39] [FHEM] gassistantName attribute created.
[25.1.2020, 11:18:39] [FHEM]   executing: http://127.0.0.1:8083/fhem?cmd=%7B%20addToAttrList(%20%22assistantName%3AtextField%22%20)%20%7D&fwcsrf=csrf_104679228366746&XHR=1
[25.1.2020, 11:18:39] [FHEM] assistantName attribute created.
[25.1.2020, 11:18:39] [FHEM] got: 4 results
[25.1.2020, 11:18:40] [FHEM] Supported Google Device Types: ac_unit,aircondition,airfreshener,airpurifier,awning,bathtub,bed,blender,blinds,boiler,camera,closet,coffee_maker,coffeemaker,cooktop,curtain,dehumidifier,dehydrator,dishwasher,door,drawer,dryer,fan,faucet,fireplace,fryer,garage,gate,grill,heater,hood,humidifier,kettle,light,lock,mop,mower,microwave,multicooker,outlet,oven,pergola,petfeeder,pressurecooker,radiator,refrigerator,scene,securitysystem,shutter,shower,sousvide,sprinkler,standmixer,switch,thermostat,vacuum,valve,washer,waterheater,window,yogurtmaker
[25.1.2020, 11:18:40] [FHEM]   executing: http://127.0.0.1:8083/fhem?cmd=%7BaddToAttrList(%20%22genericDeviceType%3Aac_unit%2Caircondition%2Cairfreshener%2Cairpurifier%2Cawning%2Cbathtub%2Cbed%2Cblender%2Cblinds%2Cboiler%2Ccamera%2Ccloset%2Ccoffee_maker%2Ccoffeemaker%2Ccooktop%2Ccurtain%2Cdehumidifier%2Cdehydrator%2Cdishwasher%2Cdoor%2Cdrawer%2Cdryer%2Cfan%2Cfaucet%2Cfireplace%2Cfryer%2Cgarage%2Cgate%2Cgrill%2Cheater%2Chood%2Chumidifier%2Ckettle%2Clight%2Clock%2Cmop%2Cmower%2Cmicrowave%2Cmulticooker%2Coutlet%2Coven%2Cpergola%2Cpetfeeder%2Cpressurecooker%2Cradiator%2Crefrigerator%2Cscene%2Csecuritysystem%2Cshutter%2Cshower%2Csousvide%2Csprinkler%2Cstandmixer%2Cswitch%2Cthermostat%2Cvacuum%2Cvalve%2Cwasher%2Cwaterheater%2Cwindow%2Cyogurtmaker%22)%20%7D&fwcsrf=csrf_104679228366746&XHR=1
[25.1.2020, 11:18:40] [FHEM]   executing: http://127.0.0.1:8083/fhem?cmd=setreading%20gassistant%20gassistant-fhem-connection%20connected&fwcsrf=csrf_104679228366746&XHR=1
[25.1.2020, 11:18:40] SERVER FeatureLevel:{"featurelevel":3,"changelog":"performance optimizations"}
[25.1.2020, 11:18:40] SYNC   FeatureLevel:{"featurelevel":3}
[25.1.2020, 11:18:40] [FHEM] update reading: GoogleAssistant_dummy:state = off
[25.1.2020, 11:18:40] [FHEM] update reading: Kamera:state = on



dominik

Gibt es zu dem GenShellSwitch irgendwo eine Dokumentation? Ich kann das Modul nicht finden. Es duerfte kein on/off haben, du kannst das Problem wahrscheinlich einfach mit
attr Kamera setList on off
beheben. Danach reload machen.

Poste bitte dennoch die Info woher das Modul ist, wenn es naemlich normal immer on/off unterstuetzt, kann ich das gleich im Code mit aufnehmen.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

RUDI-TERROR

Hi,
vielen Dank! Du hast mich mit deinem Hinweis auf den richtigen Weg gebracht. Ich habe nun meine Config umgebaut und nun werden die Geräte wie gewünscht im Google Home erkannt.

define Kamera dummy
attr Kamera setList on off
attr Kamera room 01_Wohnzimmer,GoogleAssistant
define off_Kamera notify Kamera:off {system("/opt/fhem/rcswitch-pi/send 10111 2 0 &")}
define on_Kamera notify Kamera:on {system("/opt/fhem/rcswitch-pi/send 10111 2 1 &")}

DeeSPe

Ich hatte mal eine neuere und verbesserte Version von GenShellSwitch gebaut. Das ganze nennt sich nur noch ShellSwitch und sollte hierfür gut einzusetzen sein.
Damit brauchst Du nur das ShellSwitch Device und keine extra notify.

Gruß
Dan
MAINTAINER: 22_HOMEMODE, 98_Hyperion, 98_FileLogConvert, 98_serviced

Als kleine Unterstützung für meine Programmierungen könnt ihr mir gerne einen Kaffee spendieren: https://buymeacoff.ee/DeeSPe