ESPHome / Home Assistant Not Showing Entities

I have been working on this issue all day, and now it is 1am in my part of the world. I am exhausted and despite trying just about everything I cannot get solve the issue. I’ve tried new ESP32 boards, brand new configurations, renaming, read numerous posts on this forum… but nothing works.

Here’s the YAML code…

esphome:
  name: "esp1-studio-climate"
  platform: esp32
  board: az-delivery-devkit-v4
  on_boot:
    - lambda: 'id(studio_fan_climate).mode = climate::CLIMATE_MODE_COOL;'

# Enable logging
logger:
  level: VERBOSE

# Enable Home Assistant API
api:
  encryption:
    key: "<REDACTED>"

ota:
  password: "<REDACTED>"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "esp1-studio-climate hot spot"
    password: "<REDACTED>"

captive_portal:

# MQTT Interface
mqtt:
  broker: !secret mqtt_broker
  port: 1883
  reboot_timeout: 0s
  keepalive: 60s
  discovery: false
  on_message:
    - topic: HomeAssistant/Studio/Aircon/Status
      payload: "OFF"
      qos: 0
      then:
        - binary_sensor.template.publish:
            id: ac_status
            state: off
        - logger.log: "The AC is OFF"
    - topic: HomeAssistant/Studio/Aircon/Status
      payload: "ON"
      qos: 0
      then:
        - binary_sensor.template.publish:
            id: ac_status
            state: on
        - logger.log: "The AC is ON"

#Temperature Sensor Pin
dallas:
  - pin: 18
    update_interval: 30s

#Relay switches
switch:
  - platform: gpio
    pin: 
      number: 25
      inverted: True
    id: studio_damper_sw
    name: "Studio Damper Switch"
    restore_mode: RESTORE_DEFAULT_OFF
  - platform: gpio
    pin: 
      number: 26
      inverted: True
    id: studio_fan_sw
    name: "Studio Fan Switch"
    restore_mode: RESTORE_DEFAULT_OFF

# Binary Sensors
binary_sensor:

# AC status
  - platform: template
    id: ac_status
    on_press:
      - binary_sensor.template.publish:
          id: climate_status
          state: off
    on_release:
      - binary_sensor.template.publish:
          id: climate_status
          state: on
  - platform: template
    id: climate_status
    on_press:
      - climate.control:
          id: studio_fan_climate
          mode: 'cool'
      - switch.turn_on: studio_damper_sw
    on_release:
      - climate.control:
          id: studio_fan_climate
          mode: 'off'
      - switch.turn_off: studio_damper_sw

# Studio Air Conditioner Status from HA  
  - platform: homeassistant
    id: studio_ac_climate
    name: "Studio AC Status from HA"
    entity_id: binary_sensor.studio_ac_climate

# Studio Temperature Sensors
sensor:

# Studio Dallas Inside Temperature
  - platform: dallas
    id: studio_temp_in
    resolution: 12
    address: 0x1101143025227D28

# Studio Outside Temperature
  - platform: dallas
    id: studio_temp_out
    resolution: 12
    address: 0xE602131B13F9AA28
    on_value:
        then:
          - if:
              condition:
                and:
                  # Is the outside temp below 18 and the AC off
                  - binary_sensor.is_off: studio_ac_climate
                  - lambda: 'return id(studio_temp_out).state < 18;'
              then:
                  # Open the damper
                  - binary_sensor.template.publish:
                     id: climate_status
                     state: on
                  - mqtt.publish:
                     topic: HomeAssistant/Studio/Damper/Status
                     payload: "1"
                  - logger.log: "The damper and climate is active"
          - if:
              condition:
                or:
                  # Is the outside temp above 18 or the AC on
                  - binary_sensor.is_on: ac_status
                  - lambda: 'return id(studio_temp_out).state > 18;'
              then:
                  - binary_sensor.template.publish:
                     id: climate_status
                     state: off
                  - mqtt.publish:
                     topic: HomeAssistant/Studio/Damper/Status
                     payload: "0"
                  - logger.log: "The damper and climate is off"

climate:
  - platform: thermostat
    name: "Studio Climate Controller"
    sensor: studio_temp_in
    min_cooling_off_time: 120s
    min_cooling_run_time: 120s
    min_idle_time: 30s
    id: studio_fan_climate
    cool_action:
      - switch.turn_on: studio_fan_sw
      - logger.log: "The fan is now on"
      - mqtt.publish:
          topic: HomeAssistant/Studio/Fan/Status
          payload: "1"
    idle_action:
      - switch.turn_off: studio_fan_sw
      - logger.log: "The fan is now off"
      - mqtt.publish:
          topic: HomeAssistant/Studio/Fan/Status
          payload: "0"
    default_preset: Studio
    preset:
      - name: Studio
        default_target_temperature_high: 22 °C
        mode: COOL

No matter what I do, I cannot get HA to identify the following sensors…

studio_temp_out
studio_temp_in

Here’s a screen grab of what HA sees…

Yet, this is what is seen in the esphome device logs…

[00:42:57][D][dallas.sensor:143]: 'studio_temp_out': Got Temperature=17.5°C
[00:42:57][V][sensor:076]: 'studio_temp_out': Received new state 17.500000
[00:42:57][D][sensor:127]: 'studio_temp_out': Sending state 17.50000 °C with 1 decimals of accuracy

And…

[00:43:26][D][dallas.sensor:143]: 'studio_temp_in': Got Temperature=23.7°C
[00:43:26][V][sensor:076]: 'studio_temp_in': Received new state 23.687500
[00:43:26][D][sensor:127]: 'studio_temp_in': Sending state 23.68750 °C with 1 decimals of accuracy

So the esphome can ‘see’ the entities, but for some reason HA cannot?

I know if will be something really simple, I think I am at a point where I am going around in circles.

Any help, suggestions, very much appreciated.

First thing I’d check is the the encryption key. Does it match your HA device configuration? Make sure there’s no spaces at the beginning or end.

Hi @rcblackwell thanks for replying, much appreciated. I recalled it related to the ‘name’ parameter, so I changed my code to…

  - platform: dallas
    name: studio_temp_in
    id: studio_temp_in
    resolution: 12
    address: 0x1101143025227D28

And it appears to be working. Newby mistake after a long day of solving many other issues.

Thanks, Mark

Yes, I missed that. Pleased to hear it’s working.

Thanks. Still doing some wierd stuff, but I’ve had 2 hours sleep, so it can wait :sleeping: