586837r / node-red-contrib-alexa-remote2

MIT License
88 stars 72 forks source link

NEWBY QUERY #49

Open scargill opened 5 years ago

scargill commented 5 years ago

It all works, user and password, acount, sll ok, but as someone coming from node-red-contrib-amazon-echo - I'm lost trying to figure out what to DO with this - the 4 examples were no help (are the flows?) - can you give an example of how this might make a virtual device that looks like a philips Hue or similar. I send MQTT commands to ESP8266 devices in Node-Red - along the lines of msg.topic="mydevice1/toesp" and msg.payload="{out12:1}" - or for colour control... msg.payload="{rgb:255,0,0}" or similar.... the details are not important... how would I specify a virtual device to talk to - which would then via functions and MQTT (I'm well familiar with that) control a real device? Once I grasp this I'll blog about it which might save you some queries from others?.

586837r commented 5 years ago

Hi, these nodes are for controlling Alexa Echo and Alexa Smarthome devices. You can emulate Alexa routines to make Echos speak, play music, turn off Lights, and generally do anything that you can do with the Alexa app.

These nodes are NOT for creating virtual devices. node-red-contrib-alexa-smart-home or node-red-contrib-alexa-home-skill are probably what you are looking for.

scargill commented 5 years ago

But turning on and off lights is exactly what the virtual devices do?

Bothof the tools you mentioned SEEM to be early pre-production and not entirely running in Node-Red, also in a state of flux due to work on Google Home? I’m using node-red-contrib-amazon-echo right now.

From: 586837r notifications@github.com Sent: 26 September 2019 19:47 To: 586837r/node-red-contrib-alexa-remote2 node-red-contrib-alexa-remote2@noreply.github.com Cc: Peter Scargill pete@scargill.org; Author author@noreply.github.com Subject: Re: [586837r/node-red-contrib-alexa-remote2] NEWBY QUERY (#49)

Hi, these nodes are for controlling Alexa Echo and Alexa Smarthome devices. You can emulate Alexa routines to make Echos speak, play music, turn off Lights, and generally do anything that you can do with the Alexa app.

These nodes are NOT for creating virtual devices. node-red-contrib-alexa-smart-home or node-red-contrib-alexa-home-skill are probably what you are looking for.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/586837r/node-red-contrib-alexa-remote2/issues/49?email_source=notifications&email_token=AAONJAYZRPQJE3UJETKPDCTQLTYSPA5CNFSM4I2467LKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7WNFAQ#issuecomment-535614082 , or mute the thread https://github.com/notifications/unsubscribe-auth/AAONJA2ITFCSTYPZLRWBDRTQLTYSPANCNFSM4I2467LA . https://github.com/notifications/beacon/AAONJA7UORIXNXF7CDDZRR3QLTYSPA5CNFSM4I2467LKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7WNFAQ.gif

scargill commented 5 years ago

I tried the first of the examples - and put in the account I created-- which showed no errors. When I entered "hello how are you" without quotes in the cashboard box (after selecting one of my dots successfully) - the blue "routine speak" note came back with "error: response: input failed" - I guess I must be still missing something here. No errors when I created my account Any simple pointers appreciated.

586837r commented 5 years ago

Regarding your earlier comment: You can control smarthome devices that you have already registered on you Alexa Amazon account (with Alexa Routine node -> Smarthome option or Alexa Smarthome node -> Action option). But to integrate a custom/virtual device as an Alexa smarthome device you need e.g. node-red-contrib-amazon-echo.

This is probably a bug and not your fault. Does that happen with all of your Echos? Can you post the log output when you trigger the Routine Speak node? This is the interesting part: (You want to redact your customerId like i did)

{ raw:
  { type: 'speak',
    payload:
     { type: 'regular',
       text: { type: 'str', value: 'hello' },
       devices: [ 'G090VC09911223ER' ] } },
 evaluated:
  { type: 'speak',
    payload: { type: 'regular', text: 'hello', devices: [ 'G090VC09911223ER' ] } } }
{ native:
  { '@type': 'com.amazon.alexa.behaviors.model.OpaquePayloadOperationNode',
    type: 'Alexa.Speak',
    operationPayload:
     { deviceType: 'A32DOYMUN6DTXA',
       deviceSerialNumber: 'G090VC09911223ER',
       locale: 'en-GB',
       customerId: 'XXX',
       textToSpeak: 'hello' } } }
Alexa-Remote: No authentication check needed (time elapsed 53051)
Alexa-Remote: Sending Request with {"host":"layla.amazon.de","path":"/api/behaviors/preview","method":"POST","timeout":10000,"headers":{}}and data={"behaviorId":"PREVIEW","sequenceJson":"{\"@type\":\"com.amazon.alexa.behaviors.model.Sequence\",\"startNode\":{\"@type\":\"com.amazon.alexa.behaviors.model.OpaquePayloadOperationNode\",\"type\":\"Alexa.Speak\",\"operationPayload\":{\"deviceType\":\"A32DOYMUN6DTXA\",\"deviceSerialNumber\":\"G090VC09911223ER\",\"locale\":\"en-GB\",\"customerId\":\"XXX\",\"textToSpeak\":\"hello\"}}}","status":"ENABLED"}
Alexa-Remote: Response: No body

To further debug it would be useful if you could create a routine in your Alexa App that speaks to a fixed device. Then run that routine with a Alexa Routine node with the Execute Routine option. If triggering this node will make your Echo speak then we could compare that log output to the one from the Speak node because it should send the same request data.

You can reinitialise the account manually by triggering an Alexa Init node to make new routines show up in the select box.