# Asking Alexa to read out a temperature

**URL:** <https://discourse.nodered.org/t/asking-alexa-to-read-out-a-temperature/90126>\
**Category:** General\
**Created:** [12 August 2024 11:11 UTC](https://discourse.nodered.org/t/asking-alexa-to-read-out-a-temperature/90126 "2024-08-12T11:11:13Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![SomersetSmartHome](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@SomersetSmartHome](https://discourse.nodered.org/u/SomersetSmartHome)\
**Post date:** [12 August 2024 11:11 UTC](https://discourse.nodered.org/t/asking-alexa-to-read-out-a-temperature/90126/1 "2024-08-12T11:11:13Z")

</div>

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.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/8/4846156118002281ea2ef579c02d14b4fbf1ea65.png)

where the Inject Node has the code,

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/c/0ce56933c8abc24cbe1ce621b38af313856e731c.png)

and the Alexa node has the following configuration,

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/b/fb2f3c1a4b39438106eeb8eebb0cb146a6fad213.png)

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

Any help appreciated, thanks.

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [12 August 2024 11:18 UTC](https://discourse.nodered.org/t/asking-alexa-to-read-out-a-temperature/90126/2 "2024-08-12T11:18:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![SomersetSmartHome](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@SomersetSmartHome](https://discourse.nodered.org/u/SomersetSmartHome)\
**Post date:** [12 August 2024 11:49 UTC](https://discourse.nodered.org/t/asking-alexa-to-read-out-a-temperature/90126/3 "2024-08-12T11:49:25Z")

</div>

Thanks for your reply @E1cid but just to be clear, I do have the PRO plan active...

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [12 August 2024 12:02 UTC](https://discourse.nodered.org/t/asking-alexa-to-read-out-a-temperature/90126/4 "2024-08-12T12:02:25Z")

</div>

I assumed you did not have pro as you did not enable retrieve device state in the config. I totally missed the green shaded box that said `PRO` though.

---

<div class="post-metadata">

**Author:** ![SomersetSmartHome](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@SomersetSmartHome](https://discourse.nodered.org/u/SomersetSmartHome)\
**Post date:** [12 August 2024 12:11 UTC](https://discourse.nodered.org/t/asking-alexa-to-read-out-a-temperature/90126/5 "2024-08-12T12:11:22Z")

</div>

Fair point, @E1cid

I've enabled that and now get a temperature returned. It's currently 0°C and not 220°C which is what I'm injecting, but that's progress, thanks.

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [12 August 2024 13:50 UTC](https://discourse.nodered.org/t/asking-alexa-to-read-out-a-temperature/90126/6 "2024-08-12T13:50:17Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Johnnybegoode](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/johnnybegoode/32/88032_2.png) [@Johnnybegoode](https://discourse.nodered.org/u/Johnnybegoode)\
**Post date:** [12 August 2024 13:58 UTC](https://discourse.nodered.org/t/asking-alexa-to-read-out-a-temperature/90126/7 "2024-08-12T13:58:17Z")

</div>

You could also read through this (and related) thread  
[Pure fun with Alexa and Alexa Skills](https://discourse.nodered.org/t/pure-fun-with-alexa-and-alexa-skills/46867)?  
on the Alexa remote Apfelstrudel node which works great for me reading back statuses of all types.

---

<div class="post-metadata">

**Author:** ![SomersetSmartHome](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@SomersetSmartHome](https://discourse.nodered.org/u/SomersetSmartHome)\
**Post date:** [13 August 2024 19:51 UTC](https://discourse.nodered.org/t/asking-alexa-to-read-out-a-temperature/90126/8 "2024-08-13T19:51:37Z")

</div>

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.

I have the following Flow,

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/c/ccfe25912ce0e6559fbf9cf2d1fbc0a647e59b7c.png)

with **Scale in Celsius** configured as follows;

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/1/c121e7df44cd12c3130a87c8fa93e0b67c7a8b6a.png)

which works fine, but I can't work out how to transform **msg.payload** into **msg.payload.temperature** in the same way in the Inject node does.

Any help with any of these questions greatly appreciated, as always, thanks.

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [13 August 2024 20:56 UTC](https://discourse.nodered.org/t/asking-alexa-to-read-out-a-temperature/90126/9 "2024-08-13T20:56:15Z")

</div>

In a change node move msg.payload to msg.payload.temperature, in the next rule set msg.payload.scale to "CELSIUS"

---

<div class="post-metadata">

**Author:** ![SomersetSmartHome](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@SomersetSmartHome](https://discourse.nodered.org/u/SomersetSmartHome)\
**Post date:** [14 August 2024 09:10 UTC](https://discourse.nodered.org/t/asking-alexa-to-read-out-a-temperature/90126/10 "2024-08-14T09:10:14Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [12 November 2024 09:10 UTC](https://discourse.nodered.org/t/asking-alexa-to-read-out-a-temperature/90126/11 "2024-11-12T09:10:18Z")

</div>

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