Can you list your relevant installation steps so I can understand better your environment?
OTA link is tested by me under Windows only
Can you list your relevant installation steps so I can understand better your environment?
OTA link is tested by me under Windows only
Sure (and thanks for reply):
Synology, inside is Virtual machine. Then i installed HA according to
THIS topic. All went fine, HA is running supervised. Then i installed vscode addon, and when i run it showed this error:
Could not execute ESPHome. Make sure you can run ESPHome from the command line.
if i have set âsettings --ESPHomeâ to local (no matter what i enter in address line).
Addon itself is happy with âdashboardâ setting and above error goes away when i enter correct IP and port, but OTA doesnât work in any way - it ends with same terminal error as @andrepiaâs picture.
Then i installed terminal add-on and installed esphome with command âpip3 install esphomeâ. After that command âesphomeâ is recognized in terminal add-on, but not in vscode add-on - it still shows same error when i click on OTA. (error esphome unknown command).
ESPHome is configured to âleave_front_door_openâ, port 6052 is entered in ânetwork hostâ of plugin.
All this is done locally (so with using 192.168.x.x:8123), not from outside address.
Itâs not big deal, i can always upload in esphome plugin. Itâs just that your vscode plugin is waaay better than original editor.
So you are using vscode addon inside home assistant (it comes preloaded with esphome vscode addon)
That thing is preconfigured to run in dashboard mode. That is esphome is not installed locally inside the addon.
You can try install esphome there:
Open terminal - new terminal (this terminal has to be the one embedded in vscode, at bottom right of screen. You open this terminal from the menu at the top left, the three horizontal bars)
Then
Then change on the settings to use local esphome
This will get you another installation of esphome you will
Have to keep updated manually
yeeeeeeyyyyy!!! THANKS!
it works, i set addon to local and entered my local ip:6052. addon doesnât complain and OTA uploads perfect.
btw⊠apt update showed that i have 8 packages upgradable. should i run apt upgrade?
The address is only used when in dashboard mode.
I donât know about other packages
I guess that it canât hurt, so i did upgrade. All things are still alive, so itâs ok. I guess that those are only system updatesâŠ
Thanks again!
OK, feeling stupid hereâŠ
The extension is installed and appears to be connected and working. Tooltips appear when I hover over keywords. But, what should I be seeing in terms of validation? Nothing happens when I intentionally insert errors.
You should definitely see errors being reported, such as:
Where I intentionally put âdataâ where it shouldnât be.
Or:
where I messed up the indentation.
Not sure what the fix would be for you though. Are there any warning / error messages in the bottom right of the screen when you load Studio Code Server?
Thanks for the repsonse. No luck when I inttroduce similar errors in the code.
The only warning that comes up when I start VS Code is a deprecation warning related to the Home Assistant extension.
Validation works differently than hover tooltips.
Do you have ESPHome installed locally or in the HA as add on?
You should configure that in the extension settings.
ESPHome is installed as an HA add on. leave_front_door open
is set to true.
Iâve got the correct URL in the extenstion settings and dashboard
is selected for Validator
.
Iâm able to open the dashboard in a browser using the same URL.
I have problem with VSCode refusing to compile valid ESPHome yaml. It has issue with script parameters.
esphome:
name: test
esp8266:
board: nodemcuv2
logger:
api:
ota:
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
ssid: "test"
password: "esp.home"
captive_portal:
script:
- id: set_limit
parameters:
start: int
end: int
then:
- logger.log: "Pass"
VSCode reports this:
INFO Reading configuration esphome/test.yaml...
Failed config
script: [source esphome/test.yaml:26]
'id' is a required option for [script].
-
Unable to find action with the name 'id'.
id: set_limit
parameters:
start: int
end: int
then:
* The terminal process "/usr/bin/zsh '-c', 'esphome run esphome/test.yaml --device OTA'" terminated with exit code: 2.
If I remove parameters part form script definition, then it passes yaml to compilation.
This happens with all my yaml that have scripts with parameters. all of them compile properly when run form ESPHome editor.
Maybe I need to configure something?
When I create new yaml file in VSCode it uses four spaces for indentation and if I paste.
If i use two spaces for indentation it marks it red.
But, after I save file, close it and reopen, then it acts normaly with two space indentation.
When I copy part of other yaml and paste it it is pasted indented according to the previous line in yaml I am pasting into. It disregards actual cursor position.
If I place cursor at beginning of new line and paste copied code, it is indented according to previous line, not at the place where cursor is.
Scripts parameters are a new feature from last release I believe.
The add on should work ok with this, as it really does not perform validation itself, i.e. esphome is running validation, so this looks like youâre validating against an old version of esphome but compiling it with a latest version of esphome.
Check the esphome vscode extension configuration and check that the validator it is using (local or dashboard) is an updated one.
Home Asistant prompted me today with info of new version of VSCode. I updated and now it behaves as expected. No more issue with script parameters.