Giter VIP home page Giter VIP logo

esphome-vscode's Introduction

esphome-vscode's People

Contributors

definitio avatar dependabot[bot] avatar fabaff avatar glmnet avatar ottowinter avatar slovdahl avatar thargy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esphome-vscode's Issues

Incompatible Platformio 6.1.15

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
esphome 2024.4.1 requires platformio==6.1.13, but you have platformio 6.1.15 which is incompatible.

Successfully installed platformio-6.1.15

non yaml required files

Looks like some kind of validation like "file exists" is being done for files in e.g.

esphome:
  includes:
     path1

and also in e.g. font:

I'm not aware right now of other dependencies like this.
In case this is just a file exists validation may be another request type can be send, I mean check_file_exists instead of read_file

select component missing

fantastic add in! I use it every day.
Please update to latest esphome features (e.g select)

Thanks you! Awesome work!

unknown tag <!secret>YAML

When using tag !secret the esphome plugin gives an error even though there is nothing wrong. It still compiles and works just that it shows up as an error.
Selection_036

OTA button doesn't work with esphome 1.19.0

> Executing task: esphome config.yaml run --upload-port OTA <

usage: esphome [-h] [-v] [-q] [-s key value] command ...
esphome: error: unrecognized arguments: --upload-port OTA
The terminal process "/usr/bin/zsh '-c', 'esphome config.yaml run --upload-port OTA'" failed to launch (exit code: 2).

Errors not showing up as squiggles anymore.

My vscode add-on in Home Assistant is no longer showing me the red squiggles when there is an error in my ESPHome code. It does show the errors in the Problems console . Seems to just not showing for ESPHome specific errors. Any suggestions on how I get that functionality back? Not sure what I did to make it go away. It was working a couple days ago.

incorrect code validation error for substitutions

first.yaml

substitutions:
devicename: boo

<<: !include common.yaml

common.yaml

esphome:
name: $devicename
platform: ESP8266
...
etc
...

It reports for string "name: $devicename" that "$" is incorrect symbol for name.
But it's ok and no problems with compilation

How to configure it when running ESPHome locally?

I am having problems understanding how to get the plugin to work when running esphome locally on my mac.

I start ESPHOMe with this docker-compose

version: '3.3'
services:
  esphome:
    container_name: esphome
    image: esphome/esphome
    volumes:
      - ./esphome/config:/config
      - ./esphome/cache:/cache
      - /etc/localtime:/etc/localtime:ro
    restart: never 
    # restart: always
    # --- WINDOWS / LINUX ---

  # privileged: true
  # network_mode: host
    # --- END WINDOWS / LINUX ---

    # --- MACOS ---
    ports:
      - '6052:6052'
    environment:
      - ESPHOME_DASHBOARD_USE_PING=true
    # --- END MACOS ---

How can I let the plugin know that it should take a look at localhost:6052 to get the info when I open my esphome/config/device-config.yml file?

I am running this completely outside of home assistant.

$ Not Allowed in Node, But Using Substitution

So I have a bunch of template yaml files I use to assemble individual device files. Those templates often include the esp section and thus the node name. Normally the node name doesn't allow a $, but you are allowed to use substitutions. The extension is however giving me an error that$ isn't allowed. Maybe allowing ${} and not just $ or something would be convenient.

Unknown tag !lambda

on_raw_value:
      then:
        - text_sensor.template.publish:
            id: ${device}_uptime_human
            state: !lambda |-
              int seconds = round(id(${device}_uptime).raw_state);
              seconds = seconds % (24 * 3600);
              int days = seconds / (24 * 3600);
              int hours = seconds / 3600;
              if (days || hours)
                return {((days ? to_string(days)+"d " : "")+(hours ? to_string(hours)+"h" : "")).c_str()};
              else 
                return {"< 1hour"};

11

Studio Code Server version: 5.0.4, ESPHome version: 2022.5.1 I don't know if the bug was in earlier versions. The code compiles without any problems.

The validation applies to the file esphome/common/common.yaml. No problem when the file is in the esphome directory.

Pin mode error

In according documentation, next code should be correct:
switch:
platform: gpio
name: "PCF8574_1"
pin:
number: 1
inverted: true
mode:
input: true

But validator got error near "input:true" : "String value cannot be dictionary or list"

Unexpected exception while reading configuration with git packages

Extension doesn't work when config includes packages from a git repository.
Config example:

packages:
  remote_package:
    url: https://github.com/esphome/non-existant-repo
    files: [base.yaml]

Notification:

�[31mERROR Unexpected exception while reading configuration:�[0m

Log:

Validating file:///<path_to_file>/config.yaml
Unexpected data too small: 
'

Cannot connect to ESPHome dashboard

I have set up the addon as instructed.

ssl: true
certfile: fullchain.pem
keyfile: privkey.pem
leave_front_door_open: true

I can access the dashboard just fine.
but the vscode extension cannot connect for some reason:
Cannot connect to ESPHome dashboard. Make sure you can access 'https://ha.home.org:6052/' and have set the option 'leave_front_door_open': true
dashboard uri:
https://ha.home.org:6052

Schema generation error

@glmnet the "newish" speaker component breaks the build scheme script:
https://github.com/esphome/esphome/blob/17fed954bf74a018f527b541dab2d30101169bb8/script/build_language_schema.py#L533
My quick fix was to add

if x == "speaker.SPEAKER_SCHEMA":
    continue

But don't think that's a solution 😜, I am trying to get the new alarm_control_panel component to get the auto complete suggestions in the dashboard.

The VSCode script refers tobuild_jsonschema.py which seems to be replaced by build_language_schema.py but that is missing the #! & the execute flag so it doesn't run 😞

All the "docs" attributes are removed after running build_language_schema.py

Can't seem to make it work at all

I hate to ask such a novice question here, since it's clear that the extension does work and I'm overlooking some prerequisite or other step, but:

I've tried installing the extension a few times, and have never seen any of its intended results. No validation, etc.
My esphome instance is local (/usr/local/bin/esphome), version 1.17.2; VSCode 1.45.1
VSCode workspace includes a directory with all my .yaml files. They all compile cleanly and are running in production.
But if I open one in VSCode to edit, the extension doesn't seem to be active.

I've confirmed the extension settings are for a local instance, and even tried setting the path to esphome in the URI field.

Any suggestions as to what I'm doing incorrectly, I'll be grateful for.

sgp4x platform not recognized

When configuring a yaml with other platform sensors, I can hover over the name and get a popup.

When I have sgp4x defined, hovering does not display any helpful information

  - platform: sgp4x
    voc:
      name: "${upper_devicename} VOC Index"
      id: voc
    nox:
      name: "${upper_devicename} NOx Index"
      id: nox
    compensation:  # Remove this block if no temp/humidity sensor present for compensation
      temperature_source: temp
      humidity_source: humidity

Fix Security, leave_front_door_open

I was just checking how HA vscode add on uses ESPHome vscode add on and I see it is using the leave_front_door_open config and it's warning about it, etc.

Now I want to fix this but I don't know exactly how. I can learn for sure but it will be best if people with more knowledge can put me on the right track.

It will be good to do it in some way it can integrate easier with HA vscode add on, as I believe many people will be using it that way.

Otto wrote:

Authentication also will need to be resolved. The dashboard uses a "secure cookie" for this that is set when the client first logs in (at /login). The plugin will need some way of setting this cookie (or another authentication mechanism needs to be added in the backend).

So I believe a cookie can be set when the plugin opens the websocket for authentication (never did it), in that case I need the cookie.

I have no good idea of how to get the cookie?
I know if I do the post at login I'll get it, but I'll have to provide the credentials, should I present a UI in vscode for this? I hope not.

Is there someway to launch a browser window where the user logs in and then I take the cookie? I believe I've seen this in other plugins like the one that does Settings Sync.

Should a token be created in ESPHome dashboard which users manually copies into vscode settings?

Do anyone know what are good options?
@OttoWinter @frenck

Thanks!

Extension doesn't work after 0.18.0 update

[2021-06-27 19:09:15.387] [exthost] [error] Activating extension ESPHome.esphome-vscode failed due to an error:
[2021-06-27 19:09:15.387] [exthost] [error] Error: Cannot find module '/home/username/.vscode-oss/extensions/esphome.esphome-vscode-0.18.0/client/out/extension'
Require stack:
- /usr/lib/code/out/vs/loader.js
- /usr/lib/code/out/bootstrap-amd.js
- /usr/lib/code/out/bootstrap-fork.js
	at Function.Module._resolveFilename (internal/modules/cjs/loader.js:887:15)
	at Module._load (internal/modules/cjs/loader.js:732:27)
	at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
	at Function.s._load (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:106:27814)
	at Function.S._load (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:106:24531)
	at Function.a._load (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:96:58820)
	at Module.require (internal/modules/cjs/loader.js:959:19)
	at require (internal/modules/cjs/helpers.js:88:18)
	at Function.t [as __$__nodeRequire] (/usr/lib/code/out/vs/loader.js:5:101)
	at d._loadCommonJSModule (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:106:25940)
	at d._doActivateExtension (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:92:12457)
	at d._activateExtension (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:92:11516)
	at processTicksAndRejections (internal/process/task_queues.js:93:5)
	at async Promise.all (index 0)

VSCode plugin thread

This issue is for coordinating efforts on this plugin and discussing changes needed.

Need anything, post it here and I'll try to help.

Thanks ❤️

Publish ESPHome VSCode plugin to Open VSX

There's a open alternative to the Visual Studio Marketplace - Open VSX.

As Microsoft's extensions marketplace cannot be used by Code-OSS and VSCodium users for legal reasons, it's probably a good idea to make ESPHome VSCode plugin available to them there.

The publishing process is described in the Open VSX Wiki.

"/bin/sh: esphome not found" error

I have esphome installed on my home directory at ~/.local/bin/esphome; Even though ~/.local/bin is on my $PATH, the extension does not find my local esphome to validate the yaml file. It is correctly configured for local validation.

Workaround: create a symlink from ~/.local/bin/esphome to /usr/local/bin/esphome.

Otherwise, great extension, by the way!

unknown tag <!lambda> when lambda used to return a value

the !lambda syntax is not recognised when used to return a value
image

while it is recognized (and accepted) by the ESPHome integrated editor

The code is recognized as ESPHome (and not home assistant ;-) )

VSCode version: 1.75.1
ESPhome plugin version: v2022.11.0

Wrong indent in VSCode when pasting code snippets

Hi,

When I copy the last two lines of the following code (to add another sensor for example)

binary_sensor:
  - platform: template
    name: open_endstop_binary_sensor

and past it below, the indentation is changed and now below the other indented code:

binary_sensor:
  - platform: template
    name: open_endstop_binary_sensor

    - platform: template
    name: open_endstop_binary_sensor

when I change "YAML" in the Editor instead of "ESPHOME" it indents correctly

binary_sensor:
  - platform: template
    name: open_endstop_binary_sensor

  - platform: template
    name: open_endstop_binary_sensor

bug: dashboard mode sends wrong path secrets.yaml file

This issue has been reported before in #16 but the suggested fix did not work for me.

I am getting these errors for the "!secret tag".

My yaml custom tags:

    "yaml.customTags": [
      "!env_var scalar",
      "!include_dir_list scalar",
      "!include_dir_merge_list scalar",
      "!include_dir_merge_named scalar",
      "!include_dir_named scalar",
      "!include scalar",
      "!include_dir_merge_named",
      "!secret scalar"
    ],

The exact error:

Secret 'esp_wifi_ssid' not defined

image

Editor Pop-up placement

Not quite sure how to describe this - I hope this animated gif shows enough to make sense.

It seems an unrecognised item (in this case "!secret") is ignored and the info pop-up references the next component down.

In this example, it covers the cursor preventing editing

ezgif-4-f2a7f85d8b (1)

OTA "command not found: esphome" but esphome cli installed

If I click on the OTA button in the lower left corner of VS Code a new Terminal with the name 1: Task - esphome compile opens and it tries to do the OTA Update. Unfortunately it somehow can not open/find esphome in this terminal session.
Log of this terminal window:

> Executing task: esphome amp_meter_test.yaml run --upload-port OTA <

zsh:1: command not found: esphome
The terminal process "/bin/zsh '-c', 'esphome amp_meter_test.yaml run --upload-port OTA'" terminated with exit code: 127.

Terminal will be reused by tasks, press any key to close it.

If I manually open a terminal window and type the exact same command everything works like expected:

(base) tilman@MBP-von-Tilman esphome-dashboard % esphome amp_meter_test.yaml run --upload-port OTA
INFO Reading configuration amp_meter_test.yaml...
INFO Generating C++ source...
INFO Compiling app...
INFO Running:  platformio run -d amp_meter_test
Processing amp_meter_test (board: esp-wrover-kit; framework: arduino; platform: [email protected])
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
PACKAGES: 
 - framework-arduinoespressif32 3.10004.200129 (1.0.4) 
 - tool-esptoolpy 1.20600.0 (2.6.0) 
 - toolchain-xten
...

OS: Mac OS X Big Sur
esphome: 1.15.3
esphomeflasher: 1.3.0

New Climate 'Preset' options

I guess coz it's 'new' there needs to be time before VS Code gets updated too.

Opening issue just in case. 💖

E.G.:

image

Catch too big display

The following code defines a display with dimensions 30x810 which is too big for the 200 LED Strip. The esp8266 crashes when it executes this code.

light:
  - platform: neopixelbus
    type: GRB
    variant: WS2811
    pin: GPIO2
    num_leds: 200
    name: "NeoPixel"
    id: "neopixel"


display:
  - platform: addressable_light
    id: led_matrix_display
    addressable_light_id: neopixel
    width: 30
    height: 810
    #rotation: 180°
    update_interval: 16ms
    lambda: |-
          it.print(0, 10, id(roboto), "Hello World!");

font:
  - file: "gfonts://Roboto"
    id: roboto
    size: 20

Yaml extension conflict

There may be a simple solution to this, but as my ESPHome files sit under my Home Assistant config folder, VSCode is using the HA extension rather than the ESPHome extension.

Can you specify an extension to be used for a specific folder location within a workspace, or could there be an opening comment in the file to force the ESPHome extension?

Great idea.

Improve documentation to indicate importance of setting file type

I wonder if this is just my misunderstanding or a clash with other extensions, but I didn't get any of the plugin's functionality until I clicked the file type and changed it from 'YAML' to 'ESPHome'. As it doesn't appear evident from the readme, could you add a note to indicate the importance of taking that step?

Unexpected path traverse error when autocompleting in lambda

While editing lambdas my vscode extension always opens the output panel and spams these messages. Am I doing something wrong or is this a bug?

The error also contains the entire lambda.

Validating file:///s%3A/git_repos/esphome/co2sensor_lcd_mini.yaml
send {"type":"validate","file":"s:\\git_repos\\esphome\\co2sensor_lcd_mini.yaml"}
rcvd {"type":"read_file","path":"s:\\git_repos\\esphome\\co2sensor_lcd_mini.yaml"}
send {"type":"file_response","content":"esphome:\n  name: co2sensor\n\nesp32:\n  board: esp32-c3-devkitm-1\n  variant: esp32c3\n  framework:\n    type: ard
rcvd {"type":"read_file","path":"s:\\git_repos\\esphome\\secrets.yaml"}
send {"type":"file_response","content":"wifi_ssid: \"codo_der_iii\"\nwifi_password: \"pass4HASS.io_ap_isverysecure\"\n\nfritz_ssid: \"FRITZ!Box 7530 LR\"\n
rcvd {"type":"read_file","path":"s:\\git_repos\\esphome\\secrets.yaml"}
send {"type":"file_response","content":"wifi_ssid: \"codo_der_iii\"\nwifi_password: \"pass4HASS.io_ap_isverysecure\"\n\nfritz_ssid: \"FRITZ!Box 7530 LR\"\n
it.rectangle(0, 0, it.get_width(), it.get_height());
it.rectangle(32, 0, it.get_width()-32, 32);
it.rectangle(32, 32, it.get_width()-32, 32);
it.rectangle(32, 64, it.get_width()-32, 32);
it.rectangle(32, 96, it.get_width()-32, 32);      
it.filled_rectangle(0,0, 32,32);
it.filled_rectangle(0,32,32,32);
it.filled_rectangle(0,64,32,32);
it.filled_rectangle(0,96,32,32);

it.print(1,  1, id(icon_font_30), COLOR_OFF, "\U000f0954"); // clock
it.print(1, 33, id(icon_font_30), COLOR_OFF, "\U000f07e4"); // co2
it.print(1, 65, id(icon_font_30), COLOR_OFF, "\U000f050f"); // temp
it.print(1, 97, id(icon_font_30), COLOR_OFF, "\U000f058e"); // water

it.strftime(38,  1, id(text_l), "%H:%M", id(my_time).now());

if(isnan(id(co2sens).state)){
  it.printf(  38, 33, id(text_l), "---");
  it.printf(  38, 65, id(text_l), "---");
  it.printf(  38, 97, id(text_l), "---");
} else {
  it.printf(  38, 33, id(text_l), "%4.0f", id(co2sens).state);
  it.printf(  38, 65, id(text_l), "%4.1f", id(tempsens).state);
  it.printf(  38, 97, id(text_l), "%4.1f", id(humsens).state);
}

it.print(96, 36, id(text_16),       "ppm"); // ppm
it.print(96, 65, id(icon_font_30),  "\U000f0504"); // degree celsius
it.print(96, 97, id(icon_font_30),  "\U000f1278"); // percent

float co2_val = id(co2sens).state ;  // get sensor value
if(isnan(co2_val)) co2_val = 400.0; // catch Nan
co2_val = co2_val < 400 ? 400 : co2_val; // clamp value
float co2_percent = ((co2_val - 400.0)/1600.0);
int width = (int) round(it.get_width() * co2_percent);
Color col;
if(co2_val < 800.0) col = COLOR_GREEN;
else if(co2_val < 1000.0) col = COLOR_GREYE;
else if(co2_val < 1400.0) col = COLOR_YELLOW;
else if(co2_val < 1600.0) col = Color_ORANGE
else col = COLOR_RED;
// int red = (int)round(255*co2_percent);
// int green = (int)round(255*(1-co2_percent));
// auto col = Color(red, green, 0);
// auto col = Color(255,255,0);

it.filled_rectangle(0, 128, width, 32, col);
// it.printf(  2, 129, id(text_l), "%d %4.2f", width, co2_percent);
component: lambda
[Error - 12:28:53 PM] Request textDocument/completion failed.
  Message: Request textDocument/completion failed with message: Unexpected path traverse.
  Code: -32603 
rcvd {"type":"check_file_exists","path":"s:\\git_repos\\esphome\\fonts/materialdesignicons-webfont.ttf"}
send {"type":"file_exists_response","content":true}
rcvd {"type":"result","yaml_errors":[],"validation_errors":[]}

YAML file:

esphome:
  name: co2sensor

esp32:
  board: esp32-c3-devkitm-1
  variant: esp32c3
  framework:
    type: arduino
    version: latest


# Enable logging
logger:
  # hardware_uart: uart0


# Enable Home Assistant API
api:
  encryption:
    key: <redacted>

ota:
  password: <redacted>

wifi:
  ssid: !secret fritz_ssid
  password: !secret fritz_passw
  # use_address: 192.168.99.5

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Co2Sensor Fallback Hotspot"
    password: "24VuQlBcG0JP"

captive_portal:
    
# uart:
#   tx_pin: GPIO21
#   rx_pin: GPIO20
#   baud_rate: 115200

i2c:
  sda: GPIO6
  scl: GPIO7
  frequency: 800kHz

font:
  - file: "gfonts://Roboto"
    id: text_l
    size: 24
  - file: "gfonts://Roboto"
    id: text_16
    size: 16
  - file: 'fonts/materialdesignicons-webfont.ttf'
    id: icon_font_30
    size: 30
    glyphs: [
      "\U000f050f", # mdi-thermometer
      "\U000f058e", # mdi-water-percent
      "\U000f07e4", # mdi-molecule-co2
      "\U000f0504", # mdi-temperature-celsius
      "\U000f0954", # mdi-clock
      "\U000f1278", # mdi-percent-outline
      ]

color:
  - id: COLOR_BLACK_CUST
    white: 0%
  - id: COLOR_GREEN
    green: 80%
    red: 30%
    blue: 20%
  - id: COLOR_GREYE
    green: 80%
    red: 60%
    blue: 20%
  - id: COLOR_YELLOW
    red: 100%
    green: 100%
  - id: COLOR_ORANGE
    red: 100%
    green: 65%
  - id: COLOR_RED
    red: 100%
  - id: COLOR_PURP
    red: 100%
    blue: 25%
    
sensor:
  - platform: scd4x
    update_interval: 30s
    co2:
      name: "Wohnzimmer CO2"
      id: co2sens
    temperature:
      name: "Wohnzimmer Temperature"
      id: tempsens
    humidity:
      name: "Wohnzimmer Humidity"
      id: humsens
    altitude_compensation: "337m"

time:
  - platform: sntp
    id: my_time
    on_time: 
      - seconds: 0
        minutes: "*"
        then:
          - component.update: screen
          # - uart.write: 'Hello World'

spi:
  clk_pin: GPIO8
  miso_pin: GPIO9
  mosi_pin: GPIO10

display:
  - platform: st7735
    model: "INITR_GREENTAB"
    cs_pin: GPIO3
    dc_pin: GPIO2
    reset_pin: GPIO4
    rotation: 0
    device_width: 128
    device_height: 160
    col_start: 0
    row_start: 0
    eight_bit_color: true
    update_interval: 5s
    invert_colors: false
    use_bgr: true
    id: screen
    lambda: |-
      it.rectangle(0, 0, it.get_width(), it.get_height());
      it.rectangle(32, 0, it.get_width()-32, 32);
      it.rectangle(32, 32, it.get_width()-32, 32);
      it.rectangle(32, 64, it.get_width()-32, 32);
      it.rectangle(32, 96, it.get_width()-32, 32);      
      it.filled_rectangle(0,0, 32,32);
      it.filled_rectangle(0,32,32,32);
      it.filled_rectangle(0,64,32,32);
      it.filled_rectangle(0,96,32,32);

      it.print(1,  1, id(icon_font_30), COLOR_OFF, "\U000f0954"); // clock
      it.print(1, 33, id(icon_font_30), COLOR_OFF, "\U000f07e4"); // co2
      it.print(1, 65, id(icon_font_30), COLOR_OFF, "\U000f050f"); // temp
      it.print(1, 97, id(icon_font_30), COLOR_OFF, "\U000f058e"); // water

      it.strftime(38,  1, id(text_l), "%H:%M", id(my_time).now());

      if(isnan(id(co2sens).state)){
        it.printf(  38, 33, id(text_l), "---");
        it.printf(  38, 65, id(text_l), "---");
        it.printf(  38, 97, id(text_l), "---");
      } else {
        it.printf(  38, 33, id(text_l), "%4.0f", id(co2sens).state);
        it.printf(  38, 65, id(text_l), "%4.1f", id(tempsens).state);
        it.printf(  38, 97, id(text_l), "%4.1f", id(humsens).state);
      }

      it.print(96, 36, id(text_16),       "ppm"); // ppm
      it.print(96, 65, id(icon_font_30),  "\U000f0504"); // degree celsius
      it.print(96, 97, id(icon_font_30),  "\U000f1278"); // percent

      float co2_val = id(co2sens).state ;  // get sensor value
      if(isnan(co2_val)) co2_val = 400.0; // catch Nan
      co2_val = co2_val < 400 ? 400 : co2_val; // clamp value
      float co2_percent = ((co2_val - 400.0)/1600.0);
      int width = (int) round(it.get_width() * co2_percent);
      Color col;
      if(co2_val < 800.0) col = COLOR_GREEN;
      else if(co2_val < 1000.0) col = COLOR_GREYE;
      else if(co2_val < 1400.0) col = COLOR_YELLOW;
      else if(co2_val < 1600.0) col = COLOR_ORANGE;
      else col = COLOR_RED;
      // int red = (int)round(255*co2_percent);
      // int green = (int)round(255*(1-co2_percent));
      // auto col = Color(red, green, 0);
      // auto col = Color(255,255,0);

      it.filled_rectangle(0, 128, width, 32, col);
      // it.printf(  2, 129, id(text_l), "%d %4.2f", width, co2_percent);

!secret syntactic error

Hi,
These lines are given me some syntactic error into vscode when using a separated yaml file for paswords (secrets.yaml)

wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password

How can I figure out this behavior
thanks

unable to find the extension in vs code

for some reason, after uninstalling the extension, I'm unable to find it again in the extension list.
If I search for esphome I do not get any result so I can't install it back.
Did this happen to anybody else?

error esphome

I have hassio on docker with ubuntu, and I install vscode addos, work fine with the Home Assistant Config Helper, but with esphome I have problems, because esphome show me a error constantly, like

Cannot connect to ESPHome dashboard. Make sure you can access to ${this.endPoint} and have set option 'leave_front_door_open': true

I put that configuration on Esphome addos config, but always it´s the same.

And In myy Esphome Config Extensions on VsCode I have On dashboard Uri: addon_15ef4d2f_esphome:6052
and Validator: Dashboard but error all time...help me please..

How to use with python venv?

Hi!
I have Esphome cli installed in venv in same directory as all my .yaml's - can I configure this extension to use this instead of global system settings?

Can it be configured to work with a containerised esphome instance?

I would love to use this really useful extension, but I'm not sure how to configure it with my setup.

I have homeassistant and esphome running in separate docker containers on a NAS drive and have nothing running local on my PC.
I'm a little confused about the settings and whether I should be using dashboard or local, but setting either to use the URL of my esphome dashboard does not seem to work.
Are there ports on on the docker container I need to open up?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.