CustomUI - discussion thread

How can I use themes as presets for icon colors?
I’ve tried creating this theme for example:

  themes:
    temp_hot:
      icon_color: "#cb8122"

And then set it to one of my sensors:

sensor.sata_6_temp:
  theme: temp_hot

But the theme isn’t applied.
I know its possible to set the color directly but I want to have a theme/preset and not hard coded color.

I pushed a new version 20180713 that fixes two features broken in 0.73:
Column width and extra_badge from an attribute.

2 Likes

thank you very much!

sorry to get back to this, but no such luck on IOS?

still the service system_log/write called spam caused by
mydomain.duckdns.org/frontend_latest/app-47a9b8a28d18c1f03ce16f220e977662.js:2:12641 TypeError: null is not an object (evaluating 't.substr')

and no badge…

Caching issue?

no, made sure it wasn’t. refreshed, rebooted, reloaded all. That is to say, I havent deleted and reinstalled the app on the iPhone.
Can have a go at that too, if necessary

thing is, after having updated the custom-ui this is what’s happening:

Aiocoap issues and errors about tinydtls.py? with spontaneous reboots as consequence …

because of this:

018-07-17 16:56:44 ERROR (MainThread) [homeassistant.helpers.entity] Update for light.bureau fails
Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/pytradfri/api/aiocoap_api.py”, line 92, in _get_response
r = yield from pr.response
File “/usr/lib/python3.6/site-packages/aiocoap/protocol.py”, line 816, in _run_outer
yield from cls._run(app_request, response, weak_observation, protocol, log, exchange_monitor_factory)
File “/usr/lib/python3.6/site-packages/aiocoap/protocol.py”, line 865, in _run
blockresponse = yield from blockrequest.response
aiocoap.error.RequestTimedOut

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 196, in async_update_ha_state
    yield from self.async_device_update()
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 317, in async_device_update
    yield from self.async_update()
  File "/usr/lib/python3.6/site-packages/homeassistant/components/light/tradfri.py", line 153, in async_update
    await self._api(self._group.update())
  File "/usr/lib/python3.6/site-packages/pytradfri/api/aiocoap_api.py", line 152, in request
    result = yield from self._execute(api_commands)
  File "/usr/lib/python3.6/site-packages/pytradfri/api/aiocoap_api.py", line 142, in _execute
    _, res = yield from self._get_response(msg)
  File "/usr/lib/python3.6/site-packages/pytradfri/api/aiocoap_api.py", line 98, in _get_response
    raise RequestTimeout('Request timed out.', e)
pytradfri.error.RequestTimeout: ('Request timed out.', RequestTimedOut())
2018-07-17 16:56:44 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-07-17 16:56:46 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-07-17 16:56:51 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-07-17 16:56:57 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-07-17 16:57:02 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-07-17 16:57:06 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-07-17 16:57:10 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-07-17 16:57:13 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-07-17 16:57:18 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-07-17 16:57:23 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-07-17 16:57:33 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-07-17 16:57:40 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-07-17 16:57:47 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-07-17 16:57:51 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-07-17 16:57:58 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-07-17 16:58:04 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-07-17 16:58:15 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-07-17 16:58:27 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting

@andrey since 0.73 we receive notifications on using a Custom Component that might cause unstable Hassio systems.

Yesterday I setup a completely fresh HassOS system on a new Pi, installed your custom-ui and now receive this in the log:

2018-07-20 10:01:33 WARNING (MainThread) [homeassistant.loader] You are using a custom component for customizer which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.

Isn’t Custom-ui authorized or tested by Home Assistant?
cheers,
Marius

This is a warning for all custom components. None get special treatment.

Alright, thanks, just surprised me that even this component which seems to native to Home-Assistant raised the warning.

Otoh, it started issuing this warning whenever the window focus changes to the HomeAssistant instance:

2018-07-20 10:50:29 ERROR (MainThread) [frontend.js.latest.201807080] :0:0 Script error. And a system service_log/write called pop up each time.

I do use Ghostery (an adblocker) but have whitelisted the HomeAssistant instance. Is there a way to find the cause of this other than the browser inspector:

never mind. this was the reload cache. All well, thanks!

You had to copy files into config folder to install, native components are ‘just there waiting’.

I’m using :

homeassistant:
  customize_glob:
    "binary_sensor.motion_sensor_1":
      show_last_changed: true
      custom_ui_state_card: state-card-custom-ui
customizer:
  custom_ui: hosted
frontend:
  extra_html_url:
    - https://raw.githubusercontent.com/andrey-git/home-assistant-custom-ui/master/state-card-custom-ui.html
  extra_html_url_es5:
    - https://raw.githubusercontent.com/andrey-git/home-assistant-custom-ui/master/state-card-custom-ui-es5.html

and I’m getting :

2018-07-23 11:46:43 ERROR (MainThread) [homeassistant.loader] Unable to find component customizer
2018-07-23 11:46:43 ERROR (MainThread) [homeassistant.setup] Setup failed for customizer: Component not found.
[...]
2018-07-23 11:46:43 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=persistent_notification, service=create, service_data=title=Invalid config, message=The following components and platforms could not be set up:

 - customizer

Please check your config., notification_id=invalid_config, service_call_id=140025532467296-1>
[...]
2018-07-23 11:46:43 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=persistent_notification.invalid_config, old_state=None, new_state=<state persistent_notification.invalid_config=notifying; title=Invalid config, message=The following components and platforms could not be set up:

 - customizer

Please check your config. @ 2018-07-23T11:46:43.355838+01:00>>

Any idea what could be wrong and is creating this error ?
I’m on HA 0.74.0 on docker.

Even odder…the custom card is working, I’m seeing the last_changed in that cell.

HI @andrey

could you think of any reason why the 0.75, and 0,75.1 Hassos won’t show the attribute last_changed any longer ?
I have this python script created sensor:

hass.states.set('sensor.family_home', count_home, {
    'custom_ui_state_card': 'state-card-custom-ui',
    'friendly_name': "Family Home?",
    'home': ', '.join(home),
    'away': ', '.join(away),
    'icon': whichIcon,
    'count_home': count_home,
    'count_away': count_away,
    'family_count': familyCount,
    'templates': { 'icon_color': icon_color },
    'show_last_changed': 'true'
     }) 

which worked fine up to 74.x

now correctly showing on Hassio .75.1 as:

2432

while Hassos .75.1 shows no last_changed:

4059

seems there are more custom-ui related ‘issues’, since ever time a page with customized items (have yet to find the exact ones) is loaded, the service system_log/write message appears, along with this error message:

2018-08-05 21:35:27 ERROR (MainThread) [frontend.js.latest.201808040] http://hassio-2.local:8123/frontend_latest/app-c65b4028.js:2:12760 TypeError: undefined is not an object (evaluating 't.length')

. This time it certainly isn’t a cache thing, I’ve reloaded and restarted the host, browsers et all after clearing caches.

thx,
Marius

Have you downloaded the customizer python custom component. The error says you didn’t.

You can just remove the

customizer:
  custom_ui: hosted

part

1 Like

show_last_changed works for me.

Try to set it on a regular (not python created) entity.

Also by the formatting (“Family home?” is not vertically-centered, the feature seems to be enabled. Maybe it is just grey-on-grey?

I have it on many regular entities , and working fine indeed. It’s just this entity that’s behaving unexpected since the update.

I’ve checked the formatting too, noticed the ex center also, but changing to default or any other theme does not make any difference .
Which of course is to be expected since it is a straight copy of the code, and that is showing fine on the Hassio machine…

Ive checked again, and confirm to have set the last_changed in the customization for all devices both on Hassos and Hassio, so that can be ruled out.

But notice the difference on the devices them selves, Hassio shows the last changed on the devices, Hassos doesn’t:

Hassos
04
Hassio
20

If it’s a hassos-specific issue there is not much I can do :frowning:

thanks @andrey, I am using the docker image of homeassistant, I didn’t add any specific python modules to it.
I’ve now commented out :

customizer:
  custom_ui: hosted

and it works without errors, thanks for that.

Should the documentation be amended, as I found that syntax on that page activating.md ?

I edited the documentation changing One to Only one

1 Like

Hmm not sure .
I now notice that in the HomeAssistant app neither Hassio nor Hasso show the attribute .

seems to go hand in hand with the previously mentioned front-end error:

http://hassio-2.local:8123/frontend_latest/app-c65b4028.js:2:32129 TypeError: undefined is not an object (evaluating 't.length')

each time i click an item with the missing attribute, this pops up.

Thanks for the edit @andrey, it makes more sense now :sunglasses: