Giter Club home page Giter Club logo

lovelace-hue-like-light-card's Introduction

hacs_badge Tests Donate Downloads

Hue-Like Light Card for Home Assistant

This dashboard card is providing light control. It is inspired by original Philips Hue app.

Screen1 Hue-Screen2 Hue-Screen-Detail1

* intensity of color, shadow and other UI properties may be subject of change

Basic configuration

type: custom:hue-like-light-card
entity: light.livingroom_color

Where livingroom_color is the entity id of some existing light.

For more options see Configuration or let yourself inspire in Examples of configuration

Hue icons

For the best experience use with hass-hue-icons. You can then use icons you are used to (from Philips Hue app).

Also this card will detect these icons installed and will use them prior to HA icons on some places (eg. brightness icon).

Installation

HACS

  • Open HACS
  • Go to "Frontend" section
  • Click button with "+" icon
  • Search for "Hue-Like Light Card"
  • Install repository in HACS
  • Refresh your browser

Manual

  • Download hue-like-light-card.js file from the latest release
  • Save downloaded file somewhere in <ha config>/www/ directory, e.g. /config/www/custom_lovelace/hue-like-light-card.js
  • Add saved file to Lovelace resources
    url: /local/custom_lovelace/hue-like-light-card.js
    type: module
  • Restart HA if you had to create www directory
  • Refresh your browser

Configuration

This table may contain not yet released options.❗❗❗
Some of these options may not be in the latest version. Please always check the Since column.

Key Type Required Since Default Description
entity string yes* 1.0.0 - Light entity ID (eg. light.my_light)
entities list of strings yes* 1.0.0 - Multiple Light entity IDs
area string yes* 1.6.0 - Name or ID of Area with lights
(eg. Living room or living_room)
label string yes* 1.7.0 - Name or ID of Label with lights
(eg. Kitchen - desk or kitchen_desk)
groupEntity string no 1.6.0 - Light entity ID that represents the group of light entities (eg. light.my_light_group). Some platforms (like hue) will provide an entity representing the room, in addition to the individual light entities (might be disabled by default). This can be defined to toggle the lights all at once, rather than successively.
title Text Template no 1.0.0 Lights name Card title
description Text Template OR false no 1.5.0 automatic description Description under the cards title. Placeholder %s can be used for showing number of lit lights. (eg. 'Is on: %s')
If set to false, description will not show.
icon string no 1.0.0 automatic icon Card icon
iconSize Icon size no 1.4.2 original Card icon size
showSwitch boolean no 1.2.1 true When set to false, toggle switch will not be visible on card. This will give more space for title.
(You can then use offClickAction and onClickAction to turn the lights on/off.)
switchOnScene string no 1.6.0 - Scene entity ID (eg. scene.office_bright).
If set, this scene will be activated when switch changes from OFF to ON (instead of just runing all lights on).
slider Slider type no 1.5.0 default You can choose between diferent sliders or hide the slider.
scenes list of Scenes no 1.1.0 automatic detection Scenes shown in Hue screen
sceneOrder Scene Order no 1.5.0 default Order of automatically detected scenes shown in Hue screen
allowZero boolean no 1.0.0 false If turned on, the slider can be moved to and from value 0.
(turning off/on the the lights)
defaultColor Color no 1.0.0 'warm' If selected light (or lights) doesn't have RGB mode,
this value is used as color when the light is on.
offColor ColorExtended no 1.0.0 '#666'
('#363636' for Hue Screen)
The color of the pane, when all lights are off. When set, also used in Hue Screen header (recommended setting also hueScreenBgColor accordingly).
hueScreenBgColor ColorExtended no 1.1.0 '#171717' Background color of Hue Screen
theme Installed theme name no 1.2.1 Global HA theme Will use specific theme for this single card. Other than the current selected globally in Home Assistant.
disableOffShadow boolean no removed in 1.6.0 false If turned on, the card will not have inner shadow, when all lights are off.
offShadow boolean no 1.3.0 true If turned off, the card will not have inner shadow, when all lights are off.
hueBorders boolean no 1.0.0 true If turned off, the card will take border settings from current Home Assistant theme.
apiId string no 1.7.0 - Identifier of the card for the API interface.
isVisible boolean no 1.7.0 true If turned off, the card will be hidden. (Use this if you only want the API functions.)
resources Resources object no removed in 1.5.0 - Can change (localize) texts on this card
Replaced with integrated localization.
style no 1.4.0 - Support for the card-mod.
card_mod no 1.4.0 - Support for the card-mod.
* At least one of these options must be filled in. Only entities of light domain and/or areas and labels with light domain entities are supported.

Click & Hold configuration

Key Type Required Since Default Description
offClickAction Action no 1.1.0 hue-screen Action when tile is clicked and all lights are off
offClickData Action Data no 1.1.0 - Data for offClickAction
onClickAction Action no 1.1.0 hue-screen Action when tile is clicked and any of lights is on
onClickData Action Data no 1.1.0 - Data for onClickAction
offHoldAction Action no 1.6.0 more-info Action when tile is pressed and all lights are off
offHoldData Action Data no 1.6.0 - Data for offHoldAction
onHoldAction Action no 1.6.0 more-info Action when tile is pressed and any of lights is on
onHoldData Action Data no 1.6.0 - Data for onHoldAction

Automatic Icon

  • If label option is set and given label has icon, the icon is taken from label.
  • If the card has one light entity attached, the icon is taken from entity.
    • If the entity has no icon, mdi:lightbulb (lightbulb) is used.
  • If the card has two lights mdi:lightbulb-multiple (lightbulb-multiple) is used.
  • If the card has three or more lights attached, mdi:lightbulb-group (lightbulb-group) is used.

When hass-hue-icons is installed (Since version 1.4.1):

  • If the card has one light entity attached, the icon is taken from entity.
    • If the entity has no icon, hue:bulb-classic (bulb-classic) is used.
  • If the card has two lights hue:bulb-group-classic (bulb-group-classic) is used.
  • If the card has three lights attached, hue:bulb-group-classic-3 (bulb-group-classic-3) is used.
  • If the card has four or more lights attached, hue:bulb-group-classic-4 (bulb-group-classic-4) is used.

Automatic description

Since version 1.5.0

Based on number of lit lights in group, one of the 4 localized text is used (priority from top):

  • 0 lights on
  • ALL lights on
  • 1 light on
  • X/Y lights on

Icon size

Since version 1.4.2

You can set size of the icon on hue card. Possibilities are:

  • big - default icon size for versions <= 1.4.1 [value: 2.0]
  • original - default icon size [value: 1.41666667]
  • small - [value: 1.0]
  • any size you want (as number), examples:
    • 0.5 = 12px
    • 1.0 = 24px
    • 1.5 = 36px
    • 2.0 = 48px
    • ... you got it

Slider Type

Since version 1.5.0

You can set slider to on of following options:

  • default - will use default slider
  • none - will hide the slider entirely (same state, as if the light does not have brightness control)
  • mushroom - will use Mushroom slider.

Mushroom slider

Mushroom must be installed for this option to work.

Mushroom usage

You can customize properties of mushroom slider using Card mod:

Mushroom customization

type: custom:hue-like-light-card-test
entity: light.office
slider: mushroom
theme: synthwave
style: |
  .brightness-slider {
    --mush-control-height: 42px;
    --slider-color: white;
  }

Text template

Since version 1.2.0
Localized since 1.4.0

The text supports showing entity states and attributes using double curly {{ brackets }}. When you insert entity name inside these brackets, entity status will be resolved and shown on given place. You can also show attribute on this entity.

Simple state

type: custom:hue-like-light-card
title: TV - {{ light.tv_backlight }}
entity: light.tv_backlight

Template usage

Attribute ussage

type: custom:hue-like-light-card
title: Kitchen - desk ({{ light.kitchen_desk1.brightness }}, {{light.kitchen_desk2.brightness}})
icon: mdi:wall-sconce-flat
offColor: '#363636'
entities:
  - light.kitchen_desk1
  - light.kitchen_desk2

Template attribute usage

When attribute is not available (or is empty) on entity, state of the entity will be shown instead.

Usage in description:

Since version 1.5.0

type: custom:hue-like-light-card
title: Kitchen - desk 
description: 'Lights on: %s ({{ light.kitchen_desk1.brightness }}, {{light.kitchen_desk2.brightness}})'
icon: mdi:wall-sconce-flat
offColor: '#363636'
entities:
  - light.kitchen_desk1
  - light.kitchen_desk2

Template usage in description

Color

The color can be defined in following ways:

  • HEX: '#fff', '#ffffff'
  • HEX (with alpha): '#fffa', '#ffffffaa' (since version 1.4.0)
  • RGB: 'rgb(255,255,255)'
  • RGBA: 'rgba(255,255,255,0.9)' (since version 1.4.0)
  • WEB name: 'red','salmon','DarkSeaGreen', etc.
  • predefined: 'warm' or 'cold' (in places where it does make sense)

ColorExtended

Since version 1.2.0

Same as Color and can also be defined as

  • theme-color
This will pick the color from currently used Home Assistant theme.

Click (hold) action

When the card is clicked or pressed, something can happen. This can be configured through configuration.

type: custom:hue-like-light-card
...
offClickAction: turn-on
onClickAction: turn-off
offHoldAction: hue-screen
onHoldAction: hue-screen

Simple example to toggle lights on click.

Possible actions

Key Possible data* Data required Since What is happening
default yes no 1.1.0 Click: hue-screen
Hold: more-info
none no no 1.1.0 nothing
turn-on no no 1.1.0 turn on all lights
turn-off no no 1.1.0 turn off all lights
more-info yes (entity) no 1.1.0 Shows system more-info dialog of one light.
If any light is on, the first lit light will be selected.
If all light are off, first light will be selected.
When action data are used, any entity can be selected.
scene yes (scene) yes 1.1.0 activate selected scene
hue-screen no
(is using general scenes config)
no 1.1.0 show Hue Screen

Action data

Some actions can be configured using action data. Action data parameter can have name (as defined in table above) but it is not mandatory. Both styles are possible.

Action data without name:

type: custom:hue-like-light-card
...
onClickAction: more-info
onClickData: media_player.television

Action data with name:

type: custom:hue-like-light-card
...
offClickAction: scene
offClickData:
  scene: scene.tv_citron

API interface

Since version 1.7.0

You can enable the API functions of certain card by passing the apiId identifier in the settings. The identifier can be any string you want (although there could be issues with special characters).

type: custom:hue-like-light-card
...
apiId: room1

If you only want to use the API (dialog) from another cards, you can hide this card using isVisible: false setting.

Javascript usage

When any card on the dashboard has apiId filled in, global object named hue_card will be available on window object.
Api-object
There will be API functions for every card, that has apiId defined. Functions are named {apiId}_functionName.

Available functions

Name Since Description
{apiId}_openHueScreen 1.7.0 Will open Hue Screen of the identified card

URL usage

The API functions can be called by setting the hash part of the current URL. The URL must be in this format:

{anything}#hue_card:{apiId}_{functionName}

For example:

https://10.0.0.1:8123/lovelace/lights#hue_card:room1_openHueScreen

When the URL is correctly set, the API will make the call (in this example to hue_card.room1_openHueScreen() which will open the hue screen). The URL will be then set back to non-hash version (eg. https://10.0.0.1:8123/lovelace/lights).

This is achieved by monitoring the hash part of the current URL and checking for #hue_card: prefix.

This way you can create link, leading to certain lovelace dashboard page and instantly opening Hue Screen for one of your hue-cards. You can also create navigate action from other card. The click will then result in opening the Hue Screen:

type: custom:mushroom-light-card
entity: light.living_room
tap_action:
  action: navigate
  navigation_path: '#hue_card:room1_openHueScreen'

Scenes configuration

To enable switching between scenes, you can configure scenes, that can be activated in Hue Screen.
When no scenes are defined, scenes will be detected automatically.

Scene parameters

Key Type Required Since Default Description
entity string yes 1.1.0 - Scene entity ID (eg. scene.tv_orange)
title string no 1.1.0 Scene name* Text on scene-button
icon string no 1.1.0 Icon of scene or 'mdi:palette' Icon on scene-button
color Color no 1.1.0 'darkgoldenrod' Accent color current scene (shown on scene-button)
activation Service name no 1.2.0 'scene.turn_on' Service called when scene is activated
activationData object no 1.2.0 - Data for activation service.**
* If the scene name begins with the same text as the card title is, this text is removed.
** Data always have entity_id parameter filled with entity name. You can change this value, when another value is supplied with this name.

Example of scenes configuration

type: custom:hue-like-light-card
...
scenes:
  - scene.colors_bluered            # if only entity is used, it can be written directly
  - entity: scene.colors_cyan
    title: My really favorite scene
    color: cyan
  - entity: scene.colors_blue_xmass
    icon: mdi:tree-outline
  - entity: scene.colors_white
    color: white
    icon: ''                        # when you don't want the icon, you can set it to empty string

For the best experience, please fill in both icon and color for all scenes.

Since version 1.6.0

Hue screen will load entity_picture from entity itself.
You can set custom image as entity_picture using the customize_glob option in HA configuration.
As an inspiration look at this project containing OG hue icons and default config for english scene names.

Scenes detection

Automatic scene detection will take place when no scenes are configured.

Scenes are detected from areas where lights are placed.
All scenes from all areas, where configured lights are placed, are taken (duplicates are removed).

Example:

entities:
- light.kitchen_main => 'Kitchen' (area) => ['scene.kitchen_lit', 'scene.sink_lit']
- light.kitchen_corner => 'Kitchen' (area) => ['scene.kitchen_lit', 'scene.sink_lit']
- light.room1 => 'Living room' (area) => ['scene.daylight', 'scene.nighttime', 'scene.reduced']
Scenes Detected: ['scene.kitchen_lit', 'scene.sink_lit', 'scene.daylight', 'scene.nighttime', 'scene.reduced']

Icon of detected scenes is taken from your Home Assistant settings. You can change the icon in entity settings.

Color of scene cannot be detected automatically, for the best experience fill scenes and respective colors manually.

Scene Order

Since version 1.5.0

Automatically detected scenes can be ordered with sceneOrder option. Possible values are:

  • default
    • order of areas depends on order of (first area) light entities.
    • scenes inside areas have default order from Home assistant (alphabetically by scene id).
  • name-asc
    • all scenes (across all areas) are ordered alphabetically by name a -> z
  • name-desc
    • all scenes (across all areas) are ordered alphabetically by name z -> a

This order is not applied, when scenes are configured manually.

Note, that scenes are listed in two rows populated like this:

| 1 | 3 | 5 |
---------------------
| 2 | 4 | ...

Custom activation example (Hue dynamic scene)

type: custom:hue-like-light-card
...
scenes:
  ...
  - entity: scene.colors_tokio
    color: rgb(168, 25, 255)
    icon: mdi:home-city
    title: Tokio (dynamic)
    activation: hue.activate_scene
    activationData:
      dynamic: true
      brightness: 180
      speed: 40

Hue Screen

Hue screen will allow you to activate scenes, set light colors, temp and brightness (same functionality as official Hue App). Function of effects activation will come in the future.

Hue-Screen Hue-Screen2 Hue-Screen-Detail Hue-Screen-Detail1

Examples of configuration

Area

Screen10

type: custom:hue-like-light-card
area: Living room
icon: mdi:sofa
offColor: '#363636'

Multiple lights

Screen2

type: custom:hue-like-light-card
title: TV colors
entities:
  - light.tvlight_color1
  - light.tvlight_color2
  - light.tvlight_color3
  - light.tvlight_color4

Custom title and icon

Screen3

type: custom:hue-like-light-card
entity: light.livingroom_lamp
title: Reading light
icon: mdi:floor-lamp

No toggle switch

Screen7

type: custom:hue-like-light-card-test
title: '[ TV - {{ light.tv_backlight }} ] No switch = more space for title'
entity: light.tv_backlight
icon: mdi:television
showSwitch: false
offClickAction: turn-on
onClickAction: turn-off
offColor: rgb(28,28,28)

Home Assistant-like

Screen4

type: custom:hue-like-light-card
title: TV colors
entities:
  - light.tvlight_color1
  - light.tvlight_color2
  - light.tvlight_color3
  - light.tvlight_color4
offColor: theme-color
hueScreenBgColor: theme-color
offShadow: false
hueBorders: false

Turnable with slider

Screen5

type: custom:hue-like-light-card
title: Living room
entity: light.livingroom_light
allowZero: true

Custom theme

Screen8

type: custom:hue-like-light-card-test
title: Living room
icon: mdi:sofa
offColor: theme-color
hueScreenBgColor: theme-color
offShadow: false
hueBorders: false
allowZero: true
entities:
  - light.livingroom_light
  - light.livingroom_color
theme: synthwave

Non-RGB Light

Screen6

type: custom:hue-like-light-card
title: Bathroom
iconSize: big
entity: light.bathroom
defaultColor: 'rgb(230,230,255)'

No description

Screen9

type: custom:hue-like-light-card
entity: light.office
description: false

Coming soon features

  • reactions on sliding event instead of on change (value will be changed in the moment of sliding, not after)
  • ui editor?

lovelace-hue-like-light-card's People

Contributors

brenank avatar dependabot[bot] avatar gh61 avatar github-actions[bot] avatar misa1515 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lovelace-hue-like-light-card's Issues

Scene sorting

Hi,
I use the automatic detection of scenes. They seem to be added in a random order. Is there some possibility to sort them somehow or would that something that could be added?

thanks a lot

malkie

Toggle room instead of all lights with switch

First of all: Thank you very much! I've been dreaming of a hue style card for years and yours is close to perfect!

When implementing your card into my setup, I've realized that hitting the switch to enable/disable all lights doesn't trigger them simultaneously as the official Hue app does. This is probably because the card triggers each light individually, instead of using the Hue provided room entity. My feature request would be: Can we please get the entity configurable that's trigger on hitting the switch?

Thanks in advance!

Suggested README edit

Thank you for all your effort. I am new with HA but love it so far.
I struggled installing hue-like-light card, in part because I am new to this.

I didn't understand this step so much and had to do my own thinking :) .

It's not your responsibility to educate the public and I appreciate your efforts. The one edit I suggest is explaining what the following statement means and where to get that information.

I am happy to do a PR for you if that will help

Basic configuration

type: custom:hue-like-light-card
entity: light.livingroom_color

Where livingroom_color is the name/entity of some existing light

Color temperature outside of supported range

I have mostly IKEA lights with temperature and brightness control only. However the temperature control seems buggy. When I slide it to cool or warm temp on the circle control it (bounces or flicks) back.

Thought it may have been computer or user error.

But on the HUE lights I have it works perfectly.

Looking at the attributes could this be the issue?

Hue Bulb
min_color_temp_kelvin: 2000
max_color_temp_kelvin: 6535
min_mireds: 153
max_mireds: 500

IKEA Bulb
min_color_temp_kelvin: 2202
max_colortemp kelvin: 4000
minmireds: 250
max mireds: 454

The 4000 to 6535 range? The circle for temp range is built for hue so when I slide to the bottom for example it says no, you are 2535 Kevin away and snaps back?

PS. Love your card. Changed my whole dashboard.

Test bug

Issue to test CI when bug issue fixed

Missing option to change colour temperature on light

I've read through the configuration and examples several times, but can't seem to find anything about this.

On the screenshot I've added a bedroom light.
It is possible to change the colour temperature in the default light panel, but not in hue-like-light-card.

Am I missing something basic here?

bilde

Hue Dynamic Scenes

Hello,

One great addition would be adding support for the HUE Dynamic Scenes.
I'm only using Hue so I "hacked" the code to call a different service (line 77 in js file):
this._hass.callService("hue","activate_scene",{entity_id:this._config.entity,dynamic:true,transition:10,speed:40})

I also added transition and speed values.

For me this works well but it's not configurable. For others it would be a good idea to:

  • Have a toggle parameter to switch between normal scene triggering or Hue (using the new hue.activate_scene service)
  • Add parameters for:
    • dynamic scene - boolean
    • transition time - integer
    • speed - integer

Option to remove / hide switch

This card looks almost exactly like what I'm looking for. Any chance you could make an option to hide the switch on the right side, since the entire card is clickable to turn on / off? It would give more room for the name when used in a 2 column grid layout.

Wrong entity name crash the lovelace page instead of returning error

Hi,

Running the latest HA:
grafik
and latest release of the card through HACS.

Got a lovelace sub page with my lights:
grafik

But if an entity is wrongly spelled, the lovelace page just crash with no error message:
grafik

Was finally able to find the bug through the web developer checks:
grafik

Hope this helps for the development :)
Let me know if you need any other information!

Popup card color/background color too bright?

I have trouble seeing the text in the popup while using darkmode.

This is an example using the default theme:

image

And this is an example using the metro green theme:

image

Usually the popups look like this with my current theme:
image

I couldn't find anything to change the background or text myself.

Edit: My bad I was just not looking enough

Not seeing individual lights in Hue Screen

I think I may be misunderstanding some setup step, but so far I'm unable to get individual lights to appear in the Hue Screen.

For example, this is a card I'm testing:

type: custom:hue-like-light-card
title: Living Room Lights
entities:
  - light.living_room_ceiling_light
  - light.living_room_hue_iris_1
  - light.living_room_hue_iris_2
  - light.entertainment_center_lights
  - light.tv_lights
onClickAction: hue-screen
offClickAction: hue-screen
hueBorders: false
offColor: theme-color
hueScreenBgColor: theme-color
offShadow: false

When the Hue Screen opens, I see the main slider and toggle at the top, and then I see the list of scenes associated with those lights, but there is no list of lights with toggles underneath that as the screenshots show.

Is there something extra I need to do to enable that functionality?

Example of complete Hue Screen

Hi there

Maybe I'm to dumb to figure it out, but I can't seem to get the Hue Screen to work as you've posted it in the manual.
What do I have to code to have it done like that?

What I want to do is have the scene only apply to a single group withing a room which has two groups. Like i.e. I have 7 lights within a room. 2 for the sink within a group called that and the rest of them for a group called table. Whenever I turn on a scene now, it does that for the whole room.

Additional Function: HoldAction?

Hey there!

First things first: I really love what you created for HA! It really helps me organising and controlling my lights! 🥇

I just wondered while using your card, if it would be possible to add a HoldAction?
I'd like to use a ClickAction to turn the lights on and off and use a HoldAction to open the HueScreen. Do you think something like that would be possible in the future or is it already possible? Couldn't find anything about that in your readme :(

Would really appreciate hearing from you! 👍

Support theme background colors

A quick suggestion. Depending on the HA theme and background color, it is difficult to find an 'offColor' that works well across different background colors.
Would it be possible to expand the 'offColor' key to support an opaque mode or some other method to use the background as a base for the card color? Would this be problematic in the transitition to 'defaultColor'?

The possibility to define transparency for off color would be amazing!

I absolutely love the card! Most of lights all over my home are Hue based and this card makes it incredible to integrate it into the wall tablet dashboard! In fact, it motivated me to try to migrate from AppDaemon to Lovelace! The only thing I'm missing for it to blend with the dashboard is the ability to set the transparency for the off state!

I've seen that you've just added support for Card-mod maybe that's a way?
I'm not sure I'm front-end versed enough to be able to do this right now.

A setting like offTransparency would work great!

The new WIP Lovelace Dashboard kind of brings unnecessary attention to the lights that are off:
image

Old AppDaemon dashboard I'm in process of rebuilding into Lovelace:
image

Idea: Add support for auto-entities

Would it be possible to add support for auto-entities?

Context

Here auto entities could act as a filter, e.g. all lights in a room.

type: custom:auto-entities
filter:
  include:
    - area: bedroom
      domain: light
card_param: entities
card:
  type: entities

Results in
image

Problems

However when using this you'll get the error: Object { code: "invalid_format", message: "expected str for dictionary value @ data['item_id']. Got {'entity': 'light.signify_netherlands_b_v_lwo001_light'}" }.

Using a similiar template to cast the result from entity to string seems to get a bit further, but then crashes.

type: custom:auto-entities
filter:
  template: |
    {% for light in states.light %}
      {% if light.state == "on" %}
        {{ light.entity_id | string}},
      {% endif %}
    {% endfor %}
card_param: entities
card:
  type: custom:hue-like-light-card

Crash log

Uncaught TypeError: t is undefined
    calculateBackAndForeground hue-like-light-card.js:79
    updateStylesInner hue-like-light-card.js:937
    connectedCallback hue-like-light-card.js:945
    connectedCallback scoped-custom-element-registry.js:248

Feature Request: Official hue scenes

Hi there,

I've spent the last few days building a custom_component implementing the scene functionality of hue using all the scenes from the official hue scene gallery. Hue scenes and HA scenes are actually quite a bit different with the Hue ones being presets for a state that can be applied to a bunch of entities and the HA ones being a set of states for a specific set of entities

I'm now wondering how a UI for that could look like, as right now, it's just a bunch of services.

You can find the component here:
https://github.com/Hypfer/hass-scene_presets

It features images for all scene presets that have been AI generated to avoid all the legal issues.
It also provides services that simulate the dynamic scene feature of hue.

I'm of course posting it here mostly in the hope that you find it interesting so that I can be lazy on the UI part but please don't feel pressured to do anything with it. After all it's I who wants to see something happen so it's also I that is responsible for building it.
Still I figured that you might find it cool as well but if not feel free to close the issue

Slider Problem

Sorry to bother you again:

It could be that i'm getting something wrong, but the function to hide the slider isn't working for me :(

Slider_problem_Hue_like_light_card

Thank you in advance for your help :)

card mod doesnt seem to apply to this card

For some reason card_mod doesn't seem to apply properly to this card? When i do the below, the height is correct whilst in the configuration screen but no longer applies when viewing the dashboard normally.

card_mod:
  style: |
    ha-card { 
    min-height: 600px
    }

Add Active Scene to the Title of component

Hi,

I love your card, it brings colors to dull and monochromatic dashboard where I only have sliders.
I'm mainly using it as a "category header" to separate light sliders throughout the house (imagine all lights in the house in a vertical list and this component is mainly separating the sliders by room - where I'm grouping all the lights in each room and also adding the Scene selection to rooms)

The only limitation I see is that I would love to have the Selected Scene shown in the Title.
As such:
image

To do this I made a hack in the code.
Initially it was like this (hue-like-light-card.js:336 - prettyPrinted):

  render(){
	const t=this._config.getTitle(this._ctrl),e=()=>{this.requestUpdate(),this.updateStyles()
  };

I made it like this:

  render(){
	const title=this._config.getTitle(this._ctrl);
	const t=title.substr(0,title.indexOf('{')>0 ? title.indexOf('{')-3 : title.length);
	const t_scene=(title.indexOf('{')>0) ? " - " + this._hass.states[title.substr(title.indexOf('{')+2, title.indexOf('}')-title.indexOf('{')-2)].state:""
	,e=()=>{this.requestUpdate(),this.updateStyles()
  };

And added the t_scene below (line 346):
${t}**_${t_scene}_**
In the configuration I appended this "parameter" to the "title": "- {{sensor.living_room_active_scene}}" (this is a template sensor I have in HA to show the current Scene
Just to make it configurable (and have it display without the scene where needed).

Now, ideally I would add a new parameter with the scene sensor to make the code nicer - If I'll do it I'll submit a PR directly

So, I think this is a good addition and maybe you want to squeeze it in the next version :)

Wiz scenes

Is there a way to setup a toggle to activate a specific scene (bright, low light, specific color/intensity?)

For instance, I have a simple card with different buttons like:
type: custom:hue-like-light-card
entity: light.wiz_rgbw_tunable_ad222a

and if I hold it, I see a menu that allows you to change color, temperature, or select pre-defines scenes (ocean, romance, sunset, party, cozy, etc) but I couldn't find where those are saved, or how to have a toggle to activate them without navigating through the menu. Thanks

Generate light groups from rooms

Hi,

I love this custom card, with this card I can nearly replicate the Hue app.

But the issue that I have is that my groups are not showing the correct "children".
I'm using a combination of custom:auto-entities and custom:hue-like-light-card.

Currently my yaml looks like:

- type: custom:auto-entities
  card:
    type: entities
    title: Kamers
  filter:
    include:
      - domain: light
        attributes:
          hue_type: "room"
        options:
          type: custom:hue-like-light-card
          offShadow: false
          allowZero: true
          offColor: '#424340'
    exclude:
      - state: unavailable       

Now this does properly show the different rooms:
image

But when I select one of the rooms, the only light in the room is the room itself:
(The room Achtertuin has 5 different lights in it)
image


  1. How can I setup the lights so that the corresponding "children" are in each room without manually having to add every single room and light that I have?

  2. How can I make sure the corresponding icons are shown?

  3. Is there a method to style the shadowroot elements in ha-switch/ha-slider ( from the styling in the .js file?

Thank you for your time, and also for this amazing card!

Can't add Hue Plugs

When I try to add Hue Plugs or on/off light switches it does not appear in the Hue Screen.
Can this be added?

Use mushroom styled slider

Hello!

Is there any way to change the style of the slider to have a bigger touch target? At the moment, the touch target is too small for my preference. In the screenshot below is a comparison of the current hue-card sliders vs Mushroom cards.

Screenshot_20230704_110728_Home Assistant

Icon arrangement

Hello, first of all thank you for your great work! This is exactly what I was looking for.

I only have two "little" suggestions for improvement:

  1. Why are multiple lights always in a row? I have some rooms with over 10 lights. Including light groups even more. But they don´t stack up like scenes in two ore more rows.
    That's a lot to scroll sideways - especially on a smartphone.
  2. Light groups can currently only be added to the lights. Maybe a separate “light group” would help. So one area each for scenes, lights and light groups.

And two questions:

Can I hide scenes individually or completely, even they are in the corresponding area? I don´t need all scenes in every room.
Can I change the size of icons for lights and scenes?

Thanks in advance.
Greetings, Oliver

Error when having the "lovelace-hue-like-light-card" and the entities from "lovelace-auto-entities" in a grid

Here is the code i used
the "lovelace-auto-entities" work in a grid if i use a other card

square: false
type: grid
columns: 1
cards:
  - type: custom:auto-entities
    filter:
      include:
        - domain: light
          area: 829d23948f6844f0a15e2a14e4318e23
      exclude:
        - state: unavailable
    card:
      type: custom:hue-like-light-card
      title: Woonkamer
      icon: mdi:sofa
      slider: mushroom
      theme: synthwave
      style: |
        .brightness-slider {
          --mush-control-height: 20px;
          --slider-color: white;
        }

Use the hue-screen light tile as dashboard card

I wanted to express my admiration for the fantastic design of the screen page you’ve created. It’s truly remarkable and visually appealing. I’ve been thinking about a way to incorporate it into my own dashboard project while adding my sensors to the bottom.

I believe that the icons from your screen page would be a perfect fit for my dashboard, and I’d love to use them as standalone elements. They would undoubtedly enhance the overall aesthetics and user experience of any project. Your design is so impressive that I genuinely think it deserves to be a dashboard on its own.

The red circled replaced with your hue icon design

IMG_0494
IMG_0493

Changing title and icon size, color (styling)

Hi,
I really like your card and started using it heavily since the last update as it has all features I need now. Was wondering if there is a possibility to get the following things implemented

  • change icon size
  • Change title/name font size
  • Hide title/name
  • Change icon color when turned off. Would love to have it darker when turned off

thank you very much for the great work

Malkie

Feature: Color-picker - Change multiple lights at once

I really appreciate the dashboard's current design! However, I've noticed that it lacks a feature present in the hue app where you can view all the different lights and their current colors. In the app, you can easily move them together by dragging them on top of each other. With multiple lamps on the dashboard, it becomes a bit tedious to individually adjust each lamp to achieve matching colors.

Can we create an animation on the icon?

Good morning,
Thank you for your work.
Just a quick question.
Can we create an animation on the icon?
Style:
{% if is_state('light', 'on') %}
--icon-animation: spin 2s linear infinite;

I do not know how.
Thank you very much

Hass hue icons

Hey. This would look great paired with hass-hue-icons. Wonder if there's a way to bundle both together?

Feel free to use them in your screenshots.

Card becoming invisible

Hi,
I really like the card! But recently it stopped working :(
When I create the card it will not show everything but if I add the card again in the dashboard it will show both of the cards on the device I created them on. But if I open for example another tab some of the cards aren't there :( see screenshot
Screenshot_2
Please help!

Feature ideas.

Hi, if I could suggest something, I think it would be helpfull to implement following to make user experience slightly better:

  • a right hand side drop down which can be populated with predefined scenes
  • a palette button to allow user to select colour on the whim.
  • tap action light toggle (as an config option)

Add/Fix support for non-dimmable lights

For lights controlled with Philips hue plug is it in the Philips Hue app not possible to change the brightness of the light. The slider bar is for that reason not shown.
These lights in Home Assistant using lovelace-hue-like-light-card will have a slider which does not work as that isn’t supported. Suggestion to hide the slider based on the device type (Hue smart plug (LOM007)) or via a configuration setting.

Suggestion: Change "scene" icons to match it's primary color, similar to the current Hue App

Hey! I love this card, it's the reason I decided to migrate off of the hue app.

The only thing I miss is the ability to quickly see what color a scene will be because it's currently a list of grey icons , when you have a lot of scenes, it gets hard to remember what each one looks like.

Is it possible to make an option to apply the primary color of a scene to it's button in the hue-screen view?

Hide slider when off

Hey,
I was thinking if that would be an option to have.
When the light is off do not show the slider. Would look cleaner for me. Would be nice if we could add this as an option. As always greatbjob you are doing here

Malkie

Not every user see custom

My wall-pad cant’t see de custom card. On my phone it works.

Why is that and how can I resolve this?

thanks for you’re help.

IMG_4890
IMG_4889

Color control for non hue brand lights?

It seems only my hue branded lights allow setting the colors. All other lights only show on/off/brightness.

Is it not possible to use non hue branded lights with this?

Add hue light slider to scene pages

Is it possible to add the lights slider / buttons to the scene page that pops up.

This is similar to the functionality you get with the hue controls.

I can see there is a stub that looks like it might be starting to do that already.

Fix background `theme-color` on iOS Themes

Hi,
I've just come across your great card. I'm slowly moving away from hue hub and moving all my lights to Z2M and this really helps keep my wife happy :) .

I noticed you allow us to have the offColor to be the HA theme, would it be possible to have an option for it to use a custom theme you maybe using?

Vertical list of lights (old Hue app style)

Thanks for making this excellent card!

Personally, I much prefer the interface from the old Hue app where lights in a group were laid out vertically rather than horizontally. I find it faster to use since you can show more lights in the interface without having to scroll, and I like being able to quickly adjust brightness using the sliders.

image

Would it be possible to add a setting to use this layout? It could reuse the UI component for the main card.

Styling customizations

I love this card in general, but I'd like to make a few styling changes for how the main card looks on my dashboards. I've been trying to use card_mod to do this, and it works great while editing the card, but the card on my dashboard itself never gets the styling applied for some reason.

By contrast, card_mod is working for me on most other card types.

I'm curious if there is any known way to override the styling of the card?

The styles I'm attempting to apply, which look good while editing the card but do nothing when viewing it, are:

card_mod:
  style: |
    ha-icon {
      transform: scale(1.3) !important;
      position: static !important;
      top: auto !important;
      left: auto !important;
      margin-left: 1rem;
    }
    .tap-area {
      display:flex;
      align-items: center;
    }
    h2 {
      font-size: 1.2em;
      margin: 0 0 0 1rem !important;
    }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.