CustomUI - discussion thread

What information is needed? I followed the instructions from here: https://github.com/andrey-git/home-assistant-custom-ui, but something is missing me.

It would be helpful to us to help you if you answered the questions I posted above.

How do you know that you didn’t succeed?

Can you please post any logs that would be relevant to the issue you are having from the homeassistant.log file found in your config directory?

@finity Thanks a lot for your time.
I changed this:

  extra_html_url:
    - /local/custom_ui/state-card-custom-ui.html
  extra_html_url_es5:
    - /local/custom_ui/state-card-custom-ui-es5.html

with this:

customizer:
  custom_ui: local

… and it works.

I have no idea what that even means since those are two different (but related) things but I’m glad you got it working.

Works with any of the settings. I do not know why it did not work from the beginning.

Hello Every Body
I use Custon UI for change color of icon and icon and it work fine
But I try to use it for slider of a hue lamp and I don’t use it ?
Here is my code in customize.yaml

light.spot_1_2:
      custom_ui_state_card: state-card-custom-ui
      state_card_mode: break-slider
      stretch_slider: true
      hide_control: false
      show_last_changed: false
      theme: happy
      confirm_controls_show_lock: true
      slider_theme:
        min: 10
        max: 255
        pin: true
        off_when_min: false
        report_when_not_changed: false  

IWhen i try to add the light with config UI for lovelace
witch code i need to use ?
I try

entities:
  - confirm_controls_show_lock: true
    entity: light.spot_1_2
    hide_control: false
    show_last_changed: false
    slider_theme:
      max: 255
      min: 10
      off_when_min: false
      pin: true
      report_when_not_changed: false
    state_card_mode: break-slider
    stretch_slider: true
    theme: happy
type: entities

doesn’t work
I try

type: entities
entities:
  - entity: light.spot_1_2

but it doesn’t work too

Can you help me please

Hello! Unfortunately, Custom UI works very unstable in HA 0.102 (appropriate issue has been created on Github). So I wonder if this very useful component will be updated soon.

1 Like

I want to be able to change the icon based on the state of an automation and an input bolean.

This works fine in my browser on my labtop and on my new iPhone. But on an old iPhone 5 I can not get it to work - neither in the IOS-app or in Safari. I have tried to clear the cashe.

Any sugestions on how to make this work?

Is custom_ui still in active development? On github, I haven’t seen much happening and issues are left opened with no reply. It would be a shame if it’s now orphaned since it’s a great addition to do stuff that Lovelace can’t do.

What can it do that Lovelace can’t?

1 Like

Well, if it can do this, then I’ll be more than happy to ditch it, especially since it gives me error in the logs

Custom UI allows me to change my thermostats’s icon based on the heat level (baseboards) like this in a picture-elements type:

climate.neviweb130_climate_salon:
  templates:
    entity_picture: >
      if (attributes.heat_level < 1) return '/local/heat-0.png';
      if (attributes.heat_level < 21) return '/local/heat-1.png';
      if (attributes.heat_level < 41) return '/local/heat-2.png';
      if (attributes.heat_level < 61) return '/local/heat-3.png';
      if (attributes.heat_level < 81) return '/local/heat-4.png';
      return '/local/heat-5.png';

image

It also allows me set an icon color based on some other attributes as such:

switch.foyer_powermonitor:
  templates:
    icon: "return 'mdi:fire';"
    icon_color: "if (state == 'Unavailable') return 'rgb(189, 189, 188)'; else if (entities['sensor.foyer_powermonitor_energy_apparentpower'].state < 30) return 'rgb(92.90.59)'; else if (entities['sensor.foyer_powermonitor_energy_apparentpower'].state < 100) return 'rgb(255,234,1)'; else return 'rgb(217,20,20)';"

Can I do that with the stock Lovelace?

Thanks

you’re asking about stock lovelace but you’re willing to use custom ui? No you can’t do it with stock lovelace but there is 100s of custom cards. I can think of 3 that can do this off the top of my head

Thanks. Do you mind naming a few to point me in the right direction?

card-mod, 100%-template card, template card, button-card, state-switch

none of these cards can set a global icon_color template, nor any other customizing template for that matter…

there are a few other things custom-ui is very capable in, but nowadays are only displayed in the more-info window, since Lovelace has deprecated many of the States functionality.

simply look at the unfortunate state_color that was introduced lately, and one starts to re-appreciate the power of custom-ui

I suggest you start looking into lovelace_gen… You’ll never need custom ui as it solves all those problems.

I’ve been trying to do so, but its rather a design decision, to rebuild one’s full config to Lovelace-gen…

all in all, imho, the ease of custom-ui, with its set and forget customizations added to entity, domain, or global settings, really beats the Lovelace per card setting. Set a customization once, and see it used throughout the full Lovelace config. no more fiddling around in each and every card, with per card syntaxes…

Even if that can/could be auto generated with Lovelace_gen templates, which are way more complex to understand and configure, let alone take a burden on the system, as @jimz011 has well spelled out.

Simply don’t understand why the main dev’s hate custom-ui so much, or, let me rephrase that positively, dont see the beauty of it.

2 Likes

Well tbh I understand why they don’t like custom-ui. It has a lot of code that is not needed for the things you and I want to do with it. I think you use it to customize icons and names dynamically just like I do. But honestly that is just a small portion of the entire code. All the other code is meant to alter the states ui (which is now deprecated). I think it would be way much better if custom-ui would only do customizing of entities. But unfortunately, customizer doesn’t work without the full script.

I think it is because of this that the devs don’t like it (haven’t seen that they don’t like it though, but I assume you’ve read it somewhere, so I’ll take your word for it)

what? It auto generates the lovelace for you. Its no different than lovelace without lovelace_gen. literally. Lovelace gen, intellegently generates the yaml files in memory for you. It takes no extra resources as end result is executed the same. I think you may be confusing the button card templates and lovelace gens templates.

though I am not specifically confusing the 2, you are probably right Lovelace_gen acts on a different level in the config.

And, as said, I have only touched it lightly, which went without hiccups, but others have stated it would probably be best served with heavier hardware than my simple Pi’s.

`dont know yet, must experiment further. I do know that recalculating everything frontend takes its toll, as can be seen by the ever warning Hue integration :wink: Whenever Lovelace is refreshed, Hue lights go unavailable. Could be Hue, but since that is part of the core HA, I take it as an HA issue.

The more we automate Lovelace (from a simple entities card with several entities to a monster-card or auto-entities card) the more each view has to refresh and reload. Thats what I really meant with the burden, should have phrased that more carefully.

as long as this domain customization:

automation:
  custom_ui_state_card: state-card-custom-ui
  templates:
    icon_color: >
      if (state === 'on') return 'rgb(251, 210, 41)';
      return 'rgb(54, 95, 140)';

can’t be done in Lovelace without setting state_color on each card with automations, or worse, on each automation individually for mixed cards, I dont see any option come close to the brevity and efficiency of custom-ui.

not sure what you are saying here, but I used almost all functionality custom-ui offers. And all that functionality was allowed on glob, domain, or entity level… don’t want to reminisce but this were the days…

Still, Lovelace is getting more beautiful by the day, and I really love the lace it offers. Doing my bit to help develop it and aid and test wherever I can. Only way forward !