# Variable Time in "Get history node" home assitant in node red

**URL:** https://discourse.nodered.org/t/variable-time-in-get-history-node-home-assitant-in-node-red/43795
**Category:** Developing Nodes
**Created:** [7 April 2021 05:43 UTC](https://discourse.nodered.org/t/variable-time-in-get-history-node-home-assitant-in-node-red/43795 "2021-04-07T05:43:51Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![kizovinh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kizovinh/32/39896_2.png) [@kizovinh](https://discourse.nodered.org/u/kizovinh)
#### Post date: [7 April 2021 05:43 UTC](https://discourse.nodered.org/t/variable-time-in-get-history-node-home-assitant-in-node-red/43795/1 "2021-04-07T05:43:51Z")

</div>

I want to pass a numeric variable from subflow instance into the "get history node", this is what I did, everything is fine with other attributes, except the timestring. I tried {{payload.time\_check}} but no luck, it didn't give any output. If I fill a number directly in this box, it work well.  
What should I do, please help me.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/9/39ff4136321089785847a36645ee2112e45bd6c0.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/6/16b1efc5d844b036eb97eb972e37cb588726d723.png)

---

<div class="post-metadata">

### Author: ![chrisn-au](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/chrisn-au/32/25504_2.png) [@chrisn-au](https://discourse.nodered.org/u/chrisn-au)
#### Post date: [7 April 2021 06:21 UTC](https://discourse.nodered.org/t/variable-time-in-get-history-node-home-assitant-in-node-red/43795/2 "2021-04-07T06:21:07Z")

</div>

Hi,

I suspect the problem is that time\_check is not set correctly in the env. How is it being set ?

---

<div class="post-metadata">

### Author: ![kizovinh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kizovinh/32/39896_2.png) [@kizovinh](https://discourse.nodered.org/u/kizovinh)
#### Post date: [7 April 2021 08:08 UTC](https://discourse.nodered.org/t/variable-time-in-get-history-node-home-assitant-in-node-red/43795/4 "2021-04-07T08:08:00Z")

</div>

I passed it as a number, and also use node.warn() to display it.  
I converted the env into "time\_check" var as shown on the picture above, this function node is right before the get history node

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

---

<div class="post-metadata">

### Author: ![kizovinh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kizovinh/32/39896_2.png) [@kizovinh](https://discourse.nodered.org/u/kizovinh)
#### Post date: [1 May 2021 03:07 UTC](https://discourse.nodered.org/t/variable-time-in-get-history-node-home-assitant-in-node-red/43795/5 "2021-05-01T03:07:22Z")

</div>

Am i wrong?

---

<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: [30 June 2021 03:07 UTC](https://discourse.nodered.org/t/variable-time-in-get-history-node-home-assitant-in-node-red/43795/6 "2021-06-30T03:07:32Z")

</div>

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