General sensor info about each esp32 device

Hi,
I’ve got a couple of esp32 devices added into my esphome dashboard.
I’m curious if its possible to add some general sensor information to each one of them? So I’m able to send it to Home Assistant and use it there.

Like: temperature of the esp32 device, RSSI, free memory and cpu for instance?
maybe also the uptime and if there’s an update available?

RTM:

The device won’t know if there’s an ESPHome update available, but there are general update sensors for HA.

2 Likes

There’s also debug.

As an example, I add the following at the bottom of all my ESPHome .yaml files:

# WiFi sensor
  - platform: wifi_signal
    name: "Device WiFi Signal dBm"
    id: "device_wifi_signal_dbm"
    update_interval: 5.0min
    entity_category: "diagnostic"
    internal: true

# Reports the WiFi signal strength in %
  - platform: copy 
    name: "Device WiFi Signal"
    id: "device_wifi_signal"
    source_id: device_wifi_signal_dbm
    unit_of_measurement: '%'
    entity_category: "diagnostic"
    filters:
      - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);

# Retrieve ESPHome version information
text_sensor:
  - platform: version
    name: "Device ESPHome Version"
    id: device_esphome_version
    internal: true
    icon: 'mdi:chevron-right'
2 Likes

My generic stuff

button:
  - platform: restart
    name: "Restart"
    
binary_sensor:    
  - platform: status
    name: Status
  - platform: gpio
    name: Boot Switch
    pin: 
      number: GPIO00
      inverted: true
      mode:
        input: true
        pullup: true

sensor:
  - platform: template
    id: esp_memory
    icon: mdi:memory
    name: Free Memory
    lambda: return heap_caps_get_free_size(MALLOC_CAP_INTERNAL) / 1024;
    unit_of_measurement: 'kB'
    state_class: measurement
    entity_category: "diagnostic"
  - platform: uptime
    name: Uptime
    id: sys_uptime
  - platform: wifi_signal 
    name: RSSI
    id: wifi_signal_db
    entity_category: "diagnostic"
  - platform: internal_temperature
    id: esp_internal_temperature
    name: "Internal Temperature"
    
text_sensor:
  - platform: wifi_info
    ip_address:
      name: IP Address
2 Likes