# Setting Logic Variable by HomeyScript

**URL:** <https://community.homey.app/t/setting-logic-variable-by-homeyscript/14819>\
**Category:** Questions & Help\
**Created:** [June 25, 2019, 3:11pm UTC](https://community.homey.app/t/setting-logic-variable-by-homeyscript/14819 "2019-06-25T15:11:16Z")\
**Posts on this page:** 1\
**Showing post:** 37

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [May 3, 2022, 3:40pm UTC](https://community.homey.app/t/setting-logic-variable-by-homeyscript/14819/37 "2022-05-03T15:40:45Z")

</div>

Yes, since v7.4.x-RC firmware. You can actually write to logics vars. Reading vars was possible already if I’m correct.

 ![Screenshot_20220503-174001_Chrome](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/e/ce0a8b88438bce72a3f00e9f66fc6255bfada968.jpeg)

Here’s some how-to

> [@DIY circadian rhythm based lighting](https://community.homey.app/t/diy-circadian-rhythm-based-lighting/33348/37):
>
> It should be something like this with Logics variables. (First create the variables, and then go [find the variable ID’s](https://community.homey.app/t/diy-circadian-rhythm-based-lighting/33348/36) ) // This is not needed anylonger, so comment out or remove //let BLApp = await Homey.apps.getApp({ id: 'net.i-dev.betterlogic' }); //BLApp.apiPut(`${VARIABLE_PREFIX}temperature/${temperature}`); await Homey.logic.updateVariable({id: '1a164078-63fc-470c-ac76-9da7f113445e', variable: { value: temperature } }) // The example ID should be the ID from var '${VARIABLE\_PREFIX}\_tem…

---

_[View the full topic](https://community.homey.app/t/setting-logic-variable-by-homeyscript/14819)._
