# Building an API interface for airconditioning automation

**URL:** https://discourse.nodered.org/t/building-an-api-interface-for-airconditioning-automation/10277
**Category:** General
**Created:** [17 April 2019 08:44 UTC](https://discourse.nodered.org/t/building-an-api-interface-for-airconditioning-automation/10277 "2019-04-17T08:44:41Z")
**Posts on this page:** 1
**Showing post:** 2

<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: [17 April 2019 09:37 UTC](https://discourse.nodered.org/t/building-an-api-interface-for-airconditioning-automation/10277/2 "2019-04-17T09:37:06Z")

</div>

Since the fun is in the learning (I agree) I have two suggestions for you

1. save the time in milliseconds (see [https://www.w3schools.com/jsref/jsref\_gettime.asp](https://www.w3schools.com/jsref/jsref_gettime.asp))
2. read about context variables in functions (see [https://nodered.org/docs/writing-functions#storing-data](https://nodered.org/docs/writing-functions#storing-data)) and this [A guide to understanding 'Persistent Context'](https://discourse.nodered.org/t/a-guide-to-understanding-persistent-context/4115)

Using miliseconds will made the comparrisons easier and the two links should explain how to save and get the data.

If you have questions after reading them please ask.

"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin

---

_[View the full topic](https://discourse.nodered.org/t/building-an-api-interface-for-airconditioning-automation/10277)._
