Alexa connection with wemo emulator

Hello,

I am using the wemo emulator to trigger Alexa to speak. The emulator allows me to create a virtual sensor, which is triggered by my voice command to alexa and then in return triggers alexa to output a certain text/status.
It works fine, but Alexa is "forgetting" the sensor. So after a while it does not show up in my Alexa app anymore. So the routines programmed are useless.
Any idea why? I am fine using another Alexa node-set, if available.

[
    {
        "id": "9eaa8043970cc501",
        "type": "alexa-remote-routine",
        "z": "6efebd3d726e36ec",
        "name": "",
        "account": "d361aae4a59c7376",
        "routineNode": {
            "type": "speak",
            "payload": {
                "type": "regular",
                "text": {
                    "type": "msg",
                    "value": "payload"
                },
                "devices": [
                    "c7f62b64c9f54f59b55bab4e8f2ca024"
                ]
            }
        },
        "x": 740,
        "y": 1980,
        "wires": [
            []
        ]
    },
    {
        "id": "705589b012bbf679",
        "type": "function",
        "z": "6efebd3d726e36ec",
        "name": "Speech writer",
        "func": "msg.payload = \"Bla bla bla p.\";\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 460,
        "y": 1980,
        "wires": [
            [
                "9eaa8043970cc501"
            ]
        ]
    },
    {
        "id": "0bf1dff3839577f1",
        "type": "wemo-emulator",
        "z": "6efebd3d726e36ec",
        "name": "status",
        "friendlyName": "status",
        "serial": "status",
        "port": "20002",
        "onTopic": "",
        "onPayload": "",
        "offTopic": "",
        "offPayload": "",
        "x": 190,
        "y": 1980,
        "wires": [
            [
                "705589b012bbf679"
            ]
        ]
    },
    {
        "id": "d361aae4a59c7376",
        "type": "alexa-remote-account",
        "name": "",
        "authMethod": "proxy",
        "proxyOwnIp": "192.168.0.76",
        "proxyPort": "3456",
        "cookieFile": "/opt/iobroker/node_modules/node-red ",
        "refreshInterval": "3",
        "alexaServiceHost": "layla.amazon.de",
        "amazonPage": "amazon.de",
        "acceptLanguage": "de-DE",
        "onKeywordInLanguage": "on",
        "userAgent": "",
        "useWsMqtt": "on",
        "autoInit": "on"
    }
]

Can not help with wemo emulator, but node-red-contrib-alexa-remote2-applestrudel is what I use to make alexa speak and many other things. I have had no issues with it.

If you are having issues with wemo node you could try an alternative eg

When I import your snippet I get an unknown alexa-remote-routine in addition to the wemo-emulator node and a function node. Do you mean when you say Alexa is "forgetting" the sensor that the wemo-emulator-node connection between Alexa and the device hosting node red is lost, i.e it stops listening?

I successfully use the wemo-emulator node in my Flows to act as a sensor for the Echo Dot which also acts as a bluetooth speaker, so that I can output an audio response from my Flow. Google Translate is used to convert text to sound which is output as an mp3 and converted by ffmpeg on the fly to a wav piped to aplay. When done on the fly the spaces in the url get request must be replaced by %20 in the msg.payload within the TTS function, and then enclosed in quotes.

image

    {
        "id": "79803ffb071e1fd8",
        "type": "tab",
        "label": "Flow 2",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "9a4d64d7317f7e3e",
        "type": "function",
        "z": "79803ffb071e1fd8",
        "name": "TTS",
        "func": "msg.payload = encodeURIComponent(msg.payload.trim());// replace spaces with %20 for url GET REQUEST\nmsg.url =\"https://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&tl=en&q=\"+msg.payload;\nmsg.payload = \"'\"+msg.url+\"'\";// need enclose REQUEST in quotes\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 430,
        "y": 360,
        "wires": [
            [
                "9a7e4c8373b56a4d"
            ]
        ]
    },
    {
        "id": "9a7e4c8373b56a4d",
        "type": "exec",
        "z": "79803ffb071e1fd8",
        "command": "ffmpeg  -i ",
        "addpay": "payload",
        "append": "-f wav - | DISPLAY=:0 aplay",
        "useSpawn": "false",
        "timer": "",
        "winHide": false,
        "oldrc": false,
        "name": "",
        "x": 580,
        "y": 360,
        "wires": [
            [],
            [],
            []
        ]
    },
    {
        "id": "f38514c21995d062",
        "type": "inject",
        "z": "79803ffb071e1fd8",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "Status ON",
        "payloadType": "str",
        "x": 280,
        "y": 420,
        "wires": [
            [
                "9a4d64d7317f7e3e"
            ]
        ]
    },
    {
        "id": "fab0480cdccd06e6",
        "type": "wemo-emulator",
        "z": "79803ffb071e1fd8",
        "name": "status",
        "friendlyName": "status",
        "serial": "status",
        "port": "34515",
        "onTopic": "",
        "onPayload": "Status ON",
        "offTopic": "",
        "offPayload": "Status OFF",
        "x": 210,
        "y": 360,
        "wires": [
            [
                "9a4d64d7317f7e3e"
            ]
        ]
    },
    {
        "id": "0130ee0e3b36aa83",
        "type": "inject",
        "z": "79803ffb071e1fd8",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "Status OFF",
        "payloadType": "str",
        "x": 270,
        "y": 300,
        "wires": [
            [
                "9a4d64d7317f7e3e"
            ]
        ]
    }
]

Interestingly I too had issues when using Port 20002, as in your example.

Why not just use node-red-contrib-alexa-remote2-applestrudel or similar ?

Why, because it keeps things more local and in my control as there have been so many variant contrib-alexas its hard to know what is reliable, dependable or safe.

Both wemo emulator and alexa-remotes use the same backend to my understanding. So neither is any more local.

My understanding is that the wemo emulator is running on my local device and is accessible on my local network by the Echo device on that network. But the wemo emulator can't access my Echo device. So local control.

My reticence to dive in and use any of the contrib-alexa/echo nodes is that there are so many (17 at last count) to choose from and some are either no longer supported or deprecated. If my understanding how they operate is correct then they are dependent on the developers providing server support and go through Alexa Skills which could potentially allow the nodes to access my Echo device for any nefarious purposes. But I may have got it all wrong and am simply paranoid and naive.

I think I have misunderstood your OG post, I use node-red-contrib-amazon-echo (node) - Node-RED for local emulated devices, it is old but still functional, but i have no gen 4+ amazon devices to check if it works with them.

So my last post was nonsense, my understanding was confused by my misunderstanding of your OG post.

The alexa-remote2-applestrudle is partly based on this bash script alexa-remote-control/README.md at master · thorsten-gehrig/alexa-remote-control · GitHub

I have no problem using "node-red-contrib-alexa-remote2-applestrudel". Actually I was already using it, but I only managed that Alexa speaks for me triggered by Node-Red. But how can I make Alexa trigger Node-Red?

I basically want to ask Alexa "What is my power station currently generating?". That should trigger a specific function in Node-Red, which compiles a string like "It is generating 1500 kW" and make Alexa say that.

I only managed to set up the first part with wemo. As it was creating a sensor which I could add to the Alexa App and write a routine there. But this sensor always "vanished" from the Alexa App after a short while. How can I manage something similar with "node-red-contrib-alexa-remote2-applestrudel"?

Here's a link to a thread I wrote, about 2-years ago, about using Alexa with Node-RED.

Using BluePrints you can capture a response from Alexa and use this trigger a NR flow.

Thanks that worked. But is there a BluePrint without a direct answer from Alexa? I want (and have) to compile the answer with NodeRed first and send that to Alexa.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.