Skip to main content

πŸ“˜ Overview​

Welcome to the @digital-alchemy Home Automation quickstart project!

This project is designed to work with Supervised and HA OS based installs, where Addons are supported. If you used a different installation method, you will need to make tweaks to the process.

These instructions assume that Studio Code Server Addon has been installed on your setup, serving as both editor and workspace management tool.

Links!

πŸš€ Setup​

Note: The below command works for:

  • Initial setup
  • Fixing a broken environment
  • Updating the scripts provided by quickstart repo with newer versions

Within the Code Server Addon:

  1. Open a terminal
    • Press Ctrl-Shift-` (default keybind) to open a terminal, or go through Menu > Terminal > New Terminal
  2. Execute the command
curl -fsSL https://setup.digital-alchemy.app -o setup.sh; bash setup.sh

This script will:

The final install step is for you to install the addon. addon

πŸŽ‰ You are now able to run Typescript code on your Home Assistant instance! πŸŽ‰ Check out the next steps guide for an orientation on the project you just set up

πŸ“Ί In action​

No sound orientation videos, for a bit of context on what things should look like when everything goes right.

TLDR: Tldw: Setup Process Speed run of the setup process, taking a break to run the code manually and in the background with the addon

TLDR: Tldw: Editing Experience Have your editor provide handy suggestions about your current setup as you type

βš’οΈ Workspace Management​

Warning: The NodeJS environment within the Code Server addon does not survive reboots and may occasionally need to be set up again.

A script has been provided to restore your environment if something goes wrong.

./scripts/environment.sh

Also accessible as a task within VSCode as part of the workspace. Use Tasks: Run Task from the command palette to access

Once your environment is set up, you can use the commands in the package.json to manage your workspace further.

NPM CommandDescription
upgrade⏺️ Upgrade all package.json dependencies -- Automatically runs type-writer afterwards
develop⏩ Run the development server from within the Code Server addon -- Not intended for long term deployments!
develop:watchπŸ‘€ Run the development server in watch mode from within the Code Server addon -- Automatically restart server on code changes
setup:addonπŸ” Reinstall the code runner addon. -- Uses name in package.json to determine install path
buildπŸ”¨ Create a build of your code in the dist/ folder -- Reports all the errors in your workspace
build:deployπŸ—οΈ Create a build of your code in the deploy/ folder -- Addon has been set up to run from here
lint😱 Check your workspace for non-critical issues
lint:fixπŸͺ› Run eslint --fix to resolve minor issues
type-writerπŸ–¨οΈ Rebuild custom type definitions for Home Assistant -- Run any time you modify your setup for more accurate definitions