VS Code extension for ioBroker javascript adapterioBroker is a mighty IoT platform and enables you to write custom scripts with its JavaScript adapter. This extension for Visual Studio Code enables you to develop the scripts completely in Visual Studio Code, without the need of the web interface. FeaturesOpen the command pallet (Strg + Shift + P OR F1) and type Connect to your ioBroker instance by invoking the command If Password protected ioBroker installationsIf your ioBroker installation is protected via password, the extension will ask for it during the connection attempt. The username is stored in the config file Type definitionsIf you choose to configure ioBroker type definitions, the current defintions are downloaded from GitHub. Additionaly a View: Script explorerThe script explorer can be found in the activity bar behind the ioBroker logo. It shows all scripts, which are on the configured iobroker server. If the script content differs on the local disk from the remote version on the ioBroker server, a star (*) is shown next to the script name. Click on script to show its contents. If the script is not downloaded yet, only a preview is openend. Every time a script object is changed, the script explorer refreshes its view. View: Changed scriptsThe Changed scripts view can be found in the activity bar behind the ioBroker logo. It shows all scripts, where the local version differs from the server version. Only scripts which are on local disk and already uploaded to the server are shown (This might change in the future). The same scripts are also shown in the script explorer marked with a star. Download scriptsEither download only one script (
Upload scriptsTo upload a single script you have the following options:
Only scripts residing on local disk can be uploaded. Scripts which are marked as remote only in script explorer can be viewed by clicking on it, but changes cannot be uploaded. Start/Stop scriptsTo start/stop a single script you have the following options:
Show diff between local and server version of a scriptUse the diff button in either the script explorer or the changed scripts view to show a diff of all the changes made locally. Move scriptsScripts can be moved from one directory to another on your ioBroker server. Moving a script over the VS Code file browser is not supported yet. Scripts can only be moved over the script explorer. Right click on the script you want to move, select Create scripts and subdirectoriesRight click on an existing directory to create a new file in this directory or in the root directory. It is possible to create subdirectories, TypeScript files and JavaScript files. Newly created scripts are immediatly uploaded to the server as stoped scripts. Delete scriptsScripts can be deleted on your ioBroker server via the script explorer. Right click on a script, select Delete directories recursivelyDirectories can be deleted on your ioBroker server via the script explorer. Right click on a directory and select Change JS InstanceThe JS Instance for a script can be changed over the script explorer. Right click on a script and select Show script loggingPress Strg + Shift + U to open the "Output" view. Open the drop down and select
Hover over state id string to show valueHover over any string with a full state id to show current data of the state: This only works for states and not for channels. Auto completion (IntelliSense) of iobroker state idsPress Strg + . in any string to show the IntelliSense menu. If the string contains parts of
an ioBroker state id (for example If you press . instead of enter to select an item the next item will appear automatically. The whole auto completion process in action: Add name of ioBroker object/state id as commentSometimes it is hard to remember the meaning of a generic ioBroker object/state id. To make this easier the name of an id can be added as comment via code action. Put your cursor within a valid id and open the code actions menu (click on the light bulb or press Strg+.) and select Extension SettingsAfter the first activation a
Available settingsAn example with all available settings can be found here.
Admin versionsThe extension currently supports the following Admin versions:
Known IssuesIf you got any problems, please open a GitHub issue. Release NotesSee the section Releases on Github for release notes. |