Web API Playground – Code runs, but no visible output (console.log or return)

Hi all,

I’m having issues with the Web API Playground at tools.developer.homey.app, and I’m hoping someone can help clarify what I might be missing.


:white_check_mark: What works

  • I can log in and select my Homey Pro (Early 2023).

  • I can execute async JavaScript code successfully. For example:

    (async () => {
      const info = await Homey.system.getInfo();
      console.log(info);
    })();
    
  • The Playground shows:

    :white_check_mark: Request took XXX ms

So I know the code is running.


:cross_mark: What doesn’t work

  • The response/output panel is always empty — even for basic console.log() calls or returning static values.

  • I’ve tested this using:

    • console.log(...)
    • return ...
    • throw new Error(...) (see below)
  • In almost all cases, no data is shown in the UI — which makes debugging nearly impossible.


:test_tube: Browsers I’ve tested

  • Chrome (standard + incognito)
  • Firefox
  • Safari

Same result in all of them.


:puzzle_piece: Partial success (but not reliable)

In one case, I did get full output when using this:

(async () => {
  const info = await Homey.system.getInfo();
  throw new Error(JSON.stringify(info, null, 2));
})();

That returned the full Homey system info (inside the "error" field in the response).

However:

  • Throwing smaller values like info.ethernet just results in "Error".
  • console.log() still never shows anything, regardless of the data type.

So it feels like the Playground is partially working, but not exposing logs or responses as expected.


:bullseye: What I’m trying to do

I’m trying to verify Ethernet status using:

Homey.system.getInfo();

…so I can then safely disable WiFi on my Homey Pro using:

Homey.system.disableWifi();

But without being able to inspect the ethernet.connected value, I don’t want to risk losing access.


:red_question_mark:My question

What do I need to do to make the Web API Playground actually show output (console.log or return values)?
Is there a dev mode I need to enable, or a browser setup that does work reliably?

Just literally place that code in the editor, and nothing else.

hi Robert
thanks for your response. when I use this command, I do get some info. see here the recording

question stays what do I have to change / update to use this command to disable wifi?

Do I understand correctly that you want to disable WiFi, but only if Ethernet is connected?

yes and I think I managed to do this by running this command. but than I still have question, is it correct that when I run this command, I do not get a written response? only the the message " Request took xxx ms?

Most Web API commands will likely not log and/or return anything. You can use console.log() and the messages will end up in your browser’s developer console.

Not web api related, but you’ll need to enter setup mode (push pin @ Homey bottom for over 8s, but not past 30s) to disable or change wifi.

tried this one

(async () => {
await Homey.system.enableWifi();
console.log(‘:white_check_mark: WiFi is now enabled’);
})();

but no response…what should I change / add?

Open your browser’s developer console (or “Developer Tools” or whatever it’s called).