Amazon Echo and Alexa

Begonnen von andrejs, 03 Oktober 2015, 23:32:23

Vorheriges Thema - Nächstes Thema

andrejs

I have recently bought Amazon Echo also with intention to use it for voice control of home automation devices in FHEM. I managed to build the necessary applications and in order to make it work you will need:
1.   Buy Amazon Echo gadget
2.   Install/copy 77_ECHO.pm FHEM module and define device in FHEM (define <name of device> ECHO). This application will enable you to create Intent Schema, Sample Utterances and create API in json format for script in Amazon Lambda service (see point 4). 

To create Intent scheme
http://fhem-server-ip:port/fhem?cmd=get%20nameofECHOdevice%20intentscema&XHR=1
or
get <name of echo device> intentscema

To create Sample Utterances
http://fhem-server-ip:port/fhem?cmd=get%20nameofECHOdevice%20uterances&XHR=1
or
get <name of echo device> uterances

API data in json format
http://fhem-server-ip:port/fhem?cmd=get%20nameofECHOdevice%20alexa%20nameofFHEMdevice&XHR=1
or
get <name of echo device> alexa <name of fhem device>

3.   Build the Alexa skill - declare Intent Schema and Sample Utterances

First you need to sign in Amazon developer console and find apps&services Alexa (https://developer.amazon.com/edw/home.html#/) and select Alexa Skills Kit.
Here you will build the Alexa Skills - declare Intent Schema and Sample Utterances. You will also define the inovacation name – for example Smarty.
Example how the intent scheme and sample uterance is defined for FHEM

intent scheme
Zitat3 intents are defined for FHEM:
SRset – for set the state of FHEM device
SRstater  - get the value and time of change for specific reading of FHEM device
Srgeneral – ask specific question and get answer

Sample Utterances
ZitatSRset {cabinet room blinds|litdev} {up|litrea}
SRset set {brightness|litrea} of {living room light|litdev} to {one hundred|numval}
SRstater {outside|litdev} {temperature|litrea}
SRgeneral {what time is it|litrea}
Each sample uterance should have defined the name of intent (SRset), the name of device (living room light), the name of reading (brightness), the value of reading (one hundred).   
After the  | the the type of slot should be written (for example llitdev)

For more information about Intent Schema and Sample Utterances  see here https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/defining-the-voice-interface

4.   Create the script in order to get information from FHEM server or to set the state of FHEM devices. In my case I used Amazon's AWS Lambda service and node.js. if you have access to a secure webserver yourself, you can set it up on your server, in your preferred programming environment, but as I said I have not done this,

To use Amazon AWS Lambda service you need to sign and create Lambda function.  When you create the function you will need to define:
-   Tab Code – select that the code will be uploaded in zip file (archive zip consists index.js, AlexaSkill.js). In index.js you will need to define var APP_ID (application ID od Alexa skill – can be seen at the first page of Alexa skill), devecho (the name of ECHO FHEM device) and urlPrefix (ip of FHEM server, port.! The script only covers http connection and not https!
-   Tab Configuration – select Node.js, index handler, basic execution role, Advanced settings timeout should be 5 s
-   Tab Event sources – select Alexa Skills Kit

More information is available here https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/developing-an-alexa-skill-as-a-lambda-function


5.   for device which you want to control over Amazon echo you need to define specific attribute (SRset SRstater SRword) for FHEM device.  This attributes should be defined in FHEM as attr global userattr.

SRword – english name of device.
SRset – for set the state of FHEM device


Syntax: request1, request2,.....

Each request is divided by comma and in the request the following elements should be defined:
-   *1 – it is mandatory and represents the english name of FHEM device
-   the event/reading should be enclosed in round brackets with following syntax (english name of event:fhem name of event:english name of unit). This element is mandatory
-   the value of event/reading should be enclosed in square brackets with following syntax [english name of value:fhem value]. This element is optional
-   the specific answer – the default answer  from Alexa is »I have set [device] to [state].« and if you want to have your specific answer you should use this element enclosed in curly brackets. This element is optional. In order to create the response the following parameters are available:
o   *1 – english name of FHEM device
o   *2 – english name of event/reading
o   *3 – english name of value of event/reading
o   *4 – date and time of last change of event/reading   
Example for specific answer: {I have changed *2 of *1 to value *3. The change was made *4}
Spoken: {I have changed brightness of room light  to value hundred. The change was made 2015-10-03 20:04:03}   

Example for SRset attribute for LIFX led light (SRword: room light):
switch *1 (on:on),switch *1 (off:off),set (brightness:bri) of *1 to [one hundred:100],set (color:rgb) of *1 to [red:FF4766]

In the example are 4 requests:
-   first and second are very simple for switching off and switch on the light. You will need to say »switch room light on »
-   third request is for control the brightness. You need to say »set brightness of room light to one hundred. Fhem request will be made using the fhem name of parameters (bri,100, fhem name of device)
-   last request set the color of light. You need to say »set color of room light to red«.


SRstater – to get information about the state of specific reading of FHEM device.

Syntax: request1, request2,.....

Each request is divided by comma and in the request the following elements should be defined:
-   *1 – it is mandatory and represents the english name of FHEM device
-   the name of reading should be enclosed in round brackets with following syntax (english name of reading:fhem name of reading:english name of unit). This element is mandatory
-   the specific answer – the default answer  from Alexa is »[english name of device] [english name of reading] is [state of reading] [english name of unit]. Last change was made [date and time of reading change].« and if you want to have your specific response you should use this element enclosed in curly brackets. This element is optional. In order to create the answer the following parameters are available:
o   *1 – english name of FHEM device
o   *2 – english name of event/reading
o   *3 – value of reading
o   *4 – date and time of last change of event/reading   

Example for specific answer: {In the garden *1 *2  is *3 degrees Celsius. The measurement was made *4}
Spoken: In the garden outside temperature is twenty degrees Celsius. The measurement was made 2015-10-03 20:04:03}   

Example for SRstater attribute for weather station (SRword: outside):

*1 (temperature:temperature:degrees Celsius),*1 (humidity:humidity:percent)
In the example are 2 requests:
-   first to get the temperature and second to get humidity. You will need to say »Outside temperature». The response will be: »the outside temperature is twenty degrees celsius. The last change was made  2015-10-03 20:04:03«

SRgeneral – to ask general question and get some answers. This attribute is defined only for ECHO device!

Syntax: request1, request2,.....

Each request is divided by comma. In the request two elements should be present question and answer divided by :. Two parameters can be used in element answer:
-   *10 – get current date
-   *11 – get current time

Examples for Srgeneral

thank you:you are welcome,go to sleep:good night and sleep well,what time is it:Time is *11,what day is it:Today is *10

In the example are 4 requests:
-   first and second are without parameters and if you say »thank you« the Alexa will answer »you are welcome«.
-   For third request you should ask »what time is it » and the answer will be the current time in format »Time is 20:20«
-   For fourth request you should ask »what day is it » and the answer will be the current dat ein format »Today is October 3rd«


When you sucesffuly »passed« all described five points then you will be able to control FHEM devices with amazon echo. To start you have two possibilities:

-   Say: Alexa start [inovacation name]. Alexa will ask you »How would you like to control your devices«. This answer can be changed in index.js var lanunchtext. After that you can put/say your request
-   If you want directly to access you need to say »Alexa tell [inovacation name] to ....« or »ask [inovacation name] for....«

This should be all for now and have fun.

Andrej 


rudolfkoenig

Andrej, as the prefix 99 is special (the module will always be loaded at startup), could you please rename your module into something like 77_ECHO.pm? It would make a later integration into the standard FHEM distribution easier.

The Echo is not available in Germany yet, please be patient until you get some response here.

andrejs


breezybadger

#3
Hey Andrejs,

thanks a lot! I ordered a Echo just because of your work. You bring us one step close to sky net and Iron Man. Thanks!

Arrived today, I will report

@Update1:

I was able to set it up and now startet to configure it within FHEM. Sadly it is not so easy. I register at the AMAZON Services for Alexa Skills and the Lambda Plattform.

When i try to add your utterances in the Webapp I got the response:

Error: There was a problem with your request: The slot 'litdev' has been referenced with two different slot types: LITERAL and LITERAL|NUMBER. A slot name can only be of a single type.

@Update2

When i say "alexa ask smarty ... " -> "There is problem with the requested skill respond"

I uploaded you index (edited) and alexa skill file in AWS Lambda File and put the settings in there you described.
In the Apps&Service Development I make a new skill with the following settings :
Intent Schema*

{
  "intents": [
  {
     "intent":"SRset",
     "slots": [
       {
         "name": "litdev",
         "type": "LITERAL"
       },
       {
         "name": "litval",
         "type": "NUMBER"
       },
       {
         "name": "litrea",
         "type": "LITERAL"
       }
     ]
  },
  {
     "intent":"SRstates",
     "slots": [
       {
         "name": "litdev",
         "type": "LITERAL"
       },
       {
         "name": "litval",
         "type": "NUMBER"
       },
       {
         "name": "litrea",
         "type": "LITERAL"
       }
     ]
  },
  {
     "intent":"SRgeneral",
     "slots": [
       {
         "name": "litdev",
         "type": "LITERAL"
       },
       {
         "name": "litval",
         "type": "NUMBER"
       },
       {
         "name": "litrea",
         "type": "LITERAL"
       }
     ]
  }
]
}


Sample Utterances*
SRset set {light|litdev} {on|litrea}
SRset set {light|litdev} {off|litrea}


In FHEM I have for my Homatic Light Switch for testing:

define HM_37764C CUL_HM 37764C
attr HM_37764C SRword light
attr HM_37764C SRset set *1 (on:on),set *1 (off:off)


My Alex App Answers:

The SpeechletResponse must not be null

Thanks in advance for your help and awesome work!

andrejs

Hi Dani,
just my quick observation. Regarding the Intentscema if you use ECHO module in FHEM (http://fhem-server-ip:port/fhem?cmd=get%20nameofECHOdevice%20intentscema&XHR=1) to create intent schema you should get the following:

Zitat{
  "intents": [
  {
     "intent":"SRset",
     "slots": [
       {
         "name": "litdev",
         "type": "LITERAL"
       },
       {
         "name": "litval",
         "type": "LITERAL"
       },
       {
         "name": "litrea",
         "type": "LITERAL"
       },
       {
         "name": "numdev",
         "type": "NUMBER"
       },
       {
         "name": "numval",
         "type": "NUMBER"
       },
       {
         "name": "numrea",
         "type": "NUMBER"
       }
     ]
  },
  {
     "intent":"SRstater",
     "slots": [
       {
         "name": "litdev",
         "type": "LITERAL"
       },
       {
         "name": "litval",
         "type": "LITERAL"
       },
       {
         "name": "litrea",
         "type": "LITERAL"
       }
     ]
  },
  {
     "intent":"SRgeneral",
     "slots": [
       {
         "name": "litdev",
         "type": "LITERAL"
       },
       {
         "name": "litval",
         "type": "LITERAL"
       },
       {
         "name": "litrea",
         "type": "LITERAL"
       }
     ]
  }
]
}

This works me (see attached print screen) in amazon developer console and you can see the interaction module is checked.Have you passed all controls on Amazon developer console (ALEXA SKILL) and your Intentscema is checked? 
I also noticed that in intentschema you should replace the name of intent "SRstates" with "SRstater" but this I think it so not the cause of your problem. Regarding the "uterances" I do not see any errors. 

Andrej


andrejs

#5
Dani,
it is still old version of ECHO module attached in the first post. Check attribute SRintents in echo device it should have value
ZitatSRset:LITERAL#NUMBER,SRstater:LITERAL,SRgeneral:LITERAL
Use attached echo module to this post and create again the intentscema (it will be the same as it was shown in the previous post).

Andrej

breezybadger

#6
Dear Andrej,

now I got the same output and it is saved in the Apps and Services. But in the Alexa Skill app I got the following output in the attached pic.

I put the index.js and the AlexaSkill.js in a zip Archive and uploaded it to AWS Lamda function - I can't edit it because it was in a archive. Of course I choose the Alexa Skill Kit and the index handler, when I run "Test" I got "Unable to invoke the function because invoke parameters were not valid JSON." back.

Did I may have done something wrong in there?

The Alexa App Still say:
ZitatThe SpeechletResponse must not be null

Dan

andrejs

#7
Dani,

I have never tested in Alexa skill KIt but I tested in AWS Lambda. I also got the same response as you (response is invalid) did but it still works when I ask Alexa to do something. First I would like to ask you have you changed in index.js (before you make a zip with AlexaSkill.js file and upload in AWS) the following lines:
var APP_ID = "?"; //replace with your amazon app ID it should be something like amzn1.echo-sdk-ams.app.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
var devecho = "?";//replace with the name of your echo device in FHEM
var urlPrefix = "http://myname:mypassword/myhome:8090/fhem?cmd=
if your fhemweb page is not password protected then you can skip the username and password but of course it should be accessible outside your home network.   
How I test in AWS Lamda?
In AWS Lambda function I select Actions and Configure test event. After that the "input test event" window will be opened and in this window I copy the following code (change applicationId):
Zitat{
  "session": {
    "new": false,
    "sessionId": "session1234",
    "attributes": {},
    "user": {
      "userId": null
    },
    "application": {
      "applicationId": "amzn1.echo-sdk-ams.app.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    }
  },
  "version": "1.0",
  "request": {
    "intent": {
      "slots": {
        "litdev": {
          "name": "litdev",
          "value": "light"
        },
        "litrea": {
          "name": "litrea",
          "value": "on"
        }
      },
      "name": "SRset"
    },
    "type": "IntentRequest",
    "requestId": "request5678"
  }
}

Then click on the button "Save and test" and you will see the execution result and log output (see example in attached picture).

Andrej

breezybadger

Hey,

the first lines of my uploaded file looks like :

Zitatvar APP_ID = "amzn1.echo-sdk-ams.app.2a79ae4f-2492-xxxx-a0b6-xxxxx"; //replace with your amazon app ID <- which i got from the APP ID I created in APPS and Services Application Id :The ID for this skill
/**************************************\
                Globals
\**************************************/
var https = require('https');
var http = require('http');
var AlexaSkill = require('./AlexaSkill');
var devecho = "echo";
var urlPrefix = "[url="http://192.168.1.13:8083/fhem?cmd=";"]http://192.168.1.13:8083/fhem?cmd=";[/url]
var urlPrefixget = urlPrefix+"get%20"+devecho+"%20alexa%20";
var launchText = "How would you like to control your devices?";


My FHEM Config looks like:
Zitatdefine echo ECHO
attr echo SRfile 0
attr echo SRintdefault SRword
attr echo SRintents SRset:LITERAL#NUMBER,SRstater:LITERAL,SRgeneral:LITERAL
attr echo SRword echo

The Result of the test in Lamda was:
ZitatExecution result: failed (logs) The area below shows the result returned by your function execution using the context methods. Learn more about returning results from your function.
{
  "errorMessage": "Unexpected token ILLEGAL",
  "errorType": "SyntaxError",
  "stackTrace": [
    "Module._compile (module.js:439:25)",
    "Object.Module._extensions..js (module.js:474:10)",
    "Module.load (module.js:356:32)",
    "Function.Module._load (module.js:312:12)",
    "Module.require (module.js:364:17)",
    "require (module.js:380:17)"
  ]
}

Of course I replaced the ID with the one from my Apps&Services

Any Ideas what I am doing wrong?

andrejs

Dani,

the issue is var urlPrefix = "http://192.168.1.13:8083/fhem?cmd=" because in the script index.js the Amazon server can not access to your internal network. How you access to fhemweb if you are not connected to your network?

Andrej

breezybadger

Hey,
i only access it from my Homenetwork ( the same Alexa is into)

So I have to setup a public network access ?

Dan

andrejs

Yes, otherwise it will not work.

breezybadger

Since my DS-Lite connection and a fritz.box that does not like me, it will not work for me :(

But thanks again a lot for your help!

andrejs

Dani,
I do not have a lot of knowledge but your router should be configured to use dynamic DNS and port forwarding or if you have static IP (in my case I got static IP from internet provider) you just set up port forwarding on your router?

Andrej

breezybadger

Hi,

I did, but it does not work. I already send an Email to the AVM Support, to find out - why it does not work. I let you know, as soon as I have found a solution.

Dan

andrejs

Oh, I understand. When you will solve the issue with AVM support let me know to help you further in controling FHEM devices with Alexa.

Regards

Andrej

breezybadger

#16
Hi,

its me again. I managed the IP Problem, and now have a public IPv4 Adress to get access to my FHEM from everywhere. I uploaded a new INDEX File with the AlexaSkill in a ZIP Archive.

When I run test with your environment I got the following results:
{
  "errorMessage": "Unexpected token ILLEGAL",
  "errorType": "SyntaxError",
  "stackTrace": [
    "Module._compile (module.js:439:25)",
    "Object.Module._extensions..js (module.js:474:10)",
    "Module.load (module.js:356:32)",
    "Function.Module._load (module.js:312:12)",
    "Module.require (module.js:364:17)",
    "require (module.js:380:17)"
  ]
}

Or the Logfile says:
/var/task/index.js:4
var APP_ID = "amzn1.echo-sdk-ams.app.XXX"; //
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
START RequestId: a9061cad-9ce2-11e5-8960-1b67a6685eac Version: $LATEST
Syntax error in module 'index': SyntaxError at Module._compile (module.js:439:25) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17)
END RequestId: a9061cad-9ce2-11e5-8960-1b67a6685eac
REPORT RequestId: a9061cad-9ce2-11e5-8960-1b67a6685eac Duration: 152.76 ms Billed Duration: 200 ms Memory Size: 128 MB Max Memory Used: 9 MB

Any advice?

Dan

andrejs

Hi,

could you please send me the index.js file which was in zip file uploaded to Amazon?

Andrej

breezybadger

Thanks, I send you a private message. Please keep in mind to post the working file here :)

andrejs

It seems something must be wrong with js file. I am attaching new ones to this post. Please replace in index.js file APP_ID and urlPrefixurl. Now the same error should not be repeated.

Andrej

breezybadger

#20
Man, you made it! It works like a charm!

Thanks it is awesome.

If you got some time left it would be awesome to update your description. If you want I could start a wiki Page for reproduction for others.

Dan

andrejs

Dani,
I upload the attached zip file to this post where APP_ID,urlPrefixurl are not changed. I got the error "errorMessage": "Invalid applicationId". Please upload this zip file and try again. Maybe just one recommendation: after you will click on button "save and test" wait to get error (it will be previous error probably because it runs old js script) and then click button "test" and after that get the errror message for the new uploaded script.

Andrej

breezybadger

Hey,

it just took some time for amazon to update the content. It works awesome now! And I updated my last post.

andrejs

Great to hear that. I am planning to post upgraded ECHO module (next week) where the script automatically create SRset and SRstater attributes for devices.

Andrej

breezybadger

That sounds very good. I got a to simple switch a light on / off, but I don't get it how to ask for status of a differente device.

Could you please give some simple examples with the full FHEM configuration and the Sample Utterances from AAS - this would be helpful to get the full potential of your awesome work.

It is still a little annoying to always use the intend word, but thats why I used a combination with the hue bridge for the simple switches.

Thanks again Dan

andrejs

#25
ZitatI don't get it how to ask for status of a different device
To get the status of the fhem device (actually Alexa can be asked for any value/status of fhem devices readings) you should create attribute SRstater and of course also SRword.

For example CUL_HM  HM-CC-RT-DN is radiator valve and has many readings: desired-temp, measured-temp,motorErr,controlMode,ValvePosition,.....
The current values of these Readings are:
desired-temp 18.5
measured-temp 17.0
motorErr OK
controlMode auto
ValvePosition 10

The attribute SRword of this device is for example Child room.

How should look SRstater attribute for the device in order to ask Alexa for status of fhem device readings (for details see my first post)?

*1 (desired temperature:desired-temp:degrees Celsius),*1 (measured temperature:measured-temp:degrees Celsius),*1 (motor status:motorErr),*1 (control mode status:controlMode),*1 (valve position:ValvePosition)

If you want to get the status/value of fhem device reading you ask: 
Alexa ask smarty for Child room desired temperature. The answer will be  »child room desired temperature is eighteen point five degrees celsius. The last change was made  [date and time of last change of the reading desired-temp]«
Alexa ask smarty for Child room control mode status. The answer will be  »child room control mode status is auto. The last change was made  [date and time of last change of the reading controlmode]«

The sample uterance you will create in FHEM and after copy to Amazon Alexa Skill:

http://fhem-server-ip:port/fhem?cmd=get%20nameofECHOdevice%20uterances&XHR=1

or

use "get uterances" in FHEMWEB of echo device

How the uterances look like?
SRstater {child room|litdev} {desired temperature|litrea}
SRstater {child room|litdev} {measured temperature|litrea}
SRstater {child room|litdev} {motor status|litrea}
SRstater {child room|litdev} {control mode status|litrea}
SRstater {child room|litdev} {valve position|litrea}

ZitatIt is still a little annoying to always use the intend word, but thats why I used a combination with the hue bridge for the simple switches.
Unfortunately I do not have solution for that and every time you must start question with "Alexa ask smarty for..."  or "Alexa tell smarty to....."

Andrej



kimeshan

Zitat von: breezybadger am 05 Dezember 2015, 15:00:56
Hey,

the first lines of my uploaded file looks like :

My FHEM Config looks like:
The Result of the test in Lamda was:
Of course I replaced the ID with the one from my Apps&Services

Any Ideas what I am doing wrong?

Hey,

I just had the same problem, and I found out why. If you still looking for a solution to this, here it is.

The line that is causing your ILLEGAL TOKEN error is:
"amzn1.echo-sdk-ams.app.2a79ae4f-2492-xxxx-a0b6-xxxxx"

Notice your last double quote is " instead of " - it must have changed formatting when you copy and pasted...

Change it and let me know if it works

breezybadger

#27
Hello again

Iam just curious if it is possible to let Alex Read Messages e.g. if the door opens she says welcome. Is this possible to trigger voice output from her?

erw85

Hello Andrej,

Thanks for your great Module, it works like a charm!

Does your module allow to get the actual recognized word (=litval slot) of an utterance from Alexa and use it as input for a FHEM command?

For example, I d'like to use it in combination with the Sonos Speak command, in a way similar to this: 
attr Sonos1 SRSet *1 (speak:Speak 20 de) [phrase:$litval]

Any plans for a syntax like this?

Another great feature would be if you could generate default SRset (and SRstater) utterances for devices by just by setting attr SRset/SRstater to "default".

All the best for 2016,
Erwin

andrejs

ZitatI just curious if it is possible to let Alex Read Messages e.g. if the door opens she says welcome. Is this possible to trigger voice output from her?
Unfortunately Dan Alexa is only supposed to speak when spoken to, so I hope there will some solution given by Amazon in the future.

ZitatDoes your module allow to get the actual recognized word (=litval slot) of an utterance from Alexa and use it as input for a FHEM command?
Erwin, I will need to look at Alexa Skill Interaction Module (there were some changes) to see if this is possible because normally all spoken words must defined in advance in utterance scheme otherwise you get the "error" response from Alexa.     

ZitatAnother great feature would be if you could generate default SRset (and SRstater) utterances for devices by just by setting attr SRset/SRstater to "default".
Yes good idea, I have plans to implement this very soon (actually I made 90% of the changes in the module)...

Andrej

andrejs

Erwin,
I am not familiar to SONOS module and Speak command so I just want to clarify what this command/function do. Please correct If I am wrong the purpose of Speak function is to send some text to SONOS speaker to be spoken (text to speach conversion)?
How does it look the syntax of the speak command (for switching some device is "set [name od device] on")?     

Andrej

erw85

Hello Andrej,

Yes, the Speak command uses e.g. Google Text to Speech to generate voice output.

It's used e.g. like this:
set Sonos_My_Room Speak 30 en Phrase to say.
With "30" = volume; "en" = english language; "Phrase to say" = text to be converted.

If you need help regarding testing, let me know!
Thanks in advance,
Erwin




andrejs

Erwin,
is there any possibility to avoid volume and language parameters and the default values for both of them (volume and language) are defined in Sonos module?

Andrej

erw85

Zitat von: andrejs am 16 Januar 2016, 01:24:02
Erwin,
is there any possibility to avoid volume and language parameters and the default values for both of them (volume and language) are defined in Sonos module?

Andrej

My opinion is that your module should't have such a default value requirement regarding other modules, e.g. like Sonos.
If possible your SRSet/SRStater/SRGeneral attributes should support a syntax to build custom command strings, e.g. use one or multiple slot types and (matched/unmatched) values for other modules.

Perhaps we could first discuss, how such a syntax could look like. The DOIF-module could be partly an inspiration as it supports many use cases. E.g. see the examples also in the German docu of it.

Then your module could have a very wide usage spectrum and not only the example with the Sonos Speak command.

Kind regards,
Erwin



andrejs

I managed to change the script in order to make possibility to create default SRstater,SRset attributes for devices. The script automaticly creates the default SRset, SRstater attributes after the FHEM server is started (90 seconds after the module loaded because I have problems to get list of all sets without any delay). For details see explanations below. The solution is not the best one but this what I can do now. Any other ideas are more then welcome.

Module 77_ECHO.pm - in order to understand the logic of Echo module please read the first post http://forum.fhem.de/index.php/topic,41754.0.html

Define
Define <name> ECHO

Set
Set <name> createattr

The script create defaults SRset, SRstater attributes for each device. The default SR attributes are created for the following devices and readings:
•   SRword attriibute must be defined/created for device
•   Copy files SRreading.csv and SRrvalue.csv to fhem directory. The name of files can be changes but then you should also change attribute SRimpfile 

SRreading.csv – in the file are 4 fields separated by comma

Field 1 – fhem name of the reading
Field 2 – english name of the reading
Field 3 – english name of measure unit
Field 4 – the word/command before the name of the device in attribute SRset

Example for FS20 switch and CUL_HM radiator valve
on,on,,switch
off,off,,switch
desired-temp,desired temperature,degrees Celsius,
measured-temp,measured temperature,degrees Celsius,

SRrvalue.csv – in the file are 3 fields separated by comma
Field 1 – fhem name of the reading
Field 2 – fhem value of the reading
Field 3 – english name of value

Example for CUL_HM radiator valve
desired-temp,17.0,seventeen point zero
desired-temp,21.0,twentyone point zero
controlMode,auto,automatic

Get
get <name of echo device> alexa <name of fhem device>
show API data for chosen device in json format used in index.js

get <name of echo device> intentschema
show Intent Schema which should be copied to Interaction module of Alexa Skill

get <name of echo device> uterances
show Sample Uteranaces which should be copied to Interaction module of Alexa Skill

get <name of echo device> attributes
show all defined SRset, SRstater attributes of devices

get <name of echo device> showsets
show for each devices all available sets/readings

get <name of echo device> stateall
show API data for all device in json format

Readings
request – show the last request from alexa

Attributes
SRexpfile
Possible values: 0 and 1
Default value: 0
The Intentschema and Sample Utranances using get command are written in files if the value is 1. The files are written in FHEM directory.

SRfrontset
Defualt value: set
It defines the first word in attribute SRset of each device when the SR attributes are created when »set <name of echo device> createattr« is used.

SRgeneral
Default value: current time:Time is *11,current day:Today is *10
The intention of this  attribute is to define general question for Alexa and get some answers.

Syntax: request1, request2,.....

Each request is divided by comma. In the request two elements should be present question and answer divided by :. Two parameters can be used in element answer:
-   *10 – get current date
-   *11 – get current time

Examples for SRgeneral
thank you:you are welcome,go to sleep:good night and sleep well,current time:Time is *11,current day:Today is *10

SRimpfile
Default value: SRreading.csv,SRrvalue.csv
The names of files separated by comma to define default SR attributes of devices
For details see above - Set <name> createattr.

SRoverwrite
Possible values: 0 and 1
Default value: 0
If the value of SRoverwrite is 1 the exsisting SRstater,SRreading attribute of devices will be overwritten when »set <name of echo device> createattr« is used.

SRintdefault
Default value: SRWord
The name of attribute where the english name of device can be found

SRintents
Default value: SRset:LITERAL#NUMBER,SRstater:LITERAL,SRgeneral:LITERAL
This attribute is used to create Intent Schema with get <name of echo device> intentschema

SRword
english name of echo device

AmunRe

#35
Hello All,


First of all, very great Modul!

It takes some time to get it working, but now it is fine.


I have a problem with my "get uterances". I got all SRset value but no one of SRstater.

Example:
define ts_aussen USBWX 2
attr ts_aussen SRstater *1 (temperature:temperature:degrees Celsius)
attr ts_aussen SRword outside
attr ts_aussen alias Außen
attr ts_aussen room Uebersicht,Wetter

And now my "get uterances".

SRset set {bathroom switch|litdev} {on|litrea}
SRset set {bathroom switch|litdev} {off|litrea}
SRset switch {onkyo|litdev} {off|litrea}
SRset  switch {onkyo|litdev} {on|litrea}
SRset set {onkyo|litdev} {input|litrea} {tv|litval}
SRset  set {onkyo|litdev} {input|litrea} {squeeze|litval}
SRset  set {onkyo|litdev} {volume up|litrea}
SRset  set {onkyo|litdev} {volume down|litrea}
SRset set {onkyo|litdev} {volume|litrea} to {ten|numval}
SRset set {onkyo|litdev} {volume|litrea} to {twenty|numval}
SRset set {onkyo|litdev} {volume|litrea} to {thirty|numval}
SRset set {onkyo|litdev} {mute|litrea} to {on|litval}
SRset set {onkyo|litdev} {mute|litrea} to {off|litval}
SRset set {playlist|litrea} of {squeeze livingroom|litdev} to {my playlist|litval}
SRset set {squeeze livingroom|litdev} {next|litrea}
SRset set {channel|litrea} of {kodi livingroom|litdev} to {sixxt|numval}
SRgeneral {good night|litrea}
SRgeneral {thank you|litrea}
SRgeneral {current time|litrea}
SRgeneral {current day|litrea}
SRgeneral {what time is it|litrea}
SRgeneral {what day is it|litrea}
SRset set {tv|litdev}{on|litrea}
SRset set {tv|litdev} {off|litrea}


Well, i also found a bug.

This 3 things wont work.
SRset set {onkyo|litdev} {volume|litrea} to {ten|numval}
SRset set {onkyo|litdev} {volume|litrea} to {twenty|numval}
SRset set {onkyo|litdev} {volume|litrea} to {thirty|numval}

He always set the thirty. And Alexa understand the 10 when i have a look at the history
4 x Echo Dot, HMLAN Gateway, und diverse HM Komponenten, Philips Hue + OSRAM Plugs

andrejs

Hi,
first thank you to find the bug. You are right the node.js script does not work when the intent slot "numval" is used. I propose to change numval to litval in Utterances:
SRset set {onkyo|litdev} {volume|litrea} to {ten|litval}
SRset set {onkyo|litdev} {volume|litrea} to {twenty|litval}
SRset set {onkyo|litdev} {volume|litrea} to {thirty|litval}   

I also corrected the module 77_ECHO.pm in order to write litval instead of numval.

Andrej

AmunRe

I think i found the next one.

Don't know why, but i have a dummy called Playstation and a Dummy called TV

Both are defined with SRWord and SRSet as Playstation and TV. Both with SRSet of turn (on:on) the *1,turn (off:off) the *1.

When i start TV it works fine. But the Playstation won't work.

When i'm testing it at Amazon my response is
Zitatturn (on:on) The remote endpoint could not be called, or the response it returned was invalid.

SRset turn {on|litrea} the {playstation|litdev}
SRset turn {off|litrea} the {playstation|litdev}

SRset turn {on|litrea} the {tv|litdev}
SRset turn {off|litrea} the {tv|litdev}


Can u help me a bit?
4 x Echo Dot, HMLAN Gateway, und diverse HM Komponenten, Philips Hue + OSRAM Plugs

andrejs

Sorry for my late reply, I am not very often on the forum. Can you please tell me how both dummies (TV, Playstation) are defined in FHEM and which FHEM syntax is used to switch both dummies?

Andrej 

AmunRe

Zitat von: andrejs am 25 April 2016, 23:37:29
Sorry for my late reply, I am not very often on the forum. Can you please tell me how both dummies (TV, Playstation) are defined in FHEM and which FHEM syntax is used to switch both dummies?

Andrej

hi Andrej,

No Problem.

define TV dummy
attr TV userattr lightSceneParamsToSave lightSceneRestoreOnlyIfChanged:1,0
attr TV SRset turn (on:on) the *1  {I turned on the *1 },turn (off:off) the *1 {I turned off the *1}
attr TV SRstater *1 (state:state)
attr TV SRword TV
attr TV room Wohnzimmer
attr TV setList on off



define PS3 dummy
attr PS3 SRset turn (on:on) the *1,turn (off:off) the *1
attr PS3 SRword Playstation
attr PS3 room Wohnzimmer
attr PS3 setList on off



The Syntax is just

set TV on/off
set PS3 on/off


Thanks for your help!
4 x Echo Dot, HMLAN Gateway, und diverse HM Komponenten, Philips Hue + OSRAM Plugs

andrejs

Strange because everything is defined as it should be and also tv works fine. Have you maybe for some other device defined Sword attribute as playstation?
What do you get if you make a test in AWS Lamda and use the following code (enter your applicationid) for "input test event":

{
  "session": {
    "new": false,
    "sessionId": "session1234",
    "attributes": {},
    "user": {
      "userId": null
    },
    "application": {
      "applicationId": "amzn1.echo-sdk-ams.app.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    }
  },
  "version": "1.0",
  "request": {
    "intent": {
      "slots": {
        "litdev": {
          "name": "litdev",
          "value": "playstation"
        },
        "litrea": {
          "name": "litrea",
          "value": "on"
        }
      },
      "name": "SRset"
    },
    "type": "IntentRequest",
    "requestId": "request5678"
  }
}

AmunRe

#41
Zitat{
  "errorMessage": "Process exited before completing request"
}

The Logoutput:
ZitatSTART RequestId: 754b5cb5-0fb1-11e6-a2ae-ad08cbb0d4ae Version: $LATEST
2016-05-01T15:29:14.679Z   754b5cb5-0fb1-11e6-a2ae-ad08cbb0d4ae   session applicationId: amzn1.echo-sdk-ams.app.e5cdc66d-xxxxxxxx
2016-05-01T15:29:14.680Z   754b5cb5-0fb1-11e6-a2ae-ad08cbb0d4ae   dispatch intent = SRset
2016-05-01T15:29:14.680Z   754b5cb5-0fb1-11e6-a2ae-ad08cbb0d4ae   { slots:
   { litdev: { name: 'litdev', value: 'playstation' },
     litrea: { name: 'litrea', value: 'on' } },
  name: 'SRset' }
2016-05-01T15:29:15.437Z   754b5cb5-0fb1-11e6-a2ae-ad08cbb0d4ae   TypeError: Cannot read property 'Value' of undefined
    at IncomingMessage.<anonymous> (/var/task/index.js:161:57)
    at emitNone (events.js:72:20)
    at IncomingMessage.emit (events.js:166:7)
    at endReadableNT (_stream_readable.js:905:12)
    at nextTickCallbackWith2Args (node.js:437:9)
    at process._tickDomainCallback (node.js:392:17)
END RequestId: 754b5cb5-0fb1-11e6-a2ae-ad08cbb0d4ae
REPORT RequestId: 754b5cb5-0fb1-11e6-a2ae-ad08cbb0d4ae   Duration: 783.94 ms   Billed Duration: 800 ms    Memory Size: 128 MB   Max Memory Used: 39 MB   
Process exited before completing request

i deleted the rest of my ID


I haven't set two of the same name. And it can't be because i would see them then in uterances.
4 x Echo Dot, HMLAN Gateway, und diverse HM Komponenten, Philips Hue + OSRAM Plugs

andrejs

If I am honest I do not know exactly what should be wrong. What about if you tested for tv do you get the same error message? I tested again with "configure test event" and take the script index.js and AlexaSill.js from the my post  on 8.12.2015 20:32 (of course I replaced in index.js file APP_ID and urlPrefixurl) uploaded zip file of both js files  to AWS Lamda and the test was sucessful. The test was made for dinning table light and I used the same code for input test event as I gave you in previous post (except I changes the name - the value of litdev). I also have very similar definitions of utterances:

SRset switch {dining table light|litdev} {off|litrea}
SRset switch {dining table light|litdev} {on|litrea} 

and intentschema:

{
  "intents": [
  {
     "intent":"SRset",
     "slots": [
       {
         "name": "litdev",
         "type": "LITERAL"
       },
       {
         "name": "litval",
         "type": "LITERAL"
       },
       {
         "name": "litrea",
         "type": "LITERAL"
       },
       {
         "name": "numdev",
         "type": "NUMBER"
       },
       {
         "name": "numval",
         "type": "NUMBER"
       },
       {
         "name": "numrea",
         "type": "NUMBER"
       }
     ]
  },
  {
     "intent":"SRstater",
     "slots": [
       {
         "name": "litdev",
         "type": "LITERAL"
       },
       {
         "name": "litval",
         "type": "LITERAL"
       },
       {
         "name": "litrea",
         "type": "LITERAL"
       }
     ]
  },
  {
     "intent":"SRgeneral",
     "slots": [
       {
         "name": "litdev",
         "type": "LITERAL"
       },
       {
         "name": "litval",
         "type": "LITERAL"
       },
       {
         "name": "litrea",
         "type": "LITERAL"
       }
     ]
  }
]
}

Andrej

okenny

Hello,

Has anyone tried using the Raspberry pi version of the Echo with this module?
Is this likely to work? I am not sure where to buy a real Echo in Germany

https://www.raspberrypi.org/blog/amazon-echo-homebrew-version/

Thanks!

andrejs

The advantage of Amazon Echo is that you have everything in one device with seven microphones that use enhanced noise cancellation, far-field voice recognition even while playing music or have noise around.
But unfortunately the device is not cheap. If you have opportunity to ask someone to bring the device for USA this would be the best and cheapest solution  (this was in my case).
Otherwise you can only buy Amazon Echo on the Ebay but the price with transportation costs+import duties-VAT is around 200 USD (used) to 250 USD (new) - one example http://www.ebay.de/itm/Amazon-Echo-Personal-Assistant-and-Audio-Streamer-/231960387307?hash=item3601ea9eeb:g:yE4AAOSwdU1W9e3V
The possibility is also to use Borderlinks (http://www.borderlinx.com/brand/buy_amazon-com) to buy directly on Amazon but the transportation costs and duties are not very low (approx. 50 EUR).

Andrej

flipkill

#45
Hello,

i get this Error, don't know why :(
The remote endpoint could not be called, or the response it returned was invalid.
Can someone help me?

{
  "errorMessage": "Unexpected token ILLEGAL",
  "errorType": "SyntaxError",
  "stackTrace": []
}


START RequestId: 4d896c75-3e26-11e6-b52c-dda9bbe48675 Version: $LATEST
Syntax error in module 'index': SyntaxError at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:373:25) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Module.require (module.js:353:17) at require (internal/module.js:12:17)
END RequestId: 4d896c75-3e26-11e6-b52c-dda9bbe48675
REPORT RequestId: 4d896c75-3e26-11e6-b52c-dda9bbe48675 Duration: 53.23 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 15 MB


best regards Jan

erikr

Hi Andrej,

The ECHO module is amazing. It took me some time to configure everything. But now there are almost no limits, what Alexa & FHEM can do for you.

Is there any chance to ease the configuration of the SRSets for thermostats by using a custom slot type?

In the ECHO Perl module there is a typo (SRStates). It caused that the SRStater utterances weren't generated.

Thanks!

Erik

mkress

that could be an interesting alternative to amazon echo hardware: https://github.com/alexa/alexa-avs-sample-app
amazon alexa app based on raspberry pi VOICE ENABLED

justme1968

andrej,

have you already used the (new?) smart home skill api?

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

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

andyclimb

Am I correct in thinking that the lamda function script has to connect to fhem via http.  so that requires exposing you fhem instance unencrpyted?

Or have i misunderstood things...

Looks very interesting.  Im in the process of trying to get it to work!
AM

andyclimb

#50
Got it to work.  Fantastic! 

3 things! 

1.  Is it hard to change the nodejs to use https instead of http?  there are just 2 get requests there?
2.  there is the smart home skill.... which might make things a lot easier?  Have you looked into that at all?  I believe (from very limited experience) that it might allow to control devices without having to ask smarty to....
3.  is it possible to say set brightness to XYZ  where that can be any number.  rather than having to define every possible combination for it?  same for colour?

Good work! 
AM

andyclimb

OK so i looked into getting the smart home API to work and it looks epic..  I think to get it to work a per backend supporting oath2.0 would have to be made to interact with it... way over my head..

I'm getting some very strange behaviours with SRword and some of my devices.  especially with structures...  I want alexa to be able to turn a whole room of, but any attr i associate with it get propagated to its members.. but it seems to revert them back even when i've changed them... I'm basically going nuts as i change some SRwords, refresh the device and its changed back to what it was before.  really weird... is this down to something in the back end of the echo.pm ?
AM

justme1968

habe look at structexclude. if not set structure will not only propagate set commands but also attr
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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

andyclimb

I did that, but it was still propagating!   to exclude multiple attr is it a comma separated list, or a space separated list?  Well actually both ways the attr is still propagated.  I've got all three attributes in the list but it doesn't stop it.
AM

justme1968

neither. it is a regex:  <structure name>:.* will exclude all attributes from the structure with this name.
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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

andyclimb

ah.  I just worked out that it does work if i just specify SRword. 

How would i exclude the three following attr from being propagated...

SRword
SRset
STstater

?
AM

justme1968

something like SRword|SRset|STstater. but you are probably fine with <structure name>:.* to exclude everything.
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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

andyclimb

bingo that is it cheers.
I want commands on/off etc to work, just not when a set a structure attribute.. so i don't want the attributes to propagate.  wonder if it is worth adding to the structure lib, the ability to send commands down the chain but not attributes.  setting the same attribute to all items in room or house is a bit unnecessary.  thanks for the help
AM

justme1968

<structure name>:.* will only suppress attributes and let set commands pass trough. have a look at the commandref.
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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

andyclimb

I have studied that commandref endlessly however, I still really really stuggle to understand regexp and how they relate to fhem commands, states, readings, and now attr... 

anyway.  for some reason get utterances no longer works.  It did yesterday, but not now.  I removed and re-installed all of echo, but every time i click get utterances I just get the two general month and day ones.  No idea why this has started happening.  quite frustrating.

get attributes works
SRstater#lamp:mqtt_livingroom_couchlight#*1 (state:state)

get states include the lamp
{
  "Results": [
  {
    "NameAlexa":"echo",
    "Name":"echo",
    "Internals": {
      "NAME": "echo",
      "NR": "625",
      "STATE": "echo",
      "TYPE": "ECHO"
    },
    "Readings": {      "request": { "Value":"echo", "Time":"2016-10-24 11:13:24" }    },
    "Attributes": {
      "SRexpfile": "0",
      "SRfrontset": "set",
      "SRgeneral": "current time:Time is *11,current day:Today is *10",
      "SRimpfile": "SRreading.csv,SRrvalue.csv",
      "SRintdefault": "SRword",
      "SRintents": "SRset:LITERAL#NUMBER,SRstates:LITERAL,SRgeneral:LITERAL",
      "SRoverwrite": "0",
      "SRword": "echo"
    }
  },
  {
    "NameAlexa":"lamp",
    "Name":"mqtt_livingroom_couchlight",
    "Internals": {
      "NAME": "mqtt_livingroom_couchlight",
      "NR": "596",
      "STATE": "off",
      "TYPE": "MQTT_DEVICE",
      "qos": "0",
      "retain": "0"
    },
    "Readings": {
      "IP": { "Value":"192.168.1.217", "Time":"2016-10-22 12:29:02" },
      "URL": { "Value":"livingroom-lamp", "Time":"2016-10-24 11:02:33" },
      "name": { "Value":"livingroom-lamp", "Time":"2016-10-22 12:29:01" },
      "state": { "Value":"off", "Time":"2016-10-23 23:50:34" },
      "status": { "Value":"offline", "Time":"2016-10-24 11:02:33" },
      "switch": { "Value":"off", "Time":"2016-10-23 23:50:34" },
      "transmission-state": { "Value":"incoming publish received", "Time":"2016-10-24 11:02:33" }
    },
    "Attributes": {
      "IODev": "myMQTT",
      "SRstater": "*1 (state:state)",
      "SRword": "lamp",
      "alias": "Livingroom Lamp",
      "autoSubscribeReadings": "livingroom-lamp/+",
      "group": "lights",
      "lights": "livingroom.structure.lights",
      "publishSet": "on off livingroom-lamp/switch/set",
      "room": "Homekit,Livingroom,mqqt",
      "stateFormat": "switch",
      "subscribeReading_IP": "livingroom-lamp/IP",
      "subscribeReading_name": "livingroom-lamp/name",
      "subscribeReading_status": "livingroom-lamp/status",
      "subscribeReading_switch": "livingroom-lamp/switch",
      "userReadings": "URL { \"\".( ReadingsVal($name,\"name\",ReadingsVal($name,\"IP\",0))).\"\";; }",
      "userattr": "lights lights_map room_map structexclude"
    }
  }  ],
  "currentDate":"Monday October 24",
  "currentTime":"11:14",
  "totalResultsReturned":2
}


but get utterances doesn't give me the lamp which has SRword defined...

SRgeneral {current time|litrea}
SRgeneral {current day|litrea}


tried everything, deleting echo, restarting, removing all SRword, SRset, STstater... it has just stopped working.  very wierd

any ideas?
AM

andyclimb

OK forget that.  I swore it generated that with just the SRword, but it needs SRset, not SRword.  My bad!
AM

andyclimb

I've also added a few utterances and am having a lot more success with it.  My brain when its a bit tired doesn't use the exactly english so i found myself using "turn on livingroom lamp" etc.  I think these permutations should be added to the utterances generator.

SRset switch {tv|litdev} {on|litrea}
SRset switch {tv|litdev} {off|litrea}
SRset turn {tv|litdev} {on|litrea}
SRset turn {tv|litdev} {off|litrea}
SRset switch {on|litrea} {tv|litdev} 
SRset switch {off|litrea}  {tv|litdev}
SRset turn {on|litrea} {tv|litdev} 
SRset turn {off|litrea}  {tv|litdev}


what do people think?
AM

prodigy7

#62
Now, I'm since today also a proud owner of a german amazon Echo. I want asap integrate into my fhem home automation. Is it maybe possible, write a small step for step tutorial how the module can be used? For example with a simple "power on or off a lamp with voice command". I would also translate it into german and add it to fhem wiki for other people.

Edit: Yes, in your first thread there is a guide. But somehow I can't follow it. So a guide with some screenshots would be maybe nice.

Edit 2: Maybe for people looking for a good tutorial creating a alexa skill, should looking here https://www.bignerdranch.com/about-us/nerds/josh-skeen/

justme1968

i had access to an echo dot today and have started with a fhem smart home skill.

automatic device discovery and switching of lights already works. i have nearly all the code running localy as a node.js server that is communicating with an aws lambda proxy that forwards the events. so there is no need to expose fhem itself.

using a smart home skill has the advantage that no intents and utterances have to be configured but lights and thermostats and groups/rooms are understood right out of the box.

unfortunately the smart home skill requires aws lambda. a local only server is not configurable.

but the code can be extended to include also the custom skill approach described in the first post. if using only custom skill then it would run completely local with just local node.js server exposed.

more here: https://forum.fhem.de/index.php/topic,57701.msg514524.html#msg514524
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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

paj

#64
It's worth noting that the literal slot type will soon no longer be available:

ZitatImportant: English (US) skills using the AMAZON.LITERAL slot type should be updated to use custom slots. Starting February 6, 2017, you will no longer be able to use AMAZON.LITERAL when saving a new or updated skill. Existing skills that already use AMAZON.LITERAL will continue to work, but you will be unable to make any changes to the skill configuration until you remove AMAZON.LITERAL.

English (UK) and German skills do not support AMAZON.LITERAL and cannot use the AMAZON.LITERAL slot type.

I am using the echo dot to control FHEM using PHP. Amazon talks to my Linode server which then processes the commands and issues them to FHEM on a Raspi in my home.

I have documented the basics of setting up a custom private skill in a step by step alexa php example guide here : http://blog.gaiterjones.com/amazon-alexa-php-hello-world-example/

It's very easy to adapt this to home automation with fhem.

8)

justme1968

my link from above and the fhemwiki for alexa-fhem should give you everything to coltroll fhem with alexa with a home automation and a custom skill.

unfortunately it is in german.
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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

paj

I read the wiki article, it made my brain melt.