# In HomeyScript eine Logik-Variable ändern?

**URL:** <https://community.homey.app/t/in-homeyscript-eine-logik-variable-andern/38998>\
**Category:** Entwickler\
**Created:** [December 11, 2020, 6:27pm UTC](https://community.homey.app/t/in-homeyscript-eine-logik-variable-andern/38998 "2020-12-11T18:27:24Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [December 11, 2020, 7:28pm UTC](https://community.homey.app/t/in-homeyscript-eine-logik-variable-andern/38998/2 "2020-12-11T19:28:27Z")

</div>

Ich bin fündig geworden…so halb zumindest.

Siehe hier:

> [@Setting Logic Variable by HomeyScript](https://community.homey.app/t/setting-logic-variable-by-homeyscript/14819/8):
>
> @Satoer The good news is, you can make your own variables in HomeyScript and they also can be used in your Flows, here is my example: // my12HoursClock let sys = await Homey.system.getInfo(); var theTime = new Date(sys.date); var theHour = theTime.getHours(); if (theHour \> 12) { theHour = theHour - 12}; await setTagValue("klok12h", {type:"number", title: "Klok12H"}, theHour ); //console.log('TheHour',theHour); return(true); [image]

Mit Logik-Variablen gibt es wohl Probleme. Aber man kann im Skript mit diesem Code ein Tag erstellen, dass man dann im weiteren Flow verwenden kann.  
await setTagValue(“TagName”, {type:“number”, title: “TagBezeichnung”}, Wert );

---

_[View the full topic](https://community.homey.app/t/in-homeyscript-eine-logik-variable-andern/38998)._
