Alexa und Tradfri

Begonnen von OliWee, 26 November 2017, 15:35:16

Vorheriges Thema - Nächstes Thema

OliWee

Hi!
Ich bekomme es irgendwie nicht hin,die Lichfarbe meiner Tradfri-Lampe über Alexa zu verändern.
Wenn ich sage "Alexa, stelle Testlampe wärmer / kälter" bekomme ich die Antwort "Testlampe unterstützt das nicht".

Ich werfe mal das Stichwort "Homebridge-Mapping" in den Raum, über das das vermutlich geht. Aber irgendwie erschließt sich mir nicht, was ich da eintragen muss...
Kann mich mal bitte jemand in die richtige Richtung schubsen? Danke :)

defmod Testlampe TradfriDevice 65540
attr Testlampe alexaName Testlampe
attr Testlampe genericDeviceType light
attr Testlampe room 92_Tradfri,Alexa

setstate Testlampe dim80%
setstate Testlampe 2017-11-26 15:00:52 color f1e0b5
setstate Testlampe 2017-11-26 14:59:59 createdAt Sun, 26 Nov 2017 13:55:13 GMT
setstate Testlampe 2017-11-26 14:59:59 dimvalue 203
setstate Testlampe 2017-11-26 15:06:09 lastSeen Sun, 26 Nov 2017 14:06:09 GMT
setstate Testlampe 2017-11-26 14:59:59 manufacturer IKEA of Sweden
setstate Testlampe 2017-11-26 14:59:59 name TRADFRI bulb E27 WS opal 980lm
setstate Testlampe 2017-11-26 14:59:59 onoff on
setstate Testlampe 2017-11-26 14:59:59 pct 80
setstate Testlampe 2017-11-26 14:59:59 reachableState 1
setstate Testlampe 2017-11-26 14:59:59 softwareVersion 1.2.217
setstate Testlampe 2017-11-26 14:59:59 state dim80%
setstate Testlampe 2017-11-26 14:59:59 type TRADFRI bulb E27 WS opal 980lm

OliWee

Hmm...  ???
Bin ich der einzige, der die Kombination Alexa und Tradfri einsetzt?

Stoffel84

Hab seit gestern meine erste Lampe, warte aber noch auf die Gateway Lieferung - im lokalen Ikea waren alle vergriffen.
Dann können wir gemeinsam forschen ;)

justme1968

das setzen der farbtemperatur muss über ein eigenes kommando gehen. nicht über rgb damit das halbwegs automatisch in homekit oder alexa eingebunden werden kann.
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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

OliWee

Was meinst du mit eigenem Kommando? Über den Alexa Custom Skill? Ich wollte es eigentlich über den Smart Home Skill machen, weil mich dieses "sage XYZ" stört

justme1968

FHEM kommando. dein device hat ja noch nicht mal readings für die farbtemperatur.
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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

OliWee

Zitat von: justme1968 am 30 Dezember 2017, 22:35:36
FHEM kommando. dein device hat ja noch nicht mal readings für die farbtemperatur.

Doch, das geht über color bei Tradfri.

justme1968

zeig mal ein jsonlist2 vom
device.

und die ausgabe vom alexa-fhem beim starten
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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

OliWee

Zitat von: justme1968 am 30 Dezember 2017, 23:32:47
zeig mal ein jsonlist2 vom
device.
{
  "Arg":"Buero.Licht",
  "Results": [
  {
    "Name":"Buero.Licht",
    "PossibleSets":"on off pct:colorpicker,BRI,0,1,100 dimvalue:slider,0,1,254 color:warm,cold,standard intervals off-till-overnight off-till on-till blink toggle on-till-overnight on-for-timer off-for-timer",
    "PossibleAttrs":"alias comment:textField-long eventMap group room suppressReading userReadings:textField-long verbose:0,1,2,3,4,5 usePercentDimming:1,0 event-on-change-reading event-on-update-reading event-aggregator event-min-interval stateFormat:textField-long timestamp-on-change-reading alexaName alexaRoom cmdIcon devStateIcon devStateStyle genericDeviceType:security,ignore,switch,outlet,light,blind,thermometer,thermostat,contact,garage,window,lock homebridgeMapping:textField-long icon mqttName mqttRoom sortby webCmd webCmdLabel:textField-long widgetOverride userattr",
    "Internals": {
      "DEF": "65540",
      "LASTInputDev": "TradfriGW",
      "MSGCNT": "106",
      "NAME": "Buero.Licht",
      "NR": "109",
      "STATE": "on",
      "TYPE": "TradfriDevice",
      "TradfriGW_MSGCNT": "106",
      "TradfriGW_TIME": "2017-12-31 09:31:28",
      "address": "65540",
      "name": "Buero.Licht"
    },
    "Readings": {
      "color": { "Value":"f5faf6", "Time":"2017-12-29 16:02:20" },
      "createdAt": { "Value":"Sun, 26 Nov 2017 13:55:13 GMT", "Time":"2017-11-26 14:59:59" },
      "dimvalue": { "Value":"254", "Time":"2017-12-07 17:49:58" },
      "lastSeen": { "Value":"Sun, 31 Dec 2017 08:33:41 GMT", "Time":"2017-12-31 09:31:28" },
      "manufacturer": { "Value":"IKEA of Sweden", "Time":"2017-11-26 14:59:59" },
      "name": { "Value":"TRADFRI bulb E27 WS opal 980lm", "Time":"2017-11-26 14:59:59" },
      "onoff": { "Value":"on", "Time":"2017-12-31 09:31:04" },
      "pct": { "Value":"100", "Time":"2017-12-31 09:31:04" },
      "reachableState": { "Value":"1", "Time":"2017-12-31 09:31:25" },
      "softwareVersion": { "Value":"1.2.217", "Time":"2017-11-26 14:59:59" },
      "state": { "Value":"on", "Time":"2017-12-31 09:31:04" },
      "type": { "Value":"TRADFRI bulb E27 WS opal 980lm", "Time":"2017-11-26 14:59:59" }
    },
    "Attributes": {
      "alexaName": "Bürolicht",
      "genericDeviceType": "light",
      "room": "23_Büro,92_Tradfri,Alexa"
    }
  }  ],
  "totalResultsReturned":1
}


Zitat von: justme1968 am 30 Dezember 2017, 23:32:47
und die ausgabe vom alexa-fhem beim starten
[2017-12-31 09:41:56] using /home/alexa/.alexa/config.json
[2017-12-31 09:41:56] ---
[2017-12-31 09:41:56] this is alexa-fhem 0.3.4
[2017-12-31 09:41:56] Trying NAT-PMP ...
[2017-12-31 09:41:56] Fetching FHEM devices...
[2017-12-31 09:41:56] [FHEM] starting longpoll: http://192.168.0.24:8083/fhem?XHR=1&inform=type=status;addglobal=1;filter=.*;since=null;fmt=JSON&timestamp=1514709716495
[2017-12-31 09:41:56] Server listening on: https://:::3000
[2017-12-31 09:41:56] [FHEM] Checking devices and attributes...
[2017-12-31 09:41:56] [FHEM]   executing: http://192.168.0.24:8083/fhem?cmd=%7BAttrVal(%22global%22,%22userattr%22,%22%22)%7D&fwcsrf=csrf_107919691844803&XHR=1
[2017-12-31 09:41:56] [FHEM]   executing: http://192.168.0.24:8083/fhem?cmd=jsonlist2%20TYPE=alexa&fwcsrf=csrf_107919691844803&XHR=1
[2017-12-31 09:41:56] [FHEM] Fetching FHEM devices...
[2017-12-31 09:41:56] [FHEM] fetching: http://192.168.0.24:8083/fhem?cmd=jsonlist2%20room=Alexa&fwcsrf=csrf_107919691844803&XHR=1
[2017-12-31 09:41:56] [FHEM] alexa device is MyAlexa
[2017-12-31 09:41:56] [FHEM] MyAlexa is switch
[2017-12-31 09:41:56] [FHEM] MyAlexa has
[2017-12-31 09:41:56] [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
[2017-12-31 09:41:56] [FHEM]   executing: http://192.168.0.24:8083/fhem?cmd=%7B$defs%7BMyAlexa%7D-%3E%7B%22active%22%7D%20=%201%7D&fwcsrf=csrf_107919691844803&XHR=1
[2017-12-31 09:41:56] [FHEM]   executing: http://192.168.0.24:8083/fhem?cmd=%7B$defs%7BMyAlexa%7D-%3E%7B%22alexa-fhem%20version%22%7D%20=%20%220.3.4%22%7D&fwcsrf=csrf_107919691844803&XHR=1
[2017-12-31 09:41:56] [FHEM]   executing: http://192.168.0.24:8083/fhem?cmd=%7B$defs%7BMyAlexa%7D-%3E%7B%22active%22%7D%20=%200%7D&fwcsrf=csrf_107919691844803&XHR=1
[2017-12-31 09:41:56] perfectOfVerb:
[2017-12-31 09:41:56] { stelle: 'gestellt',
  schalte: 'geschaltet',
  'färbe': 'gefärbt',
  mach: 'gemacht' }
[2017-12-31 09:41:56] verbsOfIntent:
[2017-12-31 09:41:56] [ OnIntent: [ 'schalte' ],
  prozentIntent: [ 'stelle' ],
  HueIntent: [ 'stelle' ],
  HueIntentB: [ 'färbe' ],
  SaturationIntent: [ 'stelle' ],
  SaturationIntentB: [ 'sättige' ],
  TargetPositionIntent: [ 'mach' ],
  gradIntent: [ 'stelle' ] ]
[2017-12-31 09:41:56] characteristicsOfIntent:
[2017-12-31 09:41:56] { OnIntent: [ 'On' ],
  prozentIntent: [ 'Brightness', 'TargetPosition', 'Volume' ],
  HueIntent: [ 'Hue' ],
  HueIntentB: [ 'Hue' ],
  SaturationIntent: [ 'Saturation' ],
  SaturationIntentB: [ 'Saturation' ],
  TargetPositionIntent: [ 'TargetPosition' ],
  gradIntent: [ 'TargetTemperature' ] }
[2017-12-31 09:41:56] prefixOfIntent:
[2017-12-31 09:41:56] { OnIntent: undefined,
  prozentIntent: 'auf',
  HueIntent: 'auf',
  HueIntentB: undefined,
  SaturationIntent: 'auf',
  SaturationIntentB: undefined,
  TargetPositionIntent: undefined,
  gradIntent: 'auf' }
[2017-12-31 09:41:56] suffixOfIntent:
[2017-12-31 09:41:56] { OnIntent: undefined,
  prozentIntent: 'prozent',
  HueIntent: undefined,
  HueIntentB: undefined,
  SaturationIntent: undefined,
  SaturationIntentB: undefined,
  TargetPositionIntent: undefined,
  gradIntent: 'grad' }
[2017-12-31 09:41:56] alexaTypes:
[2017-12-31 09:41:56] { light: [ 'licht', 'lampen' ],
  blind:
   [ 'rolladen',
     'rolläden',
     'jalousie',
     'jalousien',
     'rollo',
     'rollos' ] }
[2017-12-31 09:41:56] roomOfEcho:
[2017-12-31 09:41:56] { 'amzn1.ask.device.AGRDI3ZP4XULCKUUMWTG4APPWC6IX5KHMEJBTTBPEWJD3WNDFX5DRUPOD6AJI3O3SC4CKTTBDGOP3CIPFVUQXVZPR44ZOPMS27ESKVN3VQTK6U6KFCJXX4NX6OKEKY2Y5CDCE2XORFFVA4WGBHJDSJEKO2UA': 'küche' }
[2017-12-31 09:41:56] fhemIntents:
[2017-12-31 09:41:56] { FHEMgutenMorgenIntent: 'gutenMorgen',
  FHEMguteNachtIntent: 'guteNacht',
  FHEMperlCodeIntent: '{esGibtEssen($zeit)}' }
[2017-12-31 09:41:56] [FHEM] got: 8 results
[2017-12-31 09:41:56] [FHEM] Buero.Licht is light
[2017-12-31 09:41:56] [FHEM] Buero.Licht has
[2017-12-31 09:41:56] [FHEM]   On [pct;on,off]
[2017-12-31 09:41:56] [FHEM]   Brightness [pct]
[2017-12-31 09:41:56] [FHEM] { reading: 'pct',
  valueOff: '0',
  cmdOn: 'on',
  cmdOff: 'off',
  device: 'Buero.Licht',
  informId: 'Buero.Licht-pct',
  characteristic_type: 'On',
  log:
   { [Function: bound ]
     debug: [Function],
     info: [Function],
     warn: [Function],
     error: [Function],
     log: [Function],
     prefix: 'FHEM' } }
  2017-12-31 09:41:56 caching: Buero.Licht-pct: 100
[2017-12-31 09:41:56] [FHEM] { reading: 'pct',
  cmd: 'pct',
  delay: true,
  device: 'Buero.Licht',
  informId: 'Buero.Licht-pct',
  characteristic_type: 'Brightness',
  log:
   { [Function: bound ]
     debug: [Function],
     info: [Function],
     warn: [Function],
     error: [Function],
     log: [Function],
     prefix: 'FHEM' } }
[2017-12-31 09:41:56] [FHEM] EG.Wohnzimmer.Radio is switch
[2017-12-31 09:41:56] [FHEM] EG.Wohnzimmer.Radio has
[2017-12-31 09:41:56] [FHEM]   On [state;on,off]
[2017-12-31 09:41:56] [FHEM] { reading: 'state',
  valueOff: '/off|A0|000000/',
  cmdOn: 'on',
  cmdOff: 'off',
  device: 'EG.Wohnzimmer.Radio',
  informId: 'EG.Wohnzimmer.Radio-state',
  characteristic_type: 'On',
  log:
   { [Function: bound ]
     debug: [Function],
     info: [Function],
     warn: [Function],
     error: [Function],
     log: [Function],
     prefix: 'FHEM' } }
  2017-12-31 09:41:56 caching: EG.Wohnzimmer.Radio-state: on
[2017-12-31 09:41:56] [FHEM] Kueche.Licht.Nacht is switch
[2017-12-31 09:41:56] [FHEM] Kueche.Licht.Nacht has
[2017-12-31 09:41:56] [FHEM]   On [state;on,off]
[2017-12-31 09:41:56] [FHEM] { reading: 'state',
  valueOff: '/off|A0|000000/',
  cmdOn: 'on',
  cmdOff: 'off',
  device: 'Kueche.Licht.Nacht',
  informId: 'Kueche.Licht.Nacht-state',
  characteristic_type: 'On',
  log:
   { [Function: bound ]
     debug: [Function],
     info: [Function],
     warn: [Function],
     error: [Function],
     log: [Function],
     prefix: 'FHEM' } }
  2017-12-31 09:41:56 caching: Kueche.Licht.Nacht-state: on
[2017-12-31 09:41:56] [FHEM] Kueche.Licht.Standard is switch
[2017-12-31 09:41:56] [FHEM] Kueche.Licht.Standard has
[2017-12-31 09:41:56] [FHEM]   On [state;on,off]
[2017-12-31 09:41:56] [FHEM] { reading: 'state',
  valueOff: '/off|A0|000000/',
  cmdOn: 'on',
  cmdOff: 'off',
  device: 'Kueche.Licht.Standard',
  informId: 'Kueche.Licht.Standard-state',
  characteristic_type: 'On',
  log:
   { [Function: bound ]
     debug: [Function],
     info: [Function],
     warn: [Function],
     error: [Function],
     log: [Function],
     prefix: 'FHEM' } }
  2017-12-31 09:41:56 caching: Kueche.Licht.Standard-state: on
[2017-12-31 09:41:56] [FHEM] LichtKueche is light
[2017-12-31 09:41:56] [FHEM] LichtKueche has
[2017-12-31 09:41:56] [FHEM]   On [pct;on,off]
[2017-12-31 09:41:56] [FHEM]   Brightness [pct]
[2017-12-31 09:41:56] [FHEM] { reading: 'pct',
  valueOff: '0',
  cmdOn: 'on',
  cmdOff: 'off',
  device: 'LichtKueche',
  informId: 'LichtKueche-pct',
  characteristic_type: 'On',
  log:
   { [Function: bound ]
     debug: [Function],
     info: [Function],
     warn: [Function],
     error: [Function],
     log: [Function],
     prefix: 'FHEM' } }
  2017-12-31 09:41:56 caching: LichtKueche-pct: 40
[2017-12-31 09:41:56] [FHEM] { reading: 'pct',
  cmd: 'pct',
  delay: true,
  device: 'LichtKueche',
  informId: 'LichtKueche-pct',
  characteristic_type: 'Brightness',
  log:
   { [Function: bound ]
     debug: [Function],
     info: [Function],
     warn: [Function],
     error: [Function],
     log: [Function],
     prefix: 'FHEM' } }
[2017-12-31 09:41:56] [FHEM] SZ.Bettlampe is switch
[2017-12-31 09:41:56] [FHEM] SZ.Bettlampe has
[2017-12-31 09:41:56] [FHEM]   On [state;on,off]
[2017-12-31 09:41:56] [FHEM] { reading: 'state',
  valueOff: '/off|A0|000000/',
  cmdOn: 'on',
  cmdOff: 'off',
  device: 'SZ.Bettlampe',
  informId: 'SZ.Bettlampe-state',
  characteristic_type: 'On',
  log:
   { [Function: bound ]
     debug: [Function],
     info: [Function],
     warn: [Function],
     error: [Function],
     log: [Function],
     prefix: 'FHEM' },
  event_map: { ON: 'on', OFF: 'off' } }
  2017-12-31 09:41:56 caching: SZ.Bettlampe-state: OFF
[2017-12-31 09:41:56] [FHEM] WZ.Steckdose1 is switch
[2017-12-31 09:41:56] [FHEM] WZ.Steckdose1 has
[2017-12-31 09:41:56] [FHEM]   On [state;on,off]
[2017-12-31 09:41:56] [FHEM] { reading: 'state',
  valueOff: '/off|A0|000000/',
  cmdOn: 'on',
  cmdOff: 'off',
  device: 'WZ.Steckdose1',
  informId: 'WZ.Steckdose1-state',
  characteristic_type: 'On',
  log:
   { [Function: bound ]
     debug: [Function],
     info: [Function],
     warn: [Function],
     error: [Function],
     log: [Function],
     prefix: 'FHEM' },
  event_map: { ON: 'on', OFF: 'off' } }
  2017-12-31 09:41:56 caching: WZ.Steckdose1-state: OFF
[2017-12-31 09:41:56] [FHEM] WZ.Steckdose2 is switch
[2017-12-31 09:41:56] [FHEM] WZ.Steckdose2 has
[2017-12-31 09:41:56] [FHEM]   On [state;on,off]
[2017-12-31 09:41:56] [FHEM] { reading: 'state',
  valueOff: '/off|A0|000000/',
  cmdOn: 'on',
  cmdOff: 'off',
  device: 'WZ.Steckdose2',
  informId: 'WZ.Steckdose2-state',
  characteristic_type: 'On',
  log:
   { [Function: bound ]
     debug: [Function],
     info: [Function],
     warn: [Function],
     error: [Function],
     log: [Function],
     prefix: 'FHEM' },
  event_map: { ON: 'on', OFF: 'off' } }
  2017-12-31 09:41:56 caching: WZ.Steckdose2-state: OFF

justme1968

das alexa api geht davon aus das sich die farbtemperatur in einem bereich frei einstellen lässt. nicht das es nur drei stufen sind.

ich muss erst mal überlegen wie man das einbauen kann.
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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