Hello!
I am looking for the best way to show a devices “Status” on a state card in the UI instead of the devices “state”.
My example is my Roomba, the state is only ever On or Off, whereas the status will show things like Charging, User Docking, Stuck, User Docking and I would like to see that information.
I’m not sure if I need to make a custom UI card (which sounds difficult) or if I’m missing something in the docs.
Thanks!
lolouk44
(lolouk44)
October 15, 2018, 2:57pm
2
Create a template sensor that will return the status of the device and display that sensor on your card:
Thanks for the tip, I was afraid that might be the case. Strange there’s not an easy way just to display that info
lolouk44
(lolouk44)
October 15, 2018, 4:19pm
4
what’s complicated?
I’ve used loads of them for my vacuum, feel free to reuse them
- platform: template
sensors:
xiaomi_battery_level:
entity_id: vacuum.mi_robot_vacuum
value_template: >
{{ state_attr("vacuum.mi_robot_vacuum","battery_level") }}
friendly_name: Battery Level
unit_of_measurement: '%'
icon_template: '{{ state_attr("vacuum.mi_robot_vacuum","battery_icon") }}'
xiaomi_cleaned_area:
entity_id: vacuum.mi_robot_vacuum
value_template: >
Area Cleaned: {{ state_attr("vacuum.mi_robot_vacuum","cleaned_area") }}
friendly_name: Cleaned Area
unit_of_measurement: 'm²'
icon_template: 'mdi:chart-areaspline'
This file has been truncated. show original
Thanks for this!
I’ve gotten this far:
- platform: template
sensors:
roomba_status:
friendly_name: "Roomba Status"
value_template: "{{ states.vacuum.roomba.status }}"
But it doesn’t appear to be giving me the actual status, just a blank value. Any ideas?
lolouk44
(lolouk44)
October 15, 2018, 4:32pm
6
it should be
value_template: "{{ states.vacuum.roomba.attributes.status }}"
1 Like
YES! Thank you!
That makes so much sense considering the fact that I address this information in NodeRed as : msg.data.attributes.status
Thank you!