# Automation based on temperature

**URL:** <https://discourse.nodered.org/t/automation-based-on-temperature/35523>\
**Category:** Developing Nodes\
**Created:** [7 November 2020 21:29 UTC](https://discourse.nodered.org/t/automation-based-on-temperature/35523 "2020-11-07T21:29:57Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thomas88103](https://avatars.discourse-cdn.com/v4/letter/t/9fc348/32.png) [@Thomas88103](https://discourse.nodered.org/u/Thomas88103)\
**Post date:** [7 November 2020 21:29 UTC](https://discourse.nodered.org/t/automation-based-on-temperature/35523/1 "2020-11-07T21:29:57Z")

</div>

Hello. I need little help. I wanna do some automation based on outside temperature. I dont have a outside sensor. I mean outside temperature based on weather forecast.  
For example: my heating in bathroom turn on every hour at night and turned off after 30 minutes. It is possible start this automation only if outside temperature will be below 10°C? I know, it is possible for sure but i dont know how to do this. Can you someone point me at the right direction please? Thanks

I'm from Czech so sorry for my english

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [7 November 2020 21:53 UTC](https://discourse.nodered.org/t/automation-based-on-temperature/35523/2 "2020-11-07T21:53:00Z")

</div>

Welcome to the forum @Thomas88103.  
Which bit don't you know how to do? Fetching the outside forecast temperature, working out when the heater should be on, or switching the heater on/off?

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [7 November 2020 21:54 UTC](https://discourse.nodered.org/t/automation-based-on-temperature/35523/3 "2020-11-07T21:54:43Z")

</div>

Welcome to the forum Thomas!

This should be easy to do IF you have the knowledge/hardware to turn the heat on and off. You could use a timer node (like node-red-contrib-cron-plus or node-red-contrib-bigtimer) to run the flow once an hour at night. Then send a request to get the weather and check the value you get back. Then decide if you want to turn the heat on (use a `switch` node) If you want to turn it on, send a msg to a `trigger` which you configure to send a command to turn the heater on, and set the `trigger` node to wait 60 minutes and then send out the command to turn the heater off.

That is one idea of how to do it.

---

<div class="post-metadata">

**Author:** ![Thomas88103](https://avatars.discourse-cdn.com/v4/letter/t/9fc348/32.png) [@Thomas88103](https://discourse.nodered.org/u/Thomas88103)\
**Post date:** [7 November 2020 22:06 UTC](https://discourse.nodered.org/t/automation-based-on-temperature/35523/4 "2020-11-07T22:06:02Z")

</div>

Thanks for welcoming guys. My problem is that i don't know how to send a request for check  
outside temperature

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [7 November 2020 22:11 UTC](https://discourse.nodered.org/t/automation-based-on-temperature/35523/5 "2020-11-07T22:11:01Z")

</div>

take a look at node-red-node-openweathermap

---

<div class="post-metadata">

**Author:** ![Thomas88103](https://avatars.discourse-cdn.com/v4/letter/t/9fc348/32.png) [@Thomas88103](https://discourse.nodered.org/u/Thomas88103)\
**Post date:** [7 November 2020 22:35 UTC](https://discourse.nodered.org/t/automation-based-on-temperature/35523/6 "2020-11-07T22:35:34Z")

</div>

Thanks i will look at this tomorrow. And I will write another problem here. I hope that is no problem. I dont start a new topic unnecessarily.  
I have presence detection for me and my girlfriend. When we both leave house, some defined light a switch turned off. But i want to do this automation little bit smarter. I wanna reach this: we both leave house, node red check which light and switch is on and after that will be turn off everything what  
is on in the house

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [7 November 2020 22:38 UTC](https://discourse.nodered.org/t/automation-based-on-temperature/35523/7 "2020-11-07T22:38:19Z")

</div>

Hi @Thomas88103 if it's a different issue, it would be better to create a new topic, otherwise it gets messy.

---

<div class="post-metadata">

**Author:** ![Thomas88103](https://avatars.discourse-cdn.com/v4/letter/t/9fc348/32.png) [@Thomas88103](https://discourse.nodered.org/u/Thomas88103)\
**Post date:** [7 November 2020 22:42 UTC](https://discourse.nodered.org/t/automation-based-on-temperature/35523/8 "2020-11-07T22:42:20Z")

</div>

Okey. I will create new topic

---

<div class="post-metadata">

**Author:** ![Thomas88103](https://avatars.discourse-cdn.com/v4/letter/t/9fc348/32.png) [@Thomas88103](https://discourse.nodered.org/u/Thomas88103)\
**Post date:** [8 November 2020 14:54 UTC](https://discourse.nodered.org/t/automation-based-on-temperature/35523/9 "2020-11-08T14:54:16Z")

</div>

So now i have installed node-red-node-openweathermap.  
Setting API key and location and i dont know how to continue next

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [8 November 2020 15:23 UTC](https://discourse.nodered.org/t/automation-based-on-temperature/35523/10 "2020-11-08T15:23:49Z")

</div>

> [@Thomas88103](#):
>
> i dont know how to continue next

Are you able to get the data from it? If not what have you tried that is not working. If you are an absolute beginner with node-red I suggest you watch the Node-red Essentials videos which are linked from the node-red docs. An hour spent doing that will save you time very quickly.

---

<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:** [7 January 2021 15:23 UTC](https://discourse.nodered.org/t/automation-based-on-temperature/35523/11 "2021-01-07T15:23:59Z")

</div>

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