ESPHome. Flash is successful, changes not reflecting in home assistant

Good day,

I flashed a config file to my ESPHome device, and everything worked perfectly. Now I’m trying to update the device, but it isn’t working the way I expect:

I added a new GPIO binary sensor and re-flashed it. The logs in ESPHome show up properly, and toggling the GPIO pin is properly reflected in the logs, but the new binary sensor doesn’t show up in the ESPHome add on in Home Assistant
![image|455x79]

Here you can see the device is being toggled.
(upload://wy7bGhuHmApQOiudAVrMrz348ZI.png)

Here you can see where the binary sensor isn’t showing up in Home Assistant.
image

I also tried changing the pin my addressable LEDs were on. In the logs, the changes are reflected, but in Home Assistant, when I turn on/off the LEDs, the wrong LED is changing.

When I turn on the nursery light, the indicator light turns on, so I swapped the pins in my config, but the nursery light still changes the physical indicator light.
image

I’ve tried restarting the device, I’ve tried removing and readding to Home Assistant, not sure where to go next.

Any help is appreciated. Thanks

Clear the browser cache.

Thanks for the suggestion. That doesn’t seem to have worked.

Did you give it a name in the config? That’s what HA uses.

Sensors don’t show up in the addon.

If you are talking about the integration, delete the device from setting/devices & services/esphome and re add it.

Post your YAML file. Otherwise, we’re just guessing.

I guess it didn’t occur to me that it could be that because it works in the logs.

@Demusman Yes, I believe I did. See config below.

@nickrout Sorry, yes. I mean the integration. I did delete the device from the integration and re-add it, no dice.

@stevemann I posted the yaml below.

esphome:
  name: nursery_esp
  friendly_name: Nursery

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "key"

ota:
  password: "key"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Br-Test2 Fallback Hotspot"
    password: "key"

captive_portal:
    
sensor:
  - platform: wifi_signal
    name: WIFI

binary_sensor:
  - platform: gpio
    pin:
      number: 16
      mode: 
        input: True
        pullup: True
    name: Help Request
    id: help_requested
    filters:
      - invert:
      - delayed_off: 250ms

  - platform: gpio
    pin:
      number: 17
      mode: 
        input: True
        pullup: True
    name: Night Light Toggle
    id: night_light_toggle
    filters:
      - invert:
      - delayed_off: 250ms

  - platform: gpio
    pin:
      number: 18
      mode: 
        input: True
        pullup: True
    name: Nap Start
    id: nap_start
    filters:
      - invert:
      - delayed_off: 250ms

  - platform: gpio
    pin:
      number: 19
      mode: 
        input: True
        pullup: True
    name: Nap End
    id: nap_end
    filters:
      - invert:
      - delayed_off: 250ms

  - platform: gpio
    pin:
      number: 21
      mode: 
        input: True
        pullup: True
    name: Feed Started
    id: feed_started
    filters:
      - invert:
      - delayed_off: 250ms

  - platform: gpio
    pin:
      number: 15
      mode:
        pullup: True
        input: True
    id: test_deleteme
    filters:
      - delayed_off: 250ms



globals:
  - id: gR
    type: int[17]
    restore_value: no
    initial_value: '{100, 110, 120, 130, 140, 150, 160, 169, 179, 188, 198, 207, 217, 226, 236, 245, 255}'
  - id: gG
    type: int[17]
    restore_value: no
    initial_value: '{0, 0, 0, 0, 0, 0, 23, 42, 62, 81, 105, 125, 140, 155, 185, 200, 220}'
  - id: gB
    type: int[17]
    restore_value: no
    initial_value: '{0, 0, 0, 0, 0, 0, 9, 19, 28, 37, 46, 56, 65, 74, 83, 93, 102}'

light:
  - platform: neopixelbus
    pin: 22
    num_leds: 1
    type: GRB
    variant: ws2812x
    name: 'Indicator Light'
    id: nursery_indicator_light
    restore_mode: ALWAYS_OFF
    effects:
      - strobe:

  - platform: neopixelbus
    type: GRB
    variant: ws2812x
    pin: 33
    num_leds: 15
    name: 'Nursery Night Light'
    id: nursery_night_light
    restore_mode: ALWAYS_OFF
    effects:
      - addressable_lambda: 
          name: 'Fast Sunrise'
          update_interval: 2000ms
          lambda: |-
            static int i;
            static int y;

            if (initial_run) {
              //y = sizeof(id(gR));
              //ESP_LOGD("main", "Y = %d", y);
              it.all() = Color(0,0,0);
              i = 0;
            }

            if (i < 17) {
              it.all() = Color(id(gR)[i], id(gG)[i], id(gB)[i]);
              ESP_LOGD("main", "R = %d  -  G = %d  -  B = %d", id(gR)[i], id(gG)[i], id(gB)[i]);
              i++;
            }
      - addressable_lambda: 
          name: 'Sunrise'
          update_interval: 3500ms
          lambda: |-
            static int i;
            static int points = 17;
            static int y = it.size() + points;

            if (initial_run) {
              it.all() = Color(0,0,0);
              i = 0;
            }

            ESP_LOGD("main", "y = %d - i = %d", y, i);

            if (i < y) {
              for (int x = it.size(); x > 0; x--) {
                it[x] = it[x - 1].get();
              }

              if (i < points) {
                it[0] = Color(id(gR)[i], id(gG)[i], id(gB)[i]);
                ESP_LOGD("main", "R = %d  -  G = %d  -  B = %d", id(gR)[i], id(gG)[i], id(gB)[i]);
                i++;
              }
            }
      - addressable_lambda:
          name: 'Fade in red'
          update_interval: 1000ms
          lambda: |-
            static int i;
            static int x = 5;
            static int y = 51;

            if (initial_run) {
              it.all() = Color(0,0,0);
              i = 0;
            }

            if (i <= y) {
              it.all() = Color(i * x, 0, 0);
              ESP_LOGD("main", "R = %d", i);
              i++;
            }
      - addressable_flicker:
          name: "Flicker"
          update_interval: 32ms
          intensity: 15%
      - addressable_twinkle: 
          name: "Twinkle"
          twinkle_probability: 15%

I don’t recall you saying what you added/changed, but if it is “test_deleteme” I see the problem.

If not, what were you expecting to see on the dashboard?

Awesome! Progress, hopefully!

I have tried to change a few things:

  • I want to switch the pins on my two neopixelbus lights. 22 ↔ 33.
  • I tried adding a strobe effect on the indicator light
  • I added the test_deleteme binary sensor.

No name. It won’t show without a name.

One issue at a time.

What @Demusman said.

Changing the pins shouldn’t affect this. I don’t see anything wrong in your configuration YAML. I would like to see the card configuration. The only way I know to see this is to add it to the dashboard then edit the card. You can always delete it later.

Okay, wonderful. My test is now showing up. For some reason I thought the name was optional. Thanks for helping.

I’m still left with the problem where switching the pin numbers isn’t updating in the home assistant ui.

I’m going into the esphome integration and toggling the night light, but the indicator light is turning on. Toggling the indicator in HA does nothing.

Be specific. Is there an indicator light somewhere, is this a light component? are you referring to the indicator on the card?

Hi, @stevemann, I’m referring to these two lights.

I’ve swapped the pin numbers in my config and reflashed it, but turning on the Nursery Night Light in the integration UI still turns on the Indicator Light. Turning on the Indicator Light in the integration UI does nothing.

I would still like to see the card configuration. From your description, I would guess that there is something wrong, so basic that none of us can spot it.

When you say, “Turn it on”, how are you turning it on? Are you using the switch in “Devices”, the device web site, or some other physical control?

So far, I’ve only been turning it on from the ESPHome Integration, since it is still in the tinkering stage and hasn’t been worked into any automations.

Which card are you referring to? I don’t have this set up on any dashboards.

Post 11

ESPHome. Flash is successful, changes not reflecting in home assistant - ESPHome - Home Assistant Community (home-assistant.io)

Whenever you make changes that would present on the device dashboard, always clear the browser cache.

Just curious, have you tried another browser?

I added it to a dashboard. Here are the cards. Apologies if this isn’t what you meant.

type: tile
entity: light.nursery_esp_indicator_light
type: tile
entity: light.nursery_esp_nursery_night_light

I’ve tried it in Chrome, Edge, and the Android app.

That rules out a browser or cache error.

I am really at a loss now. Did everything work until you changed the pin numbers in the configuration yaml file?

I think everything was working before this, but while writing this, I noticed an old ESP32 on my desk that I junked a long time ago because it was faulty. I remember it had similar issues to this, where the flash seemed to work, but after a while, changes would only show up in ESPHome every few flashes.

I think I’ll try removing and reinstalling my ESPHome integration and see if that helps.

Thanks for trying,