This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

VScode extension (WIP)
#1
Hi!
Internally we have developed some custom tooling for our projects, among them is one that we are releasing this week for the old visu that allows some quick editing and such: https://forum.logicmachine.net/showthread.php?tid=6330

But this one is a lot more scripting related so I'm posting it here, admin feel free to move it if its in the wrong area?
Managing several LM/SL through web browser with copying and pasting from VScode had become such a hazzle and a lot of projects ended up being misaligned with the codebase due to changes done on device and in VScode separately.

To combat this we have created a VScode extension that allows two way sync with LM/SL of all scripting functions, featurelist is currently:
-support for multiple projects with github sync, local hashed and salted auth is not synced between sessions.
-sync all (first time sync only downloads from LM/SL, second time does a diff)
-sync when saving, if you save in VScode it syncs directly to the LM (changes on LM requires manual syncing in VScode as its not automatic that way)
-run script (both scheduled and event script)
-error log with filtering
-log log with filtering

-read/write specific objects (this is very basic and work in progress at this time)

We are improving this extension as we go and I'm unsure of when we would release it, it all highly depends on demand if I can be bothered or not Smile

Here is a really rushed recording of me trying to squeese a gif under the max limit and in a tiiiiny window:
-Note the browser doesn't need to be open or used in any way, this runs directly from VScode, browser used as demo of sync and run.
[Image: lfefHSW.gif]

Screenshot of the current extension menu:
[Image: xemOjnQ.png]

any thoughts or ideas?
Reply
#2
(04.03.2026, 16:36)Seijboldt Wrote: Hi!
Internally we have developed some custom tooling for our projects, among them is one that we are releasing this week for the old visu that allows some quick editing and such: https://forum.logicmachine.net/showthread.php?tid=6330

But this one is a lot more scripting related so I'm posting it here, admin feel free to move it if its in the wrong area?
Managing several LM/SL through web browser with copying and pasting from VScode had become such a hazzle and a lot of projects ended up being misaligned with the codebase due to changes done on device and in VScode separately.

To combat this we have created a VScode extension that allows two way sync with LM/SL of all scripting functions, featurelist is currently:
-support for multiple projects with github sync, local hashed and salted auth is not synced between sessions.
-sync all (first time sync only downloads from LM/SL, second time does a diff)
-sync when saving, if you save in VScode it syncs directly to the LM (changes on LM requires manual syncing in VScode as its not automatic that way)
-run script (both scheduled and event script)
-error log with filtering
-log log with filtering

-read/write specific objects (this is very basic and work in progress at this time)

We are improving this extension as we go and I'm unsure of when we would release it, it all highly depends on demand if I can be bothered or not Smile

Here is a really rushed recording of me trying to squeese a gif under the max limit and in a tiiiiny window:
-Note the browser doesn't need to be open or used in any way, this runs directly from VScode, browser used as demo of sync and run.
[Image: lfefHSW.gif]

Screenshot of the current extension menu:
[Image: xemOjnQ.png]

any thoughts or ideas?

It's fantastic!
1 question - if I will edit resident script, can I restart it from VS code? or only throu web?

If you need beta testers - I'm interested in it.
Reply
#3
I haven't actually added support for resident script running yet, I'll add it to my featurelist!
Current support for running is scheduled and event. logging works for all scripts, nice feature is the log is actually further back than the LM/SL log window in the script view Smile
Beta testers would be nice, this is currently pre-alpha in my mind.
Reply
#4
(04.03.2026, 16:50)Seijboldt Wrote: Beta testers would be nice, this is currently pre-alpha in my mind.

does not matter, I wan't to test it, it could help me to make script debug faster/ could you provide me acces to your extention?
Reply
#5
(06.03.2026, 10:47)AEK Wrote:
(04.03.2026, 16:50)Seijboldt Wrote: Beta testers would be nice, this is currently pre-alpha in my mind.

does not matter, I wan't to test it, it could help me to make script debug faster/ could you provide me acces to your extention?
Sendt a PM.
Reply
#6
We are now live with closed beta testing, current capabilities are:
Device Connection & Management
Setup Device Connection - Configure the IP address, username, and password for your LM5/spaceLYnk. Credentials are stored securely in VS Code's SecretStorage.
Switch Device - Manage multiple device profiles and switch between them. Each device gets its own workspace subfolder.
Configure Portal Authentication - Set up Cloudflare Access service tokens or custom headers for devices behind reverse proxies or tunnels.
Sync Scripts (Diff View) Fetch all scripts from the device and compare with your local workspace. A diff-aware UI categorizes changes as device-modified, local-modified, both-modified, device-only, or local-only, letting you choose pull/push/skip per script.
Force Full Sync - Overwrite your local workspace with all scripts from the device in one step.
Auto-Upload on Save - Every time you save a .lua file, it is automatically uploaded to the device.
Right-Click Context Menu (Explorer & Editor)
Available on any .lua file via right-click in the file explorer or editor:

Right click script
Run Current Script Execute the script on the device (triggers event scripts via their Group Address, runs others directly).
Toggle Enable/Disable Script Toggle the script's active state on the device.
View Diff (Local vs Device) Open a side-by-side diff comparing your local file against the version currently on the device.
Fetch Script from Device Download the device version and overwrite your local copy.
Push Script to Device Upload your local file to the device.
Edit Script Configuration Change the script's name, category, parameters, or sub-parameters.
Delete Current Script Delete the script from the device and remove it locally (with confirmation).

Keyboard Shortcuts
F5 Run current script
Ctrl+K T Toggle enable/disable
Ctrl+Alt+S Sync scripts

Command Palette (Ctrl+Shift+P) has all commands above plus:
Create New Script on Device - Create a script with guided prompts for name, type (Event/Scheduled/Resident/User), category, and type-specific parameters (Group Address, cron, sleep interval). Also triggered automatically when saving a new untracked .lua file.
Bulk Enable/Disable Scripts - Multi-select scripts to enable or disable in batch.
Start / Stop Log Viewer - Stream live script logs and errors from the device.
Clear Sidebar Logs - Clear the log and error panels.
Toggle Follow Active Script Logs - Filter sidebar logs to show only the currently open script, or all scripts.
Export Bug Report Log - Open the local diagnostic log for issue reporting.

Sidebar Panels
Script Logs - Live-updating tree view of script log output from the device.
Script Errors - Live-updating tree view of script runtime errors from the device.
Status Bar
Device indicator - Shows the active device name/IP. Click to switch devices.
Log filter indicator - Shows which script's logs are being followed. Click to toggle between active-script and all-scripts mode.
Portal Auth indicator - Appears when tunnel/portal headers are configured.

Send a PM if you want to help beta test.
Reply
#7
After the latest feedback round we have added a live-object view with rapid toggle booleans and write analog values using the built in websocket from the LM/SL.
This shows on-change highlighting, filtering, sorting alphabetical or by most recent change, etc.

[Image: 701NXtT.png]

Enhanced and refined the diff view when syncing from device:
[Image: qs70my0.png]
Reply
#8
Hi! see PM
Reply
#9
Thanks to the help from AEK we now have full support for the LM5!
Beta testing continues and new version is sent to all testers, now that we have the core functionality we will focus on more in-depth features.


If the storage viewer app is installed on the LM/SL object storage is also viewable:
[Image: TWoKIwI.png]
Reply


Forum Jump: