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

I’m sorry, but I don’t really understand. From my pi I just did sudo wget https://github.com/andrey-git/home-assistant-custom-ui/raw/master/state-card-custom-ui.html.gz and sudo wget https://github.com/andrey-git/home-assistant-custom-ui/raw/master/state-card-custom-ui.html. What do you mean it’s not a .gz file? Should I rename it to something different?

I’m getting those same errors in chromes console.

light.*:
custom_ui_state_card: custom-ui
state_card_mode: break_slider
stretch_slider: true

@andrey You mention in your documentation that you can set this conditionally, like so: {power_consumption!=0}W

Can this be conditional on another attribute or state? I only want to show the speed attribute it if the entity is on. If it is possible, I can’t seem to figure out the proper syntax.

Currently you can only show an attributes dependent on it’s value. In the next release you will be able to show another entity’s state.

1 Like

Actually if you look at my errors the bottom one is “failed to load resource” and hovering over it says I was missing the files. I don’t see that in your errors, so possibly you have a different situation.

Ah you are right. I just saw the e.attached error at first.

It’s not possible to change the colour of the icons in the HA dashboard with ‘Custom UI’ is it?
(from the default blue to anything we like)

You might be able to do that with theming. What exactly would you like to change?

Thanks.

For some sensors I have the icons change depending on their state. It would be great if we could also change the colour of the sensor icons too depending on their state (or any icons, not just sensor icons).

Currently “default” and “active” colors are not themable. It would be easy to make them so.

If you want to change the color of a specific icon - this is not going to be supported by theming, but maybe by customUI (in the future)

It would be great if it were made possible in Custom UI :slightly_smiling_face:
If you ever implement it please allow changing the colours from triggers, different states etc.

After upgrading to .54 my badges disappeared. I went to the github page and grabbed the new installer script, ran it, it updated the files/folders but still, no badges. I have no errors in the homeassistant.log. Any suggestions?

EDIT: I also downloaded the files manually but made no difference. I see this error on chrome debug;
2017-09-23 10_13_40-Home Assistant

If you have a JS error in the log it means any part of the I can malfunction.

Try to disable customUI completely - do you still get this error?
If not - post relevant parts of your config.

Thanks for responding. I disabled the component and can tell the UI changed, no errors in the log, and the chrome error is still there, so probably unrelated. This configuration was working in .51, didn’t modify it just upgraded to .54 and the badges don’t show up anymore. Thanks for your help!

Here’s configuration.yaml;

homeassistant:
  customize: !include config/customize.yaml
  customize_glob: !include config/custom-ui.yaml

group:
  default_view:
    view: yes
    icon: mdi:home
    entities:
      - group.System

System:
  view: yes
  icon: mdi:gauge
  entities:
    - group.pi

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_

/config/custom-ui.yaml

"*badges*":
  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_

I have:
/www/custom_ui/state-card-custom-ui.html
/www/custom_ui/state-card-custom-ui.html.gz

also the script created:
/custom_components/customizer/init.py
/custom_components/customizer/services.yaml

0.53 had a breaking change regarding customui.
Read the release notes - you will need to update your config.

Thanks, got it all worked out using the info here; CustomUI in Home Assistant 0.53

what do you mean?

Before I spend time to figure out how to theme the color of the badge and the icon, and the icon itself, I was wondering if the following is currently possible with Custom UI. At the moment, I have this state card:

My question is about the badge for my binary (motion) sensor: is there a way to make the last_changed info show up in a label on that badge (so where the 3 other badges show the unit of measurement)? Of course it would have to be abbreviated to something like 3h instead of 3 hours ago.

With templates you can change the state of the sensor to be whatever you like. However it won’t autorefresh.

Is it only me that get empty cards after a while?
I have the group header and group switch but content is empty.

Browser: Chrome on Android and PC

I have this error message in log, if that can be related:

2017-11-29 18:25:17 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/lib/python3.6/asyncio/tasks.py”, line 180, in _step
result = coro.send(None)
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/core.py”, line 1031, in _event_to_service_call
yield from service_handler.func(service_call)
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/init.py”, line 122, in async_handle_turn_service
entity_ids = extract_entity_ids(hass, service)
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/service.py”, line 104, in extract_entity_ids
return group.expand_entity_ids(hass, [service_ent_id])
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/group/init.py”, line 205, in expand_entity_ids
domain, _ = ha.split_entity_id(entity_id)
ValueError: not enough values to unpack (expected 2, got 1)

EDIT: Did som more testing, when removing this part from customglob everything shows (but no custom ui ofc)

.”:
custom_ui_state_card: state-card-custom-ui
show_last_changed: false

I have this in my config:

frontend:
extra_html_url:
- /local/custom_ui/state-card-custom-ui.html
- /local/custom_ui/state-card-value_only.html

customizer:
custom_ui: hosted

I installed using the installer so the files are in .homeassistant/www/custom_ui/

Any ideas?

I’m seeing the same