ESP Home - phantom devices

Guys,

I flashed an ESP32 for testing purposes to use a a BLE reader for some Xiaomi Temperature and humidity devices (i am fairly new at HA and ESPHome).

All went well so i decided to move the devices from my test area into the area where they will be used on an ongoing basis - when doing that i then added a 2nd Xiaomi sensor and did an OTA update - at this point what i wanted to do was

  1. Rename the ESPhome device so it showed correctly (as to location) in HA
  2. Rename the existing Xiaomi to the correct new name to represent its location
  3. Add the 3rd device

So i am having a couple of problems

  1. When i tried to rename the YAML and device it appeared that the YAML name dictates what DHCP name ESPHome looks for when trying to do OTA updates - even though i restarted my DHCP server and deleted the reservation in there it appeared that ESPHome still had this info cached somewhere so it was failing the OTA - so in the end i went back to the old name for the time being
  2. Even though i have renamed the sensors when i look at the MQTT stream (using MQTT-SPY) i can still see the old sensor being reported on (as well as the new name) - even though this does not show up in my YAML
  3. I have two of the same sensors - one i would like to show as Parents Bedroom Temp, Humidity and Battery - the other as Wardrobe Temp, Humidity and Battery (YAML snippet below) - however in the card in Lovelace (auto generated) - i am seeing the first device reported as just Temperature, Humidity and Battery (i.e. it is dropping the Bedroom at the start) - this is probably me just not understanding correct YAML syntax - any pointers for multiple sensors of the same type ?
esp32_ble_tracker:

sensor:
  - platform: xiaomi_lywsdcgq
    mac_address: 58:2D:34:32:DE:27
    temperature:
      name: "Parents Wardrobe Temperature"
    humidity:
      name: "Parents Wardrobe Humidity"
    battery_level:
      name: "Parents Wardrobe Battery Level"
  - platform: xiaomi_lywsdcgq
    mac_address: 58:2D:34:32:EF:C4
    temperature:
      name: "Parents Bedroom Temperature"
    humidity:
      name: "Parents Bedroom Humidity"
    battery_level:
      name: "Parents Bedroom Battery Level" 

image

Craig

Snap had the same problem

what I did
copy and yaml datapaste into text doc for safe keeping

delete it from the Dashboard
(can’t rember this bit but go check if done from the integration and delete from there)

reboot (just play safe)

back to esphome dashbaord and build a new one getting the names wording right (LOL think we all done this)

them paste back the the yaml stuff re upload done

I tryed playing round the the esphome folder just made it worser

just a note

there was a bug in the BLE where it would stop sending data after some point of time
(could be fix now)

but i have a switch: in mine that reboot every 12 hours they haven’t mis a beat

time:
  - platform: homeassistant
    on_time:
      - seconds: 0
        minutes: 0
        hours: 4
        days_of_week: MON-SUN
        then:
           - switch.toggle: restartit
      - seconds: 0
        minutes: 0
        hours: 16
        days_of_week: MON-SUN
        then:
           - switch.toggle: restartit
switch:
  - platform: restart
    name: "Restart"
    id: restartit

Good one thanks - not sure if this will solve my DHCP caching issue though ? WIll give it a go and see what happens

Craig

OK that got me started but i still have the incorrect names being populated in Lovelace - this is my YAML snippet

esp32_ble_tracker:

sensor:
  - platform: xiaomi_lywsdcgq
    mac_address: 58:2D:34:32:DE:27
    temperature:
      name: "Parents Wardrobe Temperature"
    humidity:
      name: "Parents Wardrobe Humidity"
    battery_level:
      name: "Parents Wardrobe Battery Level"
  - platform: xiaomi_lywsdcgq
    mac_address: 58:2D:34:32:EF:C4
    temperature:
      name: "Parents Bedroom Temperature"
    humidity:
      name: "Parents Bedroom Humidity"
    battery_level:
      name: "Parents Bedroom Battery Level"

and here is a screenshot of what is coming up in the default lovelace dashboard.

To get to here i had deleted everything, removed ESPHome from HA and then restarted and readded HA, then recreated the new device

Can anyone explain what is wrong with this sensors section in my YAML and why the sensor names come out differently ??

image

Craig

I think i have worked it out - if the area is the same name as the system it appears that it drop the name from the sensor - so i have rename my area to Parents Retreat and now all the sensors show up as expected

Craig