New Custom UI features: Context-aware names, Context-aware hiding, Badges!

New release of Custom UI

##New feature: Badges in state cards.

##New feature: Context-aware names:


The same device can get different names in different groups.

Feedback is welcome :slight_smile:

10 Likes

Awesome!
Naming in different groups is good because as you say, if youā€™re in a bedroom tab, you donā€™t want your sensor to be called ā€˜Bedroom Sensorā€™, just ā€˜Sensorā€™ would do. but in another view (history seems to be a problem), the ā€˜Sensorā€™ just wouldnā€™t do.

Iā€™ll try it out *Iā€™m already using the light slider.

I just pushed an update that supports context-aware names in views too (not just in groups).

This is great thanks, I have it working with my lights and some context aware names. Very useful!

I am having trouble getting a badge to show. Iā€™d like to show the moisture level on my plants. I have:

  customize_glob:
    plant.*:
      custom_ui_state_card: custom-ui
      extra_badge:
        attribute: moisture
        unit: "%"

I tried it using the sensor entity_id but that didnā€™t work either, I donā€™t get a badge. Your example seems straight forward, what am I missing?

Any errors in Chrome dev console?
Does the the moisture attribute have a value?

1 Like

Hereā€™s one of the plant.entities

They do take a minute or so to get a value after reboot, but they typically all come online pretty quick.

The only error I see in the Chrome dev console is:

Uncaught (in promise) DOMException: Only secure origins are allowed (see: https://goo.gl/Y0ZkNV).

Oh, I just remembered that extra_badge is only supported for light and cover domains.

Ah, it would be great if that feature (and the last changed subtext!) could be extended to other domains. Especially knowing last changed on a sensor would be super useful

Added support for Hide Control, Show Last Changed, Extra Data Attribute, and Extra Badge to any toggle card (like switch or lock) or plain card (like sensor, or group).

Note that ā€œspecialā€ cards, like Binary Sensor, Climate, Weather are still not supported.

Context aware names doesnā€™t seem to be working on Androidā€¦

Also, any chance we can get your golden touch on the custom fan I started, @andrey? Doesnā€™t work with all the new features and Iā€™m a bit out of my league!

@kylerw Does this work when you open it from desktop? Is this Chrome or Android App? The UI doesnā€™t look familiar.

As for Fan UI - I have plenty of feature planed, and I donā€™t own a Fan, so I donā€™t want invest in this.

Yes, I clicked the light and brought up the more info pane. It does work on chrome desktop. This is chrome on Android.

So, I saw this in oakbrads code and I love it! I used exactly the same code heā€™s using to get a ā€œpibadgesā€ group to show up in a ā€œpiā€ card but I canā€™t get it to work. I created the www folder and put the necessary files in place. If I use the *.* in the custom-ui it applies the custom UI to all my cards and they all disappear. If I use *.pi* it applies custom UI to just the two cards with ā€œpiā€ in the name and I can see them listed as ā€œcustom_ui_state_card: custom-uiā€ but I donā€™t see any badges. Any suggestions?

Hereā€™s the configuration.yaml section:

customize_glob: !include config/custom-ui.yaml    

pi:
  name: Home Assistant Pi
  control: hidden
  entities:
    - group.pibadges
    - sensor.since_last_boot
pibadges:
  entities:
    - sensor.ram_use
    - sensor.cpu_use
    - sensor.disk_use_
    - sensor.disk_free_

and the custom-ui.yaml

"*.pi*":
  custom_ui_state_card: custom-ui
group.pibadges:
  state_card_mode: badges
  badges_list:
    - sensor.ram_use
    - sensor.cpu_use
    - sensor.disk_use_
    - sensor.disk_free_

Any ideas? Thanks!

Did you install custom-ui-state-card.html and custom-ui-state-card.html.gz into <config_dir>/www/custom_ui ?

Theyā€™re both in here: /home/homeassistant/.homeassistant/www/custom_ui. Is that correct?

Yes.

Open you browserā€™s Dev Tools (Ctrl+Shift+C / F12 on Chrome) any errors in console?

Iā€™m using the AIO installation of HA. It looks like it canā€™t find the custom-ui files.

You probably downloaded the wrong file, i.e. state-card-custom-ui.html.gz is not really a .gz

1 Like

You nailed it! I right clicked the links and did ā€œsave asā€ assuming they were file links. Doh! Oh, the time I spent futzing with configā€¦ :slight_smile:

Thanks for your help!

1 Like