yoni3210
(yoni mo)
April 24, 2019, 2:19pm
1
Hi Guys,
i’m using custom component of smart IR to control my TV’s.
link to the component : https://github.com/smartHomeHub/SmartIR
i’m trying to change icon color based on its state, if the TV is on change to yellow and if not to return to its default state.
in order to do it, i configured the device class to power
as i did before to my binary sensors ( Xiaomi door sensor ), for the binary sensors its working, but when i’m doing the same thing for the custom component nothing happens.
Someone?
tom_l
April 24, 2019, 2:41pm
2
Device classes only work with binary sensors, sensors or covers. Not media players. https://www.home-assistant.io/docs/configuration/customizing-devices/#device-class
tom_l
April 24, 2019, 3:10pm
4
Some of the custom Lovelace cards support icon templating. Custom UI, I think.
#################################################################
# #
# Packages/TV Power Status #
# #
#################################################################
#################################################################
# #
# Switch #
# #
#################################################################
switch:
- platform: template
switches:
tvpower:
friendly_name: Lounge TV
value_template: >-
{% if is_state('timer.tv_delay', 'idle') %}
{{ states("binary_sensor.tv_ping") }}
This file has been truncated. show original
Try this and replace the broadlink service calls with the ones for your component.
Otherwise you can do as @tom_l suggests and use the custom button card which allows for custom colors depending on state.
Button card
Lovelace Button card for your entities. -> github
[all]
Features
works with any toggleable entity
3 actions on tap toggle, more_info and service
state display (optional)
custom color for on and off state (optional)
custom state definition with customizable color (optional)
custom size (optional)
custom icon (optional)
custom css style (optional)
automatic color for light (optional)
custom default color for lights (when color cannot be determined) (optional)
2 color types
icon :…
yoni3210
(yoni mo)
April 24, 2019, 3:28pm
7
i don understand would you mind help out the type it for me?
TX for the help and sorry for the inconvenience