Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


Recommended Posts

Posted (edited)

Here is an experimental extension for VSCode (search 'hc3' in extension tab).

Please login or register to see this link.

s
It allow you to see all QAs on the HC3 and their associated files in the vscode file explorer.
The files are editable and pushed back to the HC3 when saved.
In practice allowing you to use the VSCode editor as your editor for QAs on the HC3. The extension uses the same REST API as the HC3 WeUI uses for its editor when fetching and saving the code files for a QA.
I have tested it by editing files, created files, and deleted files and it seems to work.
The only problem is that the HC3 WebUI don't always follow, so if you have a QA file open in the WebUI edit and update the same file via VSCode, you need to close the WebUI editor and reopen to see the changes.

Please login or register to see this attachment.

Notes:

  • First release(s), use with caution. If it's found to be useful I may put some more effort into it... feedback appreciated.
  • Note, you can't run the files with plua in vscode yet as they are "virtual files" and the debugger can't locate them.... so you need to rely on saving back to HC3 and watch the HC3 log output the traditional way...

-------------------

HC3 Virtual Filesystem

Browse and edit HC3 QuickApp Lua files directly in the VS Code Explorer — no manual downloading or uploading. Also supports opening local .fqa archive files as editable virtual filesystems.

Features

  • QuickApps appear as folders in the VS Code Explorer under an HC3 — <host> workspace folder
  • Open any .lua file — content is fetched live from the HC3
  • Save to HC3 on ⌘S — the file is written back via the HC3 REST API instantly
  • QuickApp properties editor — each QuickApp folder contains a (QuickApp).hc3qa file; opening it shows a graphical editor for name, enabled/visible state, interfaces, QuickApp variables, and description. Changes are saved to the HC3 on ⌘S
  • Create new files — new Lua files appear on the HC3 immediately
  • Delete files — removes the file from the HC3 (the main file of a QuickApp cannot be deleted)
  • Rename files — rename a non-main Lua file by pressing F2 or right-clicking in the Explorer (implemented as create + delete)
  • Rename QuickApp — rename a device directly from VS Code (right-click the QuickApp folder)
  • Export .fqa — export a QuickApp as a .fqa archive (right-click the QuickApp folder)
  • Open in HC3 Web UI — jump to the HC3 device page in the browser (right-click the QuickApp folder)
  • File & text search  Ctrl+P quick-open and Ctrl+Shift+F Find in Files both search across all QuickApp files in the virtual filesystem
  • HC3 Log output channel — the HC3 Log output panel polls the HC3 debug log every few seconds and streams new entries as they arrive, so you can see QuickApp output and errors without leaving VS Code
  • API traffic statistics — run HC3: Statistics to see a breakdown of every API call made since connect, grouped by endpoint
  • Credentials from .env — reuses the same HC3_URL/HC3_USER/HC3_PASSWORD variables as 

    Please login or register to see this link.

    , with a fallback to VS Code settings + SecretStorage

.fqa file browser

  • Open any .fqa file as a virtual workspace folder — right-click a .fqa file in the Explorer and choose Open .fqa File, or run HC3: Open .fqa File from the Command Palette
  • Edit Lua files inside the archive — each Lua file appears as a .lua file in the folder; saving writes directly back into the .fqa JSON on disk
  • Create and delete Lua files — use the Explorer New File / Delete buttons as normal
  • Rename Lua files — press F2 or right-click → Rename in the Explorer
  • Properties editor — a (QuickApp).hc3qa file in each fqa workspace folder opens the same graphical properties editor as the live HC3 connection; edit name, QuickApp variables, interfaces, and description, then save to write changes back to the on-disk .fqa file
  • Persisted across sessions — the fqa:// workspace folder is remembered and reconnected automatically when you reopen VS Code

Explorer tree examples

Live HC3 connection:

Please login or register to see this code.

Local .fqa archive:

Please login or register to see this code.

Getting started

1. Configure credentials

Option A — .env file (recommended, works with plua)

Create a .env file in your workspace root (or ~/.env😞

Please login or register to see this code.

Option B — VS Code settings + SecretStorage

Run the command HC3: Configure Credentials (Ctrl+Shift+P  HC3: Configure Credentials) and enter your HC3 host, username, and password. The password is stored securely in VS Code's SecretStorage.

Note — precedence: .env values always win over HC3: Configure Credentials. If you use plua and have HC3_URL/HC3_USER/HC3_PASSWORD in a workspace .env or ~/.env, those credentials are used regardless of what you entered via the command. If writes fail with unexpected credentials, check for an existing .env file first.

2. Connect

Run HC3: Connect from the Command Palette. An HC3 — <host> workspace folder will appear in the Explorer containing all your QuickApps.

3. Edit & save

Open any .lua file, make changes, and save — the file is written back to the HC3 immediately.

4. Watch the log

The HC3 Log output channel opens automatically on connect and streams new debug, warning, trace, and error entries from /api/debugMessages as they arrive. Each line is formatted as:

Please login or register to see this code.

Commands

Command Description
HC3: Connect Open the HC3 filesystem in the Explorer
HC3: Configure Credentials Set HC3 host, username, and password
HC3: Refresh Clear the cache and reload the file tree
HC3: Disconnect Remove the HC3 workspace folder and stop polling
HC3: Open in HC3 Web UI Open the selected QuickApp in the HC3 browser UI
HC3: Export .fqa Export the selected QuickApp as a .fqa archive
HC3: Rename QuickApp Rename the selected QuickApp on the HC3
HC3: Statistics Show a breakdown of API calls made since connect
HC3: Open .fqa File Open a local .fqa file as a virtual workspace folder

Open in HC3 Web UI, Export .fqa, and Rename QuickApp are also available via right-click on a QuickApp folder in the Explorer.

Open .fqa File is also available via right-click on any .fqa file in the Explorer.

Settings

Setting Default Description
hc3vfs.host `` HC3 hostname or IP. Overridden by HC3_URL in .env.
hc3vfs.user admin HC3 username. Overridden by HC3_USER in .env.
hc3vfs.logPollInterval 4 How often (in seconds) to poll the HC3 debug log output channel.

Passwords are never stored in plain-text settings — they go to VS Code SecretStorage or are read from .env.

Auto-save recommendation

Each save triggers a real HTTP PUT to the HC3, which may restart the QuickApp. Auto-save is best turned off for hc3://files so you only push code to the HC3 when it is in a valid state.

Add this to your workspace .vscode/settings.json:

Please login or register to see this code.

onFocusChange is acceptable if you prefer convenience. Avoid afterDelay — it will push incomplete Lua while you type and cause constant QuickApp restarts.

Limitations

  • Renaming the main file is not supported — the HC3 API does not allow it
  • Creating new QuickApp devices (new folders) is not supported — use the HC3 web interface
  • No live refresh — the HC3 has no push notifications. Use HC3: Refresh if you made changes outside VS Code
  • File names must be at least 3 characters and contain only a-z, A-Z, 0-9
  • "Preloaded files limit" warning — VS Code indexes the virtual filesystem for search and IntelliSense. If you have many QuickApps you may see a warning that the 500-file preload limit has been reached. This is a VS Code limit; all files are still fully accessible, editable, and searchable. The warning can be safely ignored.

Working with GitHub / version control

The virtual filesystem (hc3://) is great for quick edits directly on the HC3, but it doesn't compose naturally with git — there are no real files on disk to commit.

The recommended workflow for GitHub users is to use 

Please login or register to see this link.

:

  1. Keep your QuickApp source files (.lua) in a normal local git repo — edit them directly in VS Code, commit and push to GitHub as usual
  2. When ready to deploy to the HC3, use plua from the terminal:
    • Upload (or create) the full QuickApp from a .fqa file:

      Please login or register to see this code.

    • Or update individual Lua files on the HC3 without touching the rest:

      Please login or register to see this code.

This keeps git clean and simple. The HC3 extension is then useful as a companion — browse live device state, tweak a variable, check the log — while plua handles the deployment pipeline.

Approach A — quick edits without plua

If you just want to track your work without a full deployment pipeline, export the QuickApp as a .fqa archive and commit that single file:

  1. Right-click the QuickApp folder → Export .fqa → save to your repo folder
  2. Open the .fqa with HC3: Open .fqa File to edit Lua files and properties
  3. git add MyQA.fqa && git commit && git push

Note: git diff on a .fqa shows JSON noise. Code review on GitHub is unreadable. For anything beyond personal backups, the plua workflow above is cleaner.

Related

  • Please login or register to see this link.

     — Local QuickApp development and testing tool for Fibaro HC3

 

Edited by jgab
  • Like 6
Posted (edited)

I am trying to use this extension on Windows 11 :D
Was struggeling to do the hc3: connect and how it works 😅

Asked AI to look into the extension and explain me in details how it works xD
image.png.a22fa0906629d80f9336b2477bab8f5b.png

I mistok "command Palette" and "Command Prompt" the same thing 😅 So the ctrl+shift+P made me find what I did wrong 🤣

image.png.5bc8c126f6f003942cdbb0997ef13511.png

Btw it also load the QA with no files (encrypted QAS)
No files show :D Just the folder :) 

Edited by Brors94
Posted

Jan, this is "out of this world" help. Absolutelly incredible!!!!
I did not test the whole yet, just installed and see all my codes...this is really some piece of work
Congratulation

  • Like 1
Posted


Seems to have to use the admin user? Advanced user with access to all could download, but not upload 🤔 :D 
image.png.3d92ddb9b5e9b4ec9bd406553a4f00ec.png

Also after changing to admin user 😄
image.png.59c1e07ac7c6f806002da5be70afc934.png

Is it a disconnect command? 🤔

  • Topic Author
  • Posted

    Yes, now there is a HC3: Disconnect (v0.2.0 should show up as a vscode extension update in a few minutes)
    You may need to Disconnect/Connect if you change user.
    Interesting that Advanced User with access to all can't upload.
    Can you log in to the WebUI and edit files as the same advanced user?

    • Like 1
  • Topic Author
  • Posted (edited)

    v0.3.0 published.
    -More commands. Disconnect, Save .fqa, File status in explorer view, etc.
    -File search will now search QA file contents. First time it will need to fetch all the QAs' files but the good news is that the file contents are cached so new searches are really fast and don't generate HC3 traffic.

    Edited by jgab
    • Like 1
    Posted
    50 minutes ago, jgab said:

    Yes, now there is a HC3: Disconnect (v0.2.0 should show up as a vscode extension update in a few minutes)
    You may need to Disconnect/Connect if you change user.
    Interesting that Advanced User with access to all can't upload.
    Can you log in to the WebUI and edit files as the same advanced user?

    Actually I cant edit with the advances user :D 

    Please login or register to see this attachment.



    It says on the button below xD 
    @m.roszak Is this something you guys can allow? so we can use advanced users for this type of things?

  • Topic Author
  • Posted
    6 minutes ago, Brors94 said:

    says on the button below xD 
    @m.roszak Is this something you guys can allow? so we can use advanced users for this type of things?

    Well, the error may be on my side, let me look into it a bit more.

    v0.4.0
    -HC3 log show in vscode debugger output panel. Use the log filter to only see for relevant QA etc.

    Please login or register to see this attachment.

    • Like 1
    Posted (edited)
    13 minutes ago, jgab said:

    Well, the error may be on my side, let me look into it a bit more.

    v0.4.0
    -HC3 log show in vscode debugger output panel. Use the log filter to only see for relevant QA etc.

    Please login or register to see this attachment.


     Is it ment to scan this mutch files? :D 

    Please login or register to see this attachment.



    And still get:
    image.png.42a0fc1d1d31ca308ef3564a2e804beb.png
    On the main admin user now


     

    Edited by Brors94
  • Topic Author
  • Posted

    Well, the scanning is an internal vscode thingy and actually looks a bit buggy. As you don't have 100000 files it must include local rescans from vscode, and why should the end user care?
    It is noted in the README.md

    Please login or register to see this code.

    So, it doesn't mean that it does a 100000 fetches from the HC3 ;-) 
    Vscode's preload can be turned off in settings.json but then you loose the search capability.

    • Like 1
  • Topic Author
  • Posted

    There is a v0.4.2 pushed now - will take 5min to show up in vscode.
    I think I fixed the write problem (at least for admin).
    Was it so that you had the file also open in the WebUI?

    Posted
    4 minutes ago, jgab said:

    Well, the scanning is an internal vscode thingy and actually looks a bit buggy. As you don't have 100000 files it must include local rescans from vscode, and why should the end user care?
    It is noted in the README.md

    Please login or register to see this code.

    So, it doesn't mean that it does a 100000 fetches from the HC3 ;-) 
    Vscode's preload can be turned off in settings.json but then you loose the search capability.


    I also had notification it scanned files in my onedrive that is attached to my file explorer😅
    So maybe my workspace isnt setup properly? 😅
    The workspace folder is inside my "User" folder 🤔
     

    1 minute ago, jgab said:

    There is a v0.4.2 pushed now - will take 5min to show up in vscode.
    I think I fixed the write problem (at least for admin).
    Was it so that you had the file also open in the WebUI?

    Will test it when it arrives :D 

    It was only seeing the ui like this to se it reloading/restarting:

    Please login or register to see this attachment.


     

  • Topic Author
  • Posted

    The show UI is not debugged fully. I'm kind of looking for a better url to show the UI for a specific QA residing on the HC3...

    I just pushed v0.4.3 that has a HC3:Statistics command, and shows all the API calls it has done

    Please login or register to see this image.

    /monthly_2026_03/image.png.1fc08645447453d4d1a431ddc35f0fa1.png" />

    The large 582 GET is the initial scan of QA files that are cached.
    There is a reset statistics command too.

    Posted (edited)

    one tip for others who have a big amount of QAs like me
    I found it pretty heavy for VS code to load all my quickapps. It reached preload limit too. So as i am not a big expert of VS code, i turned to AI to ask how to improve this.
    It recommended me to disable preload, so VS code only focuses on opened files, and doesnt try to analyze and preload every single quickapp that is loaded by the extension
    This is what i am using in my settings file
     

    Please login or register to see this code.

     

    it seemed to stop loading all the files into memory, and also diagnostic stopped. I dont know if this is a good approach, but seemes to work.

    It can be found inside
     

    Please login or register to see this code.

     

     

    Edited by Neo Andersson
    • Thanks 1
  • Topic Author
  • Posted (edited)

    The preload warning can be ignored - I actually think it's a bit buggy for vscode to complain that way.
    Yes, you can exclude the preload as you say and it still works to open and edit files.
    However, the File search don't, so if you can live without it, ok.
    The preload is only done once and file content is cached on the PC so it gets better.... :-) 

    Edited by jgab
    Posted (edited)

    Still get the same error when saving:

    Please login or register to see this image.

    /monthly_2026_03/image.png.b040ab326dd7ff904a4f80e662cc440c.png" />

    Still on the admin user :) With set credentials with the:
    >HC3:configure credentials

    on v0.4.3 of the extension


    Statstic:
     

    Total API calls: 98  (since connect, 24s ago)

    Calls by endpoint:
         85  GET /api/quickApp/{id}/files
          7  GET /api/debugMessages
          6  GET /api/devices

    So I aint got that many 😅

    Edited by Brors94
    Posted

    Another thing, if some can pinpoint me to the right direction
    Its kinda hard to use AI in VS code this way, unless i copy paste the entire code into its input box
    Because there's no way to add some subdirectory (some quickapp) to its content.
    If i dont tell him what are we working with actually, it uses the entire root / so the entire workspace.
    Is there a better way to do it?

     

    Posted (edited)
    8 minutes ago, Neo Andersson said:

    Another thing, if some can pinpoint me to the right direction
    Its kinda hard to use AI in VS code this way, unless i copy paste the entire code into its input box
    Because there's no way to add some subdirectory (some quickapp) to its content.
    If i dont tell him what are we working with actually, it uses the entire root / so the entire workspace.
    Is there a better way to do it?

     


    I always start the chat with we are working on ...... name of file... And only change code inside this file. And only see/look into other files in the workspace for documentation. etc

    Also made an AGENTS.md for the codex. 
    (AGENTS.md is a file the AI always will use to look for insturctions when you prompt it)
    The agentskill jgab made also do that same for copilot :D (Can also ask codex and claude to use thoose files, but have to spesify it in each chat)

    I have hade a few times the AI have started to work in other files I have had open in my "viewer" since the chat often look into "open files" 

    I guess @jgab got some more examples to maybe?  :) 



     

    Edited by Brors94
  • Topic Author
  • Posted
    20 minutes ago, Brors94 said:

    Still get the same error when saving:

    Please login or register to see this link.



    Still on the admin user :) With set credentials with the:
    >HC3:configure credentials

    on v0.4.3 of the extension

     

    Try v0.4.4 that should show up in a few minutes. Better error message. Strange that I don't have the write problems, and haven't had since the first version. I do run as admin though...

    8 minutes ago, Brors94 said:


    I always start the chat with we are working on ...... name of file... And only change code inside this file. And only see/look into other files in the workspace for documentation. etc

    Also made an AGENTS.md for the codex. 
    (AGENTS.md is a file the AI always will use to look for insturctions when you prompt it)
    The agentskill jgab made also do that same for copilot :D (Can also ask codex and claude to use thoose files, but have to spesify it in each chat)

    I have hade a few times the AI have started to work in other files I have had open in my "viewer" since the chat often look into "open files" 

    I guess @jgab got some more examples to maybe?  :) 



     

    The file you open/click on is usually set as the context for the chat, so when you ask questions that is the focus for the question.
    You can also do CMD-I in the edit for a code part that is marked to ask a question about that selection - at least that works in copilot

    Posted
    2 minutes ago, jgab said:

     

    Try v0.4.4 that should show up in a few minutes. Better error message. Strange that I don't have the write problems, and haven't had since the first version. I do run as admin though...


    I am sorry 🤣
    I just realised I set the .env file in the "User" folder to the other account to and when i delted the .env in workspace and used the >hc3: config credentials I tought it would use them as a priority. 
    And forgot the .env might be used...
    Since the non admin used gets the output log etc and download I tought I was on the admin 😅
    Works Now! 
    Sorry for wastning your time :D 
     

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Reply to this topic...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...