# How to log events in HomeyScript and how to retrieve them

**URL:** <https://community.homey.app/t/how-to-log-events-in-homeyscript-and-how-to-retrieve-them/155829>\
**Category:** Apps\
**Tags:** app\
**Created:** [June 5, 2026, 8:17pm UTC](https://community.homey.app/t/how-to-log-events-in-homeyscript-and-how-to-retrieve-them/155829 "2026-06-05T20:17:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rogier\_Berkenhagen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rogier_berkenhagen/32/121273_2.png) [@Rogier\_Berkenhagen](https://community.homey.app/u/Rogier_Berkenhagen)\
**Post date:** [June 5, 2026, 8:17pm UTC](https://community.homey.app/t/how-to-log-events-in-homeyscript-and-how-to-retrieve-them/155829/1 "2026-06-05T20:17:45Z")

</div>

in a HomeyScript I use

console.log(msg) ;

to log the steps in the script. This works for testing, but how can I log the same messages during live runs and how to see them?

---

<div class="post-metadata">

**Author:** ![smarthomesven](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/smarthomesven/32/79712_2.png) [@smarthomesven](https://community.homey.app/u/smarthomesven)\
**Post date:** [June 5, 2026, 8:26pm UTC](https://community.homey.app/t/how-to-log-events-in-homeyscript-and-how-to-retrieve-them/155829/2 "2026-06-05T20:26:22Z")

</div>

You should use an external (cloud) service, maybe a simple Vercel function + Turso DB (free) and POST it with fetch. There is no built in method at least

---

<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:** [June 5, 2026, 11:56pm UTC](https://community.homey.app/t/how-to-log-events-in-homeyscript-and-how-to-retrieve-them/155829/3 "2026-06-05T23:56:50Z")

</div>

You can save the msg to a Homeyscript tag; these tags are available to use in, like, notification cards, Simple Log app cards and such.  
As shown in the examole scripts:

 ![Screenshot_20260606_014415_Vivaldi](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/5/5538a6c5bfc4d992cffd1b8d0297090b7c818d0c.jpeg)

Another way is to write directly to such a flow card.  
Code snippet:

```auto

if(windowOpen == true)
windowText = "\nThese windows are open:\n" + windowText + "\n";
else
// comment this out if you don't want a msg when all's fine:
windowText = "All windows are closed.";

Homey.flow.runFlowCardAction({
        uri: 'homey:manager:notifications',
        id: 'create_notification',
        args: {
          text: String(windowText) + '\n[Source: Hscript window_open.js]'
        },
      });

```

---

<div class="post-metadata">

**Author:** ![Rogier\_Berkenhagen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rogier_berkenhagen/32/121273_2.png) [@Rogier\_Berkenhagen](https://community.homey.app/u/Rogier_Berkenhagen)\
**Post date:** [June 8, 2026, 8:31am UTC](https://community.homey.app/t/how-to-log-events-in-homeyscript-and-how-to-retrieve-them/155829/4 "2026-06-08T08:31:15Z")

</div>

Thanks, I will go for this solution.
