A Visual Studio Code extension that provides a graphical drag-and-drop editor for creating and editing openHASP pages.
Using the extension? See the user guide — settings, Home Assistant bindings, templates, and the JSONL/YAML generation workflow. That file is what ships inside the
.vsixand becomes the marketplace page (see RELEASING.md); this README is for working on the extension itself.
- Visual Page Editor - Drag-and-drop interface for designing openHASP pages
- Widget Palette - 22 supported openHASP widgets (buttons, sliders, gauges, etc.)
- Property Inspector - Widget-specific property sections for detailed customization
- Multi-Page Management - Create and manage multiple pages
- Visual Preview - See how your pages will look on the device
- JSONL Support - Native support for openHASP's JSONL format
- Design Files - Rich
.hasp.jsondesign format with device properties - JSONL Import - Import existing
.jsonlfiles as design files - JSONL Export - Export design files back to
.jsonlfor device deployment - openHASP Explorer - Activity bar view for browsing design files
- Home Assistant Config - Generate HA configuration from your design files
- Widget Navigation - Jump directly to specific pages and widgets
- screen, container, window, tabview, tab, msgbox, tileview
- button, checkbox, switch, slider, dropdown, textarea, spinbox, color picker, keyboard
- label, gauge, bar, linemeter, LED, arc, spinner, chart, datetime
- dropdown, roller, list, table, calendar, menu
- line, image, animated image, canvas, mask, QR code
- Clone this repository
- Run
npm installto install dependencies - Run
npm run compileto build the extension - Press F5 to open a new VSCode window with the extension loaded
- Download the latest
.vsixfile from releases - In VSCode, go to Extensions view
- Click the
...menu and select "Install from VSIX..." - Select the downloaded file
- Open a
.jsonlor.hasp.jsonfile in VSCode - Right-click the editor and select "Open with openHASP Editor"
- Or use the command palette:
openHASP: Open with openHASP Editor
- Click the "+" button in the pages panel to add a new page
- Drag widgets from the palette onto the canvas
- Select widgets to edit their properties in the inspector
- Save the file to persist changes
Use the openHASP Explorer in the activity bar and click the import button, or run openHASP: Import JSONL as Design File from the command palette. This converts a plain .jsonl file into a .hasp.json design file with full editor support.
Click the export button in the editor title bar or run openHASP: Export as JSONL to produce a .jsonl file ready for deployment to an openHASP device.
Right-click a design file in the openHASP Explorer and select "Generate Home Assistant Config", or run openHASP: Generate Home Assistant Config from the command palette.
Configure the extension in VSCode settings:
{
"openhasp.editor.canvasWidth": 720,
"openhasp.editor.canvasHeight": 480,
"openhasp.editor.gridSize": 10,
"openhasp.editor.snapToGrid": true
}npm install
npm run compilenpm run watchnpm testnpm run packageThis creates a .vsix file that can be installed in VSCode.
openhasp-editor/
├── src/ # Extension host code (Node.js)
│ ├── extension.ts # Extension activation
│ ├── editorProvider.ts # Custom editor provider
│ ├── jsonl/ # JSONL parser/serializer
│ └── types/ # TypeScript types
├── webview/ # React UI (Browser)
│ ├── App.tsx # Main React component
│ ├── store/ # Zustand state management
│ ├── components/ # React components
│ └── utils/ # Utility functions
└── dist/ # Compiled output
- Extension scaffold
- JSONL parser/serializer
- Custom editor provider
- React app with Zustand stores
- Basic webview communication
- Widget palette with 17 widgets
- Canvas with grid overlay
- Drag-drop from palette to canvas
- Basic widget renderers
- Widget selection
- Property inspector panel
- Widget-specific property sections
- Real-time updates
- JSONL import/export
- Design file format (
.hasp.json) - openHASP Explorer view
- Home Assistant config generation
- Widget navigation
- Full test coverage
- Performance optimization
- Additional widget renderers
- Documentation
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details
If you encounter any issues or have feature requests, please file an issue on GitHub.