# Homeyscript hdashboard trash reminder

**URL:** <https://community.homey.app/t/homeyscript-hdashboard-trash-reminder/145657>\
**Category:** Questions & Help\
**Created:** [November 21, 2025, 9:43am UTC](https://community.homey.app/t/homeyscript-hdashboard-trash-reminder/145657 "2025-11-21T09:43:15Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![M\_J](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/m_j/32/81222_2.png) [@M\_J](https://community.homey.app/u/M_J)\
**Post date:** [November 21, 2025, 9:43am UTC](https://community.homey.app/t/homeyscript-hdashboard-trash-reminder/145657/1 "2025-11-21T09:43:15Z")

</div>

Hello all,

I’m trying to setup a trash reminder in hdashboards.

I have copy and paste a tutorial script into homeyscript and make a textfield into device capabilities app (with repair).

When i run the flow i got a error that homey can’t create a tag from path PMD.

What i’m doing wrong?

 ![Schermafbeelding 2025-11-21 103432](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/5/455ef1196d15b9272337f9cefac8d6388d0b0b29.png)

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/c/6c99f128b234709a83160a2446db5b1d55a43afd.png)

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/d/dd80fb7db6549a21c83d52946496c8fae640ad58.png)

---

<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:** [November 21, 2025, 10:21am UTC](https://community.homey.app/t/homeyscript-hdashboard-trash-reminder/145657/2 "2025-11-21T10:21:30Z")

</div>

You aren’t returning anything in that script, so it gets the information and then does nothing else with it? Add `return jsonOutput;` to the end of the script.

Edit: I mean to the end of the `try` code block

---

<div class="post-metadata">

**Author:** ![M\_J](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/m_j/32/81222_2.png) [@M\_J](https://community.homey.app/u/M_J)\
**Post date:** [November 21, 2025, 10:38am UTC](https://community.homey.app/t/homeyscript-hdashboard-trash-reminder/145657/3 "2025-11-21T10:38:54Z")

</div>

> [@smarthomesven](#):
>
> return jsonOutput;

You mean like this:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/9/d91f94e7982f04efb52d6565153fbf0ca3e85e15.png)

---

<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:** [November 21, 2025, 10:42am UTC](https://community.homey.app/t/homeyscript-hdashboard-trash-reminder/145657/4 "2025-11-21T10:42:10Z")

</div>

It should be below the `const jsonOutput = JSON.stringify(nextCollectionDays, null, 2);` line.

---

<div class="post-metadata">

**Author:** ![M\_J](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/m_j/32/81222_2.png) [@M\_J](https://community.homey.app/u/M_J)\
**Post date:** [November 21, 2025, 10:50am UTC](https://community.homey.app/t/homeyscript-hdashboard-trash-reminder/145657/5 "2025-11-21T10:50:01Z")

</div>

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/a/4a35f65025f72f4f99053f53ed871765eee20eae.png)

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/2/e2ce5e80f55abc9e35a1ac02f168c96180b7c8ec.png)

Seems like it’s not on the right place

i’m sorry i never worked with homeyscript.

---

<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:** [November 21, 2025, 10:55am UTC](https://community.homey.app/t/homeyscript-hdashboard-trash-reminder/145657/6 "2025-11-21T10:55:09Z")

</div>

Replace the `return jsonOutput;` with

```auto
if (jsonOutput) {
  return jsonOutput;
} else {
  console.error("jsonOutput is not defined");
}

```

Also, add `console.log("Response: ", response);` under the `if (!res.ok) { console.error('Error: ${res.status} - ${res.statustext}'); return; }` line.

This way you can easily check which part isn’t working correctly

---

<div class="post-metadata">

**Author:** ![M\_J](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/m_j/32/81222_2.png) [@M\_J](https://community.homey.app/u/M_J)\
**Post date:** [November 21, 2025, 11:03am UTC](https://community.homey.app/t/homeyscript-hdashboard-trash-reminder/145657/7 "2025-11-21T11:03:25Z")

</div>

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/4/e47591bae752859913ccc36a3b15067dc534bcb3.png)

---

<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:** [November 21, 2025, 11:08am UTC](https://community.homey.app/t/homeyscript-hdashboard-trash-reminder/145657/8 "2025-11-21T11:08:40Z")

</div>

Remove the `return jsonOutput;` that is under the `const res = await fetch(url, { method: "GET", headers: { "Content-Type": "application/json", "Authorization": `Bearer ${API_KEY}` } });` line.

---

<div class="post-metadata">

**Author:** ![M\_J](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/m_j/32/81222_2.png) [@M\_J](https://community.homey.app/u/M_J)\
**Post date:** [November 21, 2025, 11:14am UTC](https://community.homey.app/t/homeyscript-hdashboard-trash-reminder/145657/9 "2025-11-21T11:14:15Z")

</div>

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/a/8a1604b080ac0569ab270b68fd2b2f618fdcc6f1.png)

Still the same message

Maybe it’s that last line?

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/4/f462e0a9295b1761f581b1942a9398e8c0435373.png)

---

<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:** [November 21, 2025, 11:24am UTC](https://community.homey.app/t/homeyscript-hdashboard-trash-reminder/145657/10 "2025-11-21T11:24:34Z")

</div>

Replace `console.log("Response: ", response);` with `console.log("Response: ", res);`

---

<div class="post-metadata">

**Author:** ![M\_J](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/m_j/32/81222_2.png) [@M\_J](https://community.homey.app/u/M_J)\
**Post date:** [November 21, 2025, 11:33am UTC](https://community.homey.app/t/homeyscript-hdashboard-trash-reminder/145657/11 "2025-11-21T11:33:38Z")

</div>

> [@smarthomesven](#):
>
> console.log("Response: ", res);

Something changed and seems to work i think?

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/1/616ab780763918b396926fb72137d3cb015d3917.png)

In my flow i still got the same error:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/b/9/b92224f554edcbfd4be78fc8e14cb5f0a60c9db1.png)

---

<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:** [November 21, 2025, 11:37am UTC](https://community.homey.app/t/homeyscript-hdashboard-trash-reminder/145657/12 "2025-11-21T11:37:34Z")

</div>

Use this Flow card:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/d/fda88ae2f9fa7a85d1d077e4d14430fd5942334c.png)

And then copy the code from your RD4.js script to the inline code editor inside the Flow card. You can then replace the “Ophaaldagen (JSON)“ tag in the Logic card with the “Result“ tag from the script

---

<div class="post-metadata">

**Author:** ![M\_J](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/m_j/32/81222_2.png) [@M\_J](https://community.homey.app/u/M_J)\
**Post date:** [November 21, 2025, 11:49am UTC](https://community.homey.app/t/homeyscript-hdashboard-trash-reminder/145657/13 "2025-11-21T11:49:39Z")

</div>

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/9/49a664df4167f61e99470427a1b36db5cda88c7b.png)

 ![Schermafbeelding 2025-11-21 124750](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/f/2f073a5b7e8da993a03dc2fe5a182995d1772524.png)

 ![Schermafbeelding 2025-11-21 124758](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/a/b/abeeed28d1a6be4f33f05b9be6f42132341eeab8.png) ![Schermafbeelding 2025-11-21 124803](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/9/197dc7c60e0e32561d199c69ec1e940891828dfb.png)

---

<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:** [November 21, 2025, 11:53am UTC](https://community.homey.app/t/homeyscript-hdashboard-trash-reminder/145657/14 "2025-11-21T11:53:49Z")

</div>

Did you copy the entire code? It seems like you didn’t copy the final line that catches the errors.

---

<div class="post-metadata">

**Author:** ![M\_J](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/m_j/32/81222_2.png) [@M\_J](https://community.homey.app/u/M_J)\
**Post date:** [November 21, 2025, 12:02pm UTC](https://community.homey.app/t/homeyscript-hdashboard-trash-reminder/145657/15 "2025-11-21T12:02:42Z")

</div>

Whoops, my bad.

Thank you for your patience and help 🙂

In Hdashboard it looks like below: Only issui is still the null value, but maybe i could figure this out by myself.

For my own learning. If you make a script in homeyscript, you always need some values returned in the bottom of the test page?

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/7/d75d20a8e4d2e77f38a426cb723fd031ae4b9d38.png)

---

<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:** [November 21, 2025, 12:06pm UTC](https://community.homey.app/t/homeyscript-hdashboard-trash-reminder/145657/16 "2025-11-21T12:06:20Z")

</div>

You don’'t always need to return values, only if you need to use something the script generates later on in your Flow. If the script for example takes an argument “temperature“ and sends a request to set the thermostat to that temperature, then you don’t need to return anything.

As for the null value, I think you created a virtual device for this? Is it possible to set the “Status indicator“ to None in Hdashboards, like you can in the Homey mobile app?

---

<div class="post-metadata">

**Author:** ![M\_J](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/m_j/32/81222_2.png) [@M\_J](https://community.homey.app/u/M_J)\
**Post date:** [November 21, 2025, 12:19pm UTC](https://community.homey.app/t/homeyscript-hdashboard-trash-reminder/145657/17 "2025-11-21T12:19:20Z")

</div>

Thank you!

Yes it’s indeed a virtual device. I could switch of the indicator for it, but then also dissapear the 02-12-2025 line, and that’s the line i would like to see.

It could maybe also comes from a flow card below. I try to replace some cards, maybe it would help

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/5/d51de7663ec942c01b02f838b8f667ff5781f5d9.png)
