Amazon Echo and Alexa

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

Vorheriges Thema - Nächstes Thema

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