# Show a room temperature once first of each month at 00:01

**URL:** <https://discourse.nodered.org/t/show-a-room-temperature-once-first-of-each-month-at-00-01/68762>\
**Category:** Dashboard\
**Tags:** node-red-dashboard\
**Created:** [9 October 2022 13:34 UTC](https://discourse.nodered.org/t/show-a-room-temperature-once-first-of-each-month-at-00-01/68762 "2022-10-09T13:34:52Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nilpferd](https://avatars.discourse-cdn.com/v4/letter/n/db5fbb/32.png) [@Nilpferd](https://discourse.nodered.org/u/Nilpferd)\
**Post date:** [9 October 2022 13:34 UTC](https://discourse.nodered.org/t/show-a-room-temperature-once-first-of-each-month-at-00-01/68762/1 "2022-10-09T13:34:52Z")

</div>

For reason of documentation I have to show a room temperature (rcvd from KNX) at least each first day of the month at 00:01 in the dashboard until the next value will be received next month.  
Inject does not work because there are only days not month, cron plus debugs the fired time but I cannot read and write a KNX input value at this time. I dont know how to wire cronplus to KNX input to write the text to dashboard. Any ideas please

Erwin

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [9 October 2022 13:52 UTC](https://discourse.nodered.org/t/show-a-room-temperature-once-first-of-each-month-at-00-01/68762/2 "2022-10-09T13:52:10Z")

</div>

Can you get it to work with a normal inject? If yes, what do you inject into the KNX node?

Show us what you have so far.

---

<div class="post-metadata">

**Author:** ![Nilpferd](https://avatars.discourse-cdn.com/v4/letter/n/db5fbb/32.png) [@Nilpferd](https://discourse.nodered.org/u/Nilpferd)\
**Post date:** [9 October 2022 14:33 UTC](https://discourse.nodered.org/t/show-a-room-temperature-once-first-of-each-month-at-00-01/68762/3 "2022-10-09T14:33:09Z")

</div>

I thougth this could work:  
 ![test](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/d/bd8e22bdd665c41176c6a211f9433f4048ba05be.jpeg)

[flows.json](https://discourse.nodered.org/uploads/short-url/aQkWqcsog9SGOoRcRchnVhhBlLT.json) (2.1 KB)

but the result ist terrible:

 ![result](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/a/5a1c58f9461a3eb812d0f5294e07cf1461385bf0.jpeg)

Erwin

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [9 October 2022 15:31 UTC](https://discourse.nodered.org/t/show-a-room-temperature-once-first-of-each-month-at-00-01/68762/4 "2022-10-09T15:31:38Z")

</div>

No. That's not how it works. You need to store the temperature value somewhere and then grab it when the cron node fires and use that to display on the dashboard.

Send the temperature to a change node & store it in a flow variable.

Set up the cron nodes' entry Payload to send the flow variable that you set up in the previous step.

---

<div class="post-metadata">

**Author:** ![Nilpferd](https://avatars.discourse-cdn.com/v4/letter/n/db5fbb/32.png) [@Nilpferd](https://discourse.nodered.org/u/Nilpferd)\
**Post date:** [12 October 2022 07:14 UTC](https://discourse.nodered.org/t/show-a-room-temperature-once-first-of-each-month-at-00-01/68762/5 "2022-10-12T07:14:47Z")

</div>

Hi

many thanks. It is working now perfect.

Therefore I want to ask if you can explain me how to show always two values (the value from the last month and the month before).

Erwin

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [12 October 2022 07:25 UTC](https://discourse.nodered.org/t/show-a-room-temperature-once-first-of-each-month-at-00-01/68762/6 "2022-10-12T07:25:17Z")

</div>

On the month output, instead of simply storing `flow.Temperature` do 2 things...

On 1st of month, in the change node (or function node)

1. copy `flow.thisMonthTemp` to `flow.prevMonthTemp`
2. copy `flow.currentTemp` to `flow.thisMonthTemp`

NOTE  
context is NOT persistent by default (e.g. you will lose the stored value if node-red restarts)  
A better solution would be to use a database for storing temperatures every day & use a SQL query to get this/last/last2/last10 months temperatures when ever you want.

Alternatively, you can make context persistent by [use file backed context](https://nodered.org/docs/user-guide/context#saving-context-data-to-the-file-system)

---

<div class="post-metadata">

**Author:** ![Nilpferd](https://avatars.discourse-cdn.com/v4/letter/n/db5fbb/32.png) [@Nilpferd](https://discourse.nodered.org/u/Nilpferd)\
**Post date:** [12 October 2022 10:51 UTC](https://discourse.nodered.org/t/show-a-room-temperature-once-first-of-each-month-at-00-01/68762/7 "2022-10-12T10:51:02Z")

</div>

Thanks. In this case it ist better to show the figures in Grafana, because all values from KNX are copied to a timberwolf server und its database, or get them back from there.

Erwin

---

<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:** [12 October 2022 11:03 UTC](https://discourse.nodered.org/t/show-a-room-temperature-once-first-of-each-month-at-00-01/68762/8 "2022-10-12T11:03:36Z")

</div>

If they are in a database already then presumeably you can read them back from the database in node-red if necessary.

---

<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:** [11 November 2022 11:03 UTC](https://discourse.nodered.org/t/show-a-room-temperature-once-first-of-each-month-at-00-01/68762/9 "2022-11-11T11:03:40Z")

</div>

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