ESPHome Device Status Sensor

Hi,

I saw following code in few of the configurations shared by ESPHome users:

binary_sensor:
  - platform: status
    name: "device_name Status"

It creates a sensor that displays “connected” status in the UI. But if the device is not connected then it will show up as “unavailable”.

status

And I cannot think of any scenarios where the device might be functional via HA and not just “connected”.

So what is the use of this status sensor? Is there a use case where status comes in handy?
Thanks!

I don’t use this sensor, but rather wifi signal strength, which beside information if it’s available also shows wifi signal in dBm.
What’s the useable scenario? I use it for monitoring - if any of my devices goes offline i get a message on my phone: HERE is one addon for this.

I also have several wifi AP’s. When i see signal strength i know if device is connected to the nearest wifi or not… and if signal is too weak i hit “restart” button to reconnect wifi device to a nearer wifi AP.

1 Like

Pavel, I am so glad that I asked the question because I also had doubts about the “restart” sensor and was also wondering how to deal with “unavailable” devices once they go offline without notice - so much for my home alarm system :sweat_smile:

Let me review the git repo and experiment - thanks for pointing me in the right direction!!

I hope that you didn’t missunderstood me… the “restart” button obviously doesn’t work if device is offline… As said, i use it if device is online, but has very poor wifi signal.

Are you sure about that?

I’m currently re-networking my house and can see at a glance what is offline as well as getting notifications.

No Tom I am not sure and it is part of the frustration that I am trying to solve. Here is one instance, I wired the whole house on couple of NodeMCUs and today I realized that I did not get the notification when door was opened only to find out that NodeMCU was offline and all its entities marked unavailable hence notification automation did not trigger.

But I liked ( @Protoncek ) Pavel’s idea to monitor Wifi signal strength and identify areas where devices seems to be struggling and solve as needed. This is a work in progress and I will be adding “status” and “Wifi Signal” sensor to all of my ESPHome devices and monitor from here on.

It’s easy to monitor the ESP status binary sensors.

trigger:
  - platform: state
    entity_id: binary_sensor.kitchen_leak_status
    to: 'off'

I use this with a esp8266 under my motorbike seat, so when I start my bike the garage goes up and when I arrive home the status changes to connected and garage door opens.

Is there a better way for me to be doing this?

1 Like

Thanks for this example, Tom. I am trying to find the time that you are displaying and the status. do I need to follow the example above of

binary_sensor:
  - platform: status
    name: "device_name Status"

Yes you need to follow that example to get the status binary sensor from ESPHome.

The time is displayed using the secondary info option of the entities card row.

Entities card config:

show_header_toggle: false
state_color: true
title: Device Status
type: entities
entities:
  - entity: binary_sensor.bathroom_dht_status
    name: Bathroom DHT
    secondary_info: last-changed ##### <-this #####

See: https://www.home-assistant.io/dashboards/entities/#secondary_info

Got it, thank you. I see the other secondary info stuff as well.