Comments (16)
should be fixed in #61
from esphome-vscode.
You're not going to fix this errors by custom tags. That's Unrelated
The error is "right". It means ESPHome itself cannot find the secret in your secrets.yaml you'll have to provide more info on your environment. Add on configuration etc
from esphome-vscode.
Btw this is not a syntax error not neither a secrets unknown tag error!! Please fix title and try to understand the message properly
from esphome-vscode.
Changed the title, dunno if this suits better.
Add-on config:
ssl: true
certfile: fullchain.pem
keyfile: privkey.pem
leave_front_door_open: true
status_use_ping: false
from esphome-vscode.
that's ok, so you are running the ESPHome add on inside a HA docker or Home Assistant OS.
I'm wondering actually how are you configuring the ESPHome VS code extension, is validator local or dashboard?
where is physically (os path) the file you are validating and where is physically the secrets.yaml file? (they should be in the same folder)
from esphome-vscode.
I use Home Assistant OS
ESPHome VS code extension is configured as dashboard.
It is accessible with a valid SSL certificate through nginx.
Extension successfully connects to the dashboard.
I tested by converting all the secrets to strings and everything seems to work then.
secrets.yaml file is located at the same level as the esphome yaml configuration files. The secrets are working as expected despite the error.
from esphome-vscode.
What you mean that converted to string? Is your ssid or password a number?
from esphome-vscode.
I mean instead of using !secret tag I used the actual passwords in plain text.
from esphome-vscode.
But your secrets work or not? This seems like ESPHome cannot read your secrets at all, I mean not a vscode only issue but you have something wrong with your setup or secrets file contents
To put it clear: Are you able to compile and upload if you just ignore the errors shown in vs code?
from esphome-vscode.
Yes, I can compile and upload just fine and the secrets work just fine. It is just a visual error on the vscode side.
from esphome-vscode.
The same thing is also happening with the vscode addon for the home assistant. If I open an esphome configuration yaml file and switch the language mode from yaml to esphome to view those files. I get the same errors.
from esphome-vscode.
I don't understand what's going on then.
When vscode validates your yaml it will send all the file to ESPHome inside the dashboard, then it will realize you have secrets in your yaml and will try to open the secrets.yaml locally (I.e. inside the dashboard itself). Then it will read the secret exists and value is ok. All this happens inside the ESPHome dashboard, then if there is an error it will send back this error information to the vscode extension and it will just print the error there. The vscode extension does not do any validation by itself, so it's weird you get this error while validating but then compilation works.
from esphome-vscode.
I think I found the issue. When I checked the extension logs, it successfully connects to dashboard and sends the file for validation. It also sends the secrets.yaml along with it. However, the secrets.yaml file it sends belongs to the HA configuration.
I did not use the
!include ../secrets.yaml
directive and created a separate secrets.yaml file in the esphome directory. That is why, it was generating this error.
- \config
- -\config\esphome
- --\config\esphome\secrets.yaml ===> this one contains esphome secrets
- \config\secrets.yaml ===> this one contains home assistant secrets
Moving the contents of the esphome secrets to home assistant secrets fixed the issue.
However, there is a design flaw here. The extension should send the esphome secrets to the dashboard instead of the Home Assistant secrets.
If you do not add !include ../secrets.yaml
directive to the esphome secrets.yaml file, it does not give any errors on the vscode but checking with dashboard validation fails.
https://esphome.io/guides/faq.html#how-do-i-use-my-home-assistant-secrets-yaml
Adding !include ../secrets.yaml
directive to the esphome secrets file prevents this and pulls the contents of the home assistant secrets file.
However, by logic the extension should not send the home assistant secrets to the esphome dashboard, instead it should send the esphome secrets.
from esphome-vscode.
You're right. I'm confused there are three kinds of validations that I've worked on and mixed up my head
I tried to reproduce your scenario but could not get the errors you've got
Can you give more details on your environment?
Are you using studio code add on or is vs code running on a pc / Mac? How files are shared? Which folder do you open in code?
Thanks
from esphome-vscode.
You're right, I finally reproduced this
from esphome-vscode.
Vscode windows, SMB share, config folder
from esphome-vscode.
Related Issues (20)
- !secret syntactic error HOT 4
- component.update action not suggested when there are polling components in the sketch
- pzemac.reset_energy action not suggested when pzemac is in use
- Editor Pop-up placement HOT 2
- New Climate 'Preset' options HOT 3
- Wrong indent in VSCode when pasting code snippets
- How to configure it when running ESPHome locally? HOT 2
- unknown tag <!lambda> when lambda used to return a value HOT 6
- Unexpected path traverse error when autocompleting in lambda HOT 1
- Provide commands HOT 1
- Catch too big display HOT 1
- Schema generation error HOT 5
- hidden files arent picked up HOT 5
- sgp4x platform not recognized HOT 3
- Improve documentation to indicate importance of setting file type HOT 2
- Errors not showing up as squiggles anymore. HOT 2
- platformio
- Incompatible Platformio 6.1.15
- Cannot connect to ESPHome dashboardError: getaddrinfo ENOTFOUND vscode
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esphome-vscode.