-
-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change EMS-ESP device sensor types in Home Assistant #751
Comments
Good points. Which version are you using? |
v3.4.4 |
regarding the 'uptime' ISO 8601 is not good for showing the elapsed time. It's better to add the boot time to the MQTT info topic (if NTP is running) : {
"event": "connected",
"version": "3.5.0b9",
"connection": "ethernet",
"hostname": "ems-esp",
"MAC": "A8:05:2A:68:64:DF",
"IPv4 address": "192.168.1.134/255.255.255.0",
"IPv4 gateway": "192.168.1.1",
"IPv4 nameserver": "192.168.1.1"
} |
and |
I made the changes to status. For uptime, it needs more thinking and some help from your end |
Thanks for the updates! What do you need from me about uptime? |
see my earlier response. uptime is elapsed time and shouldn't change. I think you're after the time when the system was started so HA can calculate the uptime (e.g. "2 days ago") |
You are right it is enough to set it in birth mqtt message. |
added boot_time |
Is your feature request related to a problem? Please describe.
I'm using EMS-ESP32 with Home Assistant. My problem is that some of EMS-ESP device sensors have "wrong type". I know I could use template sensors to fix the problem but it would nice if EMS-ESP could register these sensors with the "correct type". The following sensors are problematic:
status
ntp_status
uptime
Describe the solution you'd like
I think the following modifications needed:
status
: it should be registered as abinary_sensor
withconnectivity
device class and not as asensor
. By doing this Home Assistant will localize the value toconnected
ordisconnected
or whatever based on the selected language. Also have to mention that Home Assistant dashboard can change color of binary sensor's icon natively based on it state. With the current string valueconnected
it is only possible if I introduce a template binary sensor or if I'm using a third party ui component.ntp_status
: same asstatus
sensor.uptime
: the natively supported uptime sensor in Home Assistant returns thetimestamp
of booting in ISO 8601 format (eg:2022-11-15 20:46:38.049117
). If NTP is enabled EMS-ESP could also provide this value. The device class of the sensor should betimestamp
. By this modification Home Assistant can natively convert the elapsed time to more easily readable text on the dashboards (for example:2 days ago
). One more note: the devices in Home Assistant which reports uptime and has an RTC or NTP connection reports the booting time as uptime.The text was updated successfully, but these errors were encountered: