Help configuring NORA & Google Assistant (Smart Speaker)

I have a load of urls that I use to switch lights on and off (not MQTT).

eg I can turn the desk lamp on and off with these urls in a browser.

Desk light on http:// 192.168.1.50/?s1-2on
Desk light off http://192.168.1.50/?s1-2off

I have a WAN url for each also so firewall is not an issue.

Heres what I have done so far

  • got a nora token from https://node-red-google-home.herokuapp.com
  • connected the NORA node to the nora token for the desk lamp
  • attached a debug to the right of the NORA node and connected it
  • added the desk lamp inside google home app

The smart speaker now recognises the "turn the desk light on" command, but does nothing.

Which nodes do I need and in which order,
how to configure them?

You need to link the msg payload from nora node to a http request node. Using the url on and off for the request depending on the command from nora node.

1 Like

Thank you.

I got this working. Here is my flow for one switch, see attached below.

Is there a better way than the way I have done it?

I thought initially I would be able to do this with

  • one "nora node" +
  • one "switch" node +
  • one "http request" node,

but that does not seem to have been possible.

I had to do it using the attached flow.

Also get the error "HPE_INVALID CONSTANT" where I have an "=" sign in the http request node url, but in no other nora switches I have set up. Only the ones where there is an "=" sign present in the switching url.

Any ideas how to rectify this?

[
{
"id": "16e84b2c.5323c5",
"type": "nora-switch",
"z": "f440e23a.0f852",
"devicename": "heating",
"roomhint": "heating",
"name": "",
"passthru": true,
"nora": "e4e5eabd.fd4b28",
"topic": "",
"onvalue": "on",
"onvalueType": "str",
"offvalue": "off",
"offvalueType": "str",
"x": 280,
"y": 1720,
"wires": [
[
"9e08e6e0.5f4aa8"
]
]
},
{
"id": "9e08e6e0.5f4aa8",
"type": "switch",
"z": "f440e23a.0f852",
"name": "choose url",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "on",
"vt": "str"
},
{
"t": "eq",
"v": "off",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 430,
"y": 1720,
"wires": [
[
"c40c9bfe.46c648"
],
[
"bbddb266.bed9d"
]
]
},
{
"id": "bbddb266.bed9d",
"type": "http request",
"z": "f440e23a.0f852",
"name": "heating off",
"method": "POST",
"ret": "txt",
"paytoqs": "ignore",
"url": "http: //my-ip-address/?pin=Off",
"tls": "",
"persist": false,
"proxy": "",
"authType": "",
"x": 590,
"y": 1760,
"wires": [

]
},
{
"id": "c40c9bfe.46c648",
"type": "http request",
"z": "f440e23a.0f852",
"name": "heating on",
"method": "POST",
"ret": "txt",
"paytoqs": "ignore",
"url": "http ://my-ip-address/?pin=On ",
"tls": "",
"persist": false,
"proxy": "",
"authType": "",
"x": 590,
"y": 1720,
"wires": [

]
},
{
"id": "8005bf8a.3ab1",
"type": "inject",
"z": "f440e23a.0f852",
"name": "on",
"props": [
{> [
{
"id": "16e84b2c.5323c5",
"type": "nora-switch",
"z": "f440e23a.0f852",
"devicename": "heating",
"roomhint": "heating",
"name": "",
"passthru": true,
"nora": "e4e5eabd.fd4b28",
"topic": "",
"onvalue": "on",
"onvalueType": "str",
"offvalue": "off",
"offvalueType": "str",
"x": 280,
"y": 1720,
"wires": [
[
"9e08e6e0.5f4aa8"
]
]
},
{
"id": "9e08e6e0.5f4aa8",
"type": "switch",
"z": "f440e23a.0f852",
"name": "choose url",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "on",
"vt": "str"
},
{
"t": "eq",
"v": "off",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 430,
"y": 1720,
"wires": [
[
"c40c9bfe.46c648"
],
[
"bbddb266.bed9d"
]
]
},
{
"id": "bbddb266.bed9d",
"type": "http request",
"z": "f440e23a.0f852",
"name": "heating off",
"method": "POST",
"ret": "txt",
"paytoqs": "ignore",
"url": "http: //my-ip-address/?pin=Off",
"tls": "",
"persist": false,
"proxy": "",
"authType": "",
"x": 590,
"y": 1760,
"wires": [

]
},
{
"id": "c40c9bfe.46c648",
"type": "http request",
"z": "f440e23a.0f852",
"name": "heating on",
"method": "POST",
"ret": "txt",
"paytoqs": "ignore",
"url": "http ://my-ip-address/?pin=On ",
"tls": "",
"persist": false,
"proxy": "",
"authType": "",
"x": 590,
"y": 1720,
"wires": [

]
},
{
"id": "8005bf8a.3ab1",
"type": "inject",
"z": "f440e23a.0f852",
"name": "on",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "on",
"payloadType": "str",
"x": 150,
"y": 1720,
"wires": [
[
"16e84b2c.5323c5"
]
]
},
{
"id": "f8715778.f830f8",
"type": "inject",
"z": "f440e23a.0f852",
"name": "off",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "off",
"payloadType": "str",
"x": 150,
"y": 1760,
"wires": [
[
"16e84b2c.5323c5"
]
]
},
{
"id": "f762491e.35d988",
"type": "comment",
"z": "f440e23a.0f852",
"name": "heating on / off",
"info": "",
"x": 160,
"y": 1680,
"wires":
},
{
"id": "e4e5eabd.fd4b28",
"type": "nora-config",
"name": "heating",
"group": "heating",
"notify": false
}
]
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "on",
"payloadType": "str",
"x": 150,
"y": 1720,
"wires": [
[
"16e84b2c.5323c5"
]
]
},
{
"id": "f8715778.f830f8",
"type": "inject",
"z": "f440e23a.0f852",
"name": "off",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "off",
"payloadType": "str",
"x": 150,
"y": 1760,
"wires": [
[
"16e84b2c.5323c5"
]
]
},
{
"id": "f762491e.35d988",
"type": "comment",
"z": "f440e23a.0f852",
"name": "heating on / off",
"info": "",
"x": 160,
"y": 1680,
"wires":
},
{
"id": "e4e5eabd.fd4b28",
"type": "nora-config",
"name": "heating",
"group": "heating",
"notify": false
}
]

please edit your post, place the code between backticks like below
```
code
```
then i can import easily and check it for you.

1 Like
[
    {
        "id": "16e84b2c.5323c5",
        "type": "nora-switch",
        "z": "f440e23a.0f852",
        "devicename": "heating",
        "roomhint": "heating",
        "name": "",
        "passthru": true,
        "nora": "e4e5eabd.fd4b28",
        "topic": "",
        "onvalue": "on",
        "onvalueType": "str",
        "offvalue": "off",
        "offvalueType": "str",
        "x": 280,
        "y": 1720,
        "wires": [
            [
                "9e08e6e0.5f4aa8"
            ]
        ]
    },
    {
        "id": "9e08e6e0.5f4aa8",
        "type": "switch",
        "z": "f440e23a.0f852",
        "name": "choose url",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "on",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "off",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 430,
        "y": 1720,
        "wires": [
            [
                "c40c9bfe.46c648"
            ],
            [
                "bbddb266.bed9d"
            ]
        ]
    },
    {
        "id": "bbddb266.bed9d",
        "type": "http request",
        "z": "f440e23a.0f852",
        "name": "heating off",
        "method": "POST",
        "ret": "txt",
        "paytoqs": "ignore",
        "url": "http:// my-ip-address/?pin=Off",
        "tls": "",
        "persist": false,
        "proxy": "",
        "authType": "",
        "x": 590,
        "y": 1760,
        "wires": [
            []
        ]
    },
    {
        "id": "c40c9bfe.46c648",
        "type": "http request",
        "z": "f440e23a.0f852",
        "name": "heating on",
        "method": "POST",
        "ret": "txt",
        "paytoqs": "ignore",
        "url": "http:// my-ip-address/?pin=On  ",
        "tls": "",
        "persist": false,
        "proxy": "",
        "authType": "",
        "x": 590,
        "y": 1720,
        "wires": [
            []
        ]
    },
    {
        "id": "8005bf8a.3ab1",
        "type": "inject",
        "z": "f440e23a.0f852",
        "name": "on",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "on",
        "payloadType": "str",
        "x": 150,
        "y": 1720,
        "wires": [
            [
                "16e84b2c.5323c5"
            ]
        ]
    },
    {
        "id": "f8715778.f830f8",
        "type": "inject",
        "z": "f440e23a.0f852",
        "name": "off",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "off",
        "payloadType": "str",
        "x": 150,
        "y": 1760,
        "wires": [
            [
                "16e84b2c.5323c5"
            ]
        ]
    },
    {
        "id": "f762491e.35d988",
        "type": "comment",
        "z": "f440e23a.0f852",
        "name": "heating   on / off",
        "info": "",
        "x": 160,
        "y": 1680,
        "wires": []
    },
    {
        "id": "e4e5eabd.fd4b28",
        "type": "nora-config",
        "name": "heating",
        "group": "heating",
        "notify": false
    }
]

I do not use nora, so can i have a debug of the full msg ouput after the nora node? i need to know what the message structure is.

Also a screen shot of the nora node settings.

1 Like

28/10/2020, 12:45:34node: heating on
msg : error
"Error: Parse Error: Expected HTTP/"

28/10/2020, 12:45:34node: heating_on
msg.payload : string[71]
"Error: Parse Error: Expected HTTP/ : http:// my-ip-address/?pin=On"

28/10/2020, 12:45:35node: heating off
msg : error
"Error: Parse Error: Expected HTTP/"

28/10/2020, 12:45:35node: heating_off
msg.payload : string[72]
"Error: Parse Error: Expected HTTP/ : http:// my-ip-address/?pin=Off"

That is after heating off , i need the msg after nora node, add a debug there and output full message object.

1 Like

These are errors as you have a space in your http request url's. Once you fix that you will get error as the domain name does not resolve, you will need to ad the real IP.

1 Like

28/10/2020, 13:02:18node: nora node
msg.payload : string[2]
"on"

28/10/2020, 13:02:18node: choose_url
msg.payload : string[2]
"on"

28/10/2020, 13:02:18node: heating on
msg : error
"Error: Parse Error: Expected HTTP/"

28/10/2020, 13:02:18node: heating_on
msg.payload : string[71]
"Error: Parse Error: Expected HTTP/ : http:// my-ip-address/?pin=On"

28/10/2020, 13:02:23node: nora node
msg.payload : string[3]
"off"

28/10/2020, 13:02:23node: choose_url
msg.payload : string[3]
"off"

28/10/2020, 13:02:23node: heating off
msg : error
"Error: Parse Error: Expected HTTP/"

28/10/2020, 13:02:23node: heating_off
msg.payload : string[72]
"Error: Parse Error: Expected HTTP/ : http:// my-ip-address/?pin=Off"

That is not the full message, i asked you to set the debug node to the full message object. , i do not need other nodes, this just creates clutter. Just post what i ask for please.

1 Like

The space in the url is simply there becasue I got tired of being told I was posting more than 2 links in a post.
So I just post all my links anyway but add a space somewhere in them before I post.
There is no space in the original flow json or the debug messages that contain any url.

I still need to see the screen shot of nora settings and a full debug message of the nora node output.

1 Like

Ok that helps i can edit you flow and make it more dynamic.
I will have to guess what the full output of nora message is.

Ps delete that first image as it has you api key in.

1 Like

Here is the nora output with full flow:

28/10/2020, 13:20:30 node: nora node
msg : Object
{ _msgid: "b312d3e3.a8b5b", payload: "on", topic: "" }

28/10/2020, 13:20:30 node: heating on
msg : error
"Error: Parse Error: Expected HTTP/"

[{"id":"fc2d2694.c41828","type":"inject","z":"8d22ae29.7df6d","name":"on","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"http://my-ip-address/?pin=","payload":"on","payloadType":"str","x":170,"y":3460,"wires":[["ae7e9c93.65c528"]]},{"id":"d094cd26.487908","type":"inject","z":"8d22ae29.7df6d","name":"off","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"http://my-ip-address/?pin=","payload":"off","payloadType":"str","x":170,"y":3500,"wires":[["ae7e9c93.65c528"]]},{"id":"ae7e9c93.65c528","type":"change","z":"8d22ae29.7df6d","name":"","rules":[{"t":"set","p":"url","pt":"msg","to":"topic & (payload = \"on\" ? \"On\" : \"Off\")","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":3440,"wires":[["6b9f677c.0a0c68"]]},{"id":"6b9f677c.0a0c68","type":"http request","z":"8d22ae29.7df6d","name":"heating on","method":"POST","ret":"txt","paytoqs":"ignore","url":" ","tls":"","persist":false,"proxy":"","authType":"","x":580,"y":3440,"wires":[[]]}]

ok you set the url in the topic of the nora node, like i have done in the inject node. As i do not have nora installed

1 Like

Thank you for you're help.

I loaded up your flow, thanks.

I tried setting the topic in my flow, in the nora node, in the way you have suggested.

The url placed in the nora topic does not pass through, at all, to the http request node, no matter what I set it to.

A full debug shows nothing, ie, topic: "", no matter what the topic is.

I will have to have a further investigation then come back after a think.

The inject nodes on the left are only used to test the set-up works.

show screenshot of nora topic setting

1 Like

2020-10-28__Wed__13:53:23

2020-10-28__Wed__13:52:13
2020-10-28__Wed__13:58:44