- Install the custom component from HACS.
- Restart Home Assistant.
- In the HA UI go to "Configuration" -> "Integrations" click "+" and search for "Home Assistant VSCode Tunnel".
- Follow the installation instructions. Authenticating with github is required.
- Restart Home Assistant
- Turn on the VSCode Tunnel Switch entity to start the tunnel.
- Go to https://vscode.dev/your_tunnel_name to access your home assistant files (configuartion.yaml, etc)
- Turn off the VScode Tunnel Switch if you want to stop the tunnel and the associated external connection.
https://vscode.dev can't be opened in an iframe, so this will not work as a sidebar menu item in home assistant - YET! Apparently this feature has been requested and hopefully will be available soon! (see microsoft/vscode#150152)
This component will set up the following platforms.
Platform | Description |
---|---|
switch |
VSCode tunnel in your HA Docker container. Turn it on/off with the switch |
- Using the tool of choice open the directory (folder) for your HA configuration (where you find
configuration.yaml
). - If you do not have a
custom_components
directory (folder) there, you need to create it. - In the
custom_components
directory (folder) create a new folder calledha_vscode
. - Download all the files from the
custom_components/ha_vscode/
directory (folder) in this repository. - Place the files you downloaded in the new directory (folder) you created.
- Restart Home Assistant
- In the HA UI go to "Configuration" -> "Integrations" click "+" and search for "Home Assistant"
- Turn on the VSCode Tunnel Switch entity to start the tunnel.
- Go to https://vscode.dev/your_tunnel_name to access your home assistant files (configuartion.yaml, etc)
- Turn off the VScode Tunnel Switch if you want to stop the tunnel and the associated external connection.
Using your HA configuration directory (folder) as a starting point you should now also have this:
custom_components/ha_vscode/translations/en.json
custom_components/ha_vscode/__init__.py
custom_components/ha_vscode/config_flow.py
custom_components/ha_vscode/const.py
custom_components/ha_vscode/exceptions.py
custom_components/ha_vscode/manifest.json
custom_components/ha_vscode/switch.py
custom_components/ha_vscode/vscode_device.py
If you are having trouble with authentication, increase the timeout in the options.
If you are experiencing a "reload error" after browsing to https://vscode.dev/your_tunnel_name, ensure that you have "turned on" the switch in your home assistant instance. If you are still having difficulties browse to https://vscode.dev and select you tunnel instance from the workspace dropdown menu at the top of the page.
If you want to contribute to this please read the Contribution guidelines
This project was generated from @oncleben31's Home Assistant Custom Component Cookiecutter template.
Code template was mainly taken from @Ludeeus's integration_blueprint template