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

put a debug on the node and output full msg. post the error.
as the config looks correct

on another note-
If you send url like this -
http://192.168.0.2:1880/scenetrigger?message=TEST&ip=192.168.0.16

there is no need for the function node, as the object should be as needed.

Yes also I got rid of the TTSmessage and changed it to just be message

http://192.168.0.2:1880/scenetrigger?message=TEST&ip=192.168.0.16

image

Do you think I could send two IP addresses ? I guess I’d have to have two Cast nodes.

Just wondering if you could send a TTS to two Cast devices at the same time etc.

Its a configurable node and most of it can inputs can be sent direct from url if the are the same names as the above list in the image you posted.

1 Like

As is no it looks like it only accepts 1 ip.

You may be able to use the function node to send multiple messages with a little coding.

https://nodered.org/docs/user-guide/writing-functions

so if the function recieved an list of ip’s it could split them and send multiple messages

Your right you don’t need the function node, it works without it.

Assuming you are only sending one IP address etc.

Glad its working . if you need more help just ask .

1 Like

I think you could put the cast in the flow and the response would report any errors back to the vera log.

Be sure not to delete msg.res when messing wit msg,as it is needed for the response node

If I put the cast node in the flow, it still works but the web browser now gives this as a response.

https://translate.google.com/translate_tts?ie=UTF-8&q=TEST&tl=en&total=1&idx=0&textlen=4&tk=635224.986606&client=t&prev=input&ttsspeed=1

If the cast node is not in the flow this is the response:

{“message”:“TEST”,“ip”:“192.168.0.16”}

Doesn’t really matter either way.

debug the output from the cast node full msg
never mind
the cast node is outputing msg.payload you can change that to any thing you wish by using function or template.

1 Like

The cast is also over writing msg.res from the http in node. That is causing the errors. you will have to remove the cast from the direct flow.

Looks better that way.

Before the dynamic TTS you helped me setup.

In node-red I had loads of different HTTP IN nodes with different URLs and then loads of different cast nodes and I was specifying the different TTS message text under each cast node etc.
I was then sending the different URLs from different scenes in Vera etc.

This is much better now with a dynamic setup. Means I have a lot less stuff in node-red and also I now can specify the TTS message text in the Vera scenes.

Well pleased thanks for your help !

This is was what I was doing previously before the dynamic:

you can also have just one http in node.

The path can be fully specified, such as /user , or include named parameters that accept any value, such as /user/:name . When named parameters are used, their actual value in a request can be accessed under msg.req.params .

You could then use a switch node to direct to different flows using msg.req.params

I was wondering about device nodes. MIOS IN nodes.

This is what I am doing currently for device nodes.

For example when a door sensor opens / closes

image

Sounds interesting but probably above my skill level to figure out LOL.

In mios in node
Leave the item field empty and attach a debug to see the result of turning on and off a switch.

you could do all that with
mios in - function - cast
You would need to do all the work in the function node.

You would probably find it easier to set up Reactor notify http activitiy, to send http request when switches are turned on or off, using the scene flow we just got working.

Turned on / off an appliance plug

Lounge:Fan:Target : msg.payload : boolean
true

Lounge:Fan:Target : msg.payload : boolean
false