I am trying to persuade Alexa to tell me a temperature of a sensor using node-red-contrib-virtual-smart-home.
The sensor is from a Loxone system which displays them on a dashboard ok, but the problem is more basic because the example provided doesn't work either.
where the Inject Node has the code,
and the Alexa node has the following configuration,
But when I ask, "Alexa, What's the temperature of the Pizza Oven", she isn't quite sure what went wrong.
If I check the value in the App, it says 'Waiting for virtual smart home...' forever
Guessing that the non pro version you can not set it to allow alexa to retrieve the state/data.
A work around would be to set a routine to active a virtual device and set a brightness (this allows one virtual device to be set to many routines), you can then use the brightness to filter the action in node-red. You can then use one of the node-red alexa-remote2 nodes to make alexa speak the sensor temp value.
Some more thoughts
What does the device in Alexa app read?
I noticed that you have ignore inbound messages unless "name" matches checked, are you setting name in inbound message?
You could also read through this (and related) thread Pure fun with Alexa and Alexa Skills?
on the Alexa remote Apfelstrudel node which works great for me reading back statuses of all types.
Having checked the Alexa can retrieve device state ("Pro" feature) box and waited 30 seconds, the Alexa App showed the correct value. It didn't show °C, but that's a minor point. However, when I asked Alexa the temperature, she answered with the correct temperature in °F which is odd; all Alexa Apps are set for °C units.
I now have the problem that I can inject a value and have it read out (in °F), but can't find a valid way to format data from a live temperature sensor.
That all works with the change function as described by @E1cid. Thanks again, your help is greatly appreciated.
I copied the change function over to another temp input so I know its identical, but I now have the bizarre situation where one sensor reports temperature in °C, the other in °F verbally, but they both show in the App as °C.
Can anybody help me with that?
Also the App doesn't display the Units and verbally, Alexa only says, "degrees", not C or F.
Is there a way to change this?