Using Node-Red for Google Home TTS announcements and other stuff eWeLink

So this is how I have been getting a Vera scene to do something in node-red.

In this example it sends a TTS to a Google Home speaker, using the node-red-contrib-cast

image

HTTP IN node:

Method is GET
URL: /whatever-you-want

image

Template Node:

Text “OK” response

image

HTTP Response node:

Status Code = 200

image

Cast Node:

Send TTS to a Google Home speaker

So in the actual Vera scene under “Also, execute the following Luup code:”

Send the http command to node-red e.g.

luup.inet.wget("http://NODE-RED-IP:1880/doorbellstatus")

Where “/doorbellstatus” = URL: /whatever-you-want

What you specified the URL as in the “http in” node.

So when you run the Vera scene the URL is sent to node-red and any associated actions in node-red will be carried out.

[
    {
        "id": "f31a24e4.03ee28",
        "type": "tab",
        "label": "Example",
        "disabled": false,
        "info": ""
    },
    {
        "id": "c527d842.2b01f8",
        "type": "http in",
        "z": "f31a24e4.03ee28",
        "name": "",
        "url": "/DoorbellStatus",
        "method": "get",
        "upload": false,
        "swaggerDoc": "",
        "x": 170,
        "y": 120,
        "wires": [
            [
                "a27eaf28.e4129",
                "7a05c16a.a6f9c"
            ]
        ]
    },
    {
        "id": "a27eaf28.e4129",
        "type": "template",
        "z": "f31a24e4.03ee28",
        "name": "OK",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "OK",
        "output": "str",
        "x": 390,
        "y": 120,
        "wires": [
            [
                "6d6b7614.f6fa78"
            ]
        ]
    },
    {
        "id": "6d6b7614.f6fa78",
        "type": "http response",
        "z": "f31a24e4.03ee28",
        "name": "",
        "statusCode": "200",
        "headers": {},
        "x": 560,
        "y": 120,
        "wires": []
    },
    {
        "id": "7a05c16a.a6f9c",
        "type": "cast-to-client",
        "z": "f31a24e4.03ee28",
        "name": "Lounge-Mini-TTS",
        "url": "",
        "contentType": "",
        "message": "There is someone at the door",
        "language": "en",
        "ip": "192.168.1.16",
        "port": "8009",
        "volume": "",
        "x": 430,
        "y": 160,
        "wires": [
            []
        ],
        "icon": "node-red-contrib-cast/google-home-mini2.svg"
    },
    {
        "id": "bc713fcb.51821",
        "type": "comment",
        "z": "f31a24e4.03ee28",
        "name": "HTTP IN Endpoint",
        "info": "",
        "x": 170,
        "y": 80,
        "wires": []
    }
]