Git Product home page Git Product logo

lovelace-big-slider-card's Introduction

Big Slider Card

GitHub Release

hacs_badge

Big slider card inspired by the google home app cards for light entities.

Preview

Please ⭐️ this repo if you find it useful

Installation

HACS

This card is available in HACS (Home Assistant Community Store). Search for Big Slider Card in the Frontend section.

Manual

  1. Download big-slider-card.js file from the latest-release.
  2. Put big-slider-card.js file into your config/www folder.
  3. Go to ConfigurationLovelace DashboardsResources → Click Plus button → Set Url as /local/big-slider-card.js → Set Resource type as JavaScript Module.
  4. Add custom:big-slider-card to Lovelace UI as any other card (using either editor or YAML configuration).

Configuration

Sample Minimal Configuration

type: custom:big-slider-card
entity: light.lamp

Sample Full Configuration

type: custom:big-slider-card
entity: light.lamp
name: Bedroom Lamp
attribute: brightness
transition: 0.3
height: 80
background_color: '#a45634'
text_color: '#ffffff'
border_color: 'ff00ff'
border_radius: '4px'
border_style: 'dashed'
border_width: '5px'
icon_color: '#ff00ff'
colorize: true
icon: mdi:lamp
show_percentage: true
bold_text: true
min: 1
max: 80
hold_time: 600
settle_time: 3000
tap_action:
  action: more-info
hold_action:
  action: call-service
  service: light.turn_on
  data:
    entity_id: light.test_light_1

Options

Name Type Requirement Description Default
type string Required custom:big-slider-card
entity string Required Home Assistant entity ID.
name string Optional Name to show on card entity name
attribute string Optional Attribute to control brightness
transition number Optional Transition time (seonds) not used if unset
height number Optional Card height in px form theme
color string Optional Slider color (CSS format) form theme
background_color string Optional Background color (CSS format) form theme
text_color string Optional Text color (CSS format) form theme
icon_color string Optional Icon color (CSS format) entity color
border_color string Optional Border color (CSS format) form theme
border_radius string Optional Border radius including units (CSS format) form theme
border_style string Optional Border style (CSS format) form theme
border_width string Optional Border width (CSS format) form theme
colorize boolean Optional Colorize slider using entity color false
icon string Optional Sets custom icon entity icon
show_percentage boolean Optional Show percentage under entity name false
bold_text boolean Optional Make taxt font bold false
min number Optional Maximum value for slider 0
max number Optional Minimum value for slider 100
min_slide_time number Optional Mimimum time to prevent accidental changes (ms) 0
hold_time number Optional Hold gesture time (ms) 600
settle_time number Optional Ignore updates after changig the value (ms) 3000
tap_action object Optional Action to take on tap action: toggle
hold_action object Optional Action to take on hold action: more-info

For more info about the rest of the action options see this page: Actions - Home Assistant

The card uses the following css variables for configuring the look and feel:

--bsc-background: var(--card-background-color, #aaaaaa);
--bsc-slider-color: var(--paper-slider-active-color, #f9d2b0);
--bsc-color: var(--paper-item-icon-color);
--bsc-off-color: var(--paper-item-icon-color);
--bsc-entity-color: var(--bsc-color);
--bsc-primary-text-color: var(--primary-text-color);
--bsc-secondary-text-color: var(--secondary-text-color);
--bsc-border-color: var(--ha-card-border-color);
--bsc-border-radius: var(--ha-card-border-radius);
--bsc-border-style: var(--ha-card-border-style);
--bsc-border-width: var(--ha-card-border-width);

lovelace-big-slider-card's People

Contributors

blackcube4 avatar nicufarmache 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

Watchers

 avatar  avatar  avatar  avatar

lovelace-big-slider-card's Issues

Light without brightness

Hello,

Trying to use this template for a light without brightness control. So the light just turn on/off.
Button works, but the state is not displayed correctly when turned on.

The 'big-slider-card' gets following css classes
--bsc-percent:NaN%; --bsc-icon-color:var(--bsc-color); --bsc-brightness:0%; --bsc-brightness-ui:50%;
So it seems the light is turned off.

Min settings causes slider value to not go to zero when entity is off

Checklist:

  • I updated to the latest version available
  • I cleared the cache of my browser

Release with the issue:
1.1.4

Last working release (if known):
NA

Browser and Operating System:
Windows Chrome
iPadOS Safari

Description of problem:
When using min setting on a light entity turning off the light shows the slider value stuck at the min value instead of going down to zero like you’d expect for an off light. As a result it becomes quite difficult to tell a light is on, with only the colour of the icon as an indicator.

Light on with dimmer level:
image

Light off:
image

Doesn’t Work when Brightness is an Entity

When brightness is an individual entity, as opposed to a attribute of another entity, this does not work. For instance Lametric Time and Sky both have a standalone brightness entity (IE, number.sky_brightness), not a brightness attribute, so it always reads off and doesn’t set the brightness. In this cases entity state needs to change as opposed to attribute value, which is not working.

Card not working on nest hub

Checklist:

  • I updated to the latest version available
  • I cleared the cache of my browser

Browser and Operating System:
Google Cast, Nest Hub

Description of problem:
Card not available on Google Nest Hub "Custom element doesn't exist: big-slider-card."

Javascript errors shown in the web inspector (if applicable):
No access to web inspector.

Constant icon color.

Discussed in #49

Originally posted by fcassata January 14, 2024
Thanks for making this card available, absolutely love it! Is there a way for me to keep the icon color constant, and not have the opacity change with the brightness of the connected light entity?

Problem with Bar Height - Please Add Bar Height

Is your feature request related to a problem? Please describe.
Yes

Describe the solution you'd like
I want you add bar height because if i change the height of bar with CSS (card-mod etc.) I have this problem: https://i.imgur.com/Vbmu6Ay.gif on every refresh on every tab that i have the bar. It loads first the original height and after that the CSS fixed height. So it's like have bug/lag...

Additional context
I see your latest update that you add border_width and I was happy about.. but after some time it was clear to me what's the purpose of this... Please add a general height and it will be perfect!

Standardization with Tile Card

Discussed in #24

Originally posted by jazzyisj April 17, 2023
What a great card! Makes you wonder why the UI dev's didn't do this to the tile card, so intuitive! Thank you! Looking forward to seeing if you can extend it to other entities (I see a few requests for that).

Would you consider standardizing some of the UI of the big slider card with the hass tile card? I'd like to be able to use them interchangeably in my UI but the inconsistencies are bothersome.

  1. Card background should really have been the standard card background color. (ha-card-background). I was able to accomplish this for myself with card_mod, but I think it should come out of the box that way for consistency, allowing the user to customize if desired.

  2. Card size - the big slider card height is slightly smaller than a tile card and it looks terrible in a grid when used together. Haven't been able to figure this one out with card_mod yet.

  3. Entity name should not word wrap -> it pushes the secondary text off the card, becomes unreadable, and looks terrible.

  4. Icon alignment - the big slider icon has less padding to the left than the tile card icon.

image
  1. A halo around the entity icon would be great to add a little contrast between the icon and the background when entity is on and for a consistent look with the tile card. Especially if one uses the state-light-active-color for the slider color. Also, the icon when no rgb support should also be state-light-active-color, not white for consistency with other hass cards.
image
  1. Personally I would have used the state-light-active-color as the standard active slider color instead of the primary color for consistency with other cards. Of course easily remedied with the color: option of the slider card, it's just a thought.
image
  1. This is more of a functionality request. I have several timed lights in my home. Currently I display any active light timers in a separate card (see screenshot). I'd love to be able to put those timers in the secondary text slot somehow.
Screenshot 2023-04-17 090959

Thanks again for the great card. It really gave my lighting dashboard a fresh new look!

image

Show "Unavailable" for offline devices

Hello,

i can't differentiate if my light is really "off" or "offline" because the slider shows "off" on both occasions.

I would like to see "Unavailable" or another indication that the device is out of reach or offline and therefor i wouldn't react with the slider (toggle, hold or slide)

Thank you.

Scrolling not possible

Great work. Look a lot nicer when they other options out there. But if i have a lot of Them, i can't scoll on my mobil without changeing the light. Maybe it's possible to only change the light then scolling sideways. Hope it make sensor.

Icon and Text size

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

I want to Match the icon and Text size to my other used cards

Describe the solution you'd like
A clear and concise description of what you want to happen.

An Option to Set the size of the Icons and Text

Could this card be expanded to things like volume control?

Is your feature request related to a problem? Please describe.
With a recent update on Google Home / Nest speakers with Spotify, the volume is now much louder, so I need much more precise control of the speakers/groups.

Describe the solution you'd like
Just the ability to control the volume or volume_level attribute with the card.

Describe alternatives you've considered
image

Request: Set icon color when entity is off

Is your feature request related to a problem? Please describe.
I don't like the default colors of icons. I like that this card lets me change icon color, but it only changes color when the entity is off. I'd love an icon_off_color attribute as well.

Describe alternatives you've considered
I've considered setting it with card_mod, but having it as an option directly in the card here would be nice.

Attribute color_temp does not work

Checklist:

  • I updated to the latest version available
  • I cleared the cache of my browser

Release with the issue:
2023.3.6
Last working release (if known):

Browser and Operating System:
Windows 11, Vivaldi 5.7.2921.65

Description of problem:

It seems this card does not work with the color_temp or color_temp_kelvin attribute.

The code I use:

type: custom:big-slider-card
entity: light.chevet_amis_geneve
name: Chevet amis Genève
attribute: color_temp_kelvin
colorize: true
icon: mdi:light-recessed
tap_action:
  action: none
min: 2500
max: 6500

For some reason, the slider has no effect. Same problem when using the color_temp attribute and adapting the min and max values accordingly. Light works fine, calling light.turn_on and setting color_temp via dev tools services works. Am I missing something obvious here?

Add % Value option

Discussed in #2

Originally posted by markus99 February 28, 2023
Any thought to add a % value (either after name or as 2nd line below?)

Mushroom sliders aren't great, but what I'm using now and can show the value like this:

image

Long press popup dissapears on button release.

Checklist:

  • [Y] I updated to the latest version available
  • [Y] I cleared the cache of my browser

Release with the issue:
1.1.4 (and all previous)

Last working release (if known):
N/A

Browser and Operating System:
Windows / Firefox latest (and all previous)

Description of problem:
When I long press the card (hold_action) it shows the default 'more-info', but when i release the mouse button it closes the popup window again if the mouse cursor is not hoovering over the popup which is often the case in a desktop situation.

Javascript errors shown in the web inspector (if applicable):
N/A

Additional information:
I've tried it on Windows / Chrome, this browser does not show this particular behavior.
I've made a default HA button with long press, it also does not show this behavior. I did notice that the button only showed the long press action on button release where as the big-slider-card shows it on a delayed time while the button is still press down.

Feature Request : Square button shape

Is your feature request related to a problem? Please describe.
In order to integrate the card better with other button cards, it would be nice to have an option to make it a 'square' shape

Describe the solution you'd like
Just have an optional "button" setting to render the card as a square

Describe alternatives you've considered
n/a

Additional context
Thank you so much already for this card, it is really nice !

Slider Off Color

Best slider card around
I'd like to be able to change the slider background color in its off state to better integrate it into other cards with other colors.

Removing and coloring the border would be nice too

Localization does not work

Checklist:

  • I updated to the latest version available
  • I cleared the cache of my browser

Release with the issue:
1.1.4

Last working release (if known):
n/a

Browser and Operating System:

Description of problem:
Lights that are switched off appear as "off" although it should read "aus" (German locale). HA is set to Germany/German in settings.

Javascript errors shown in the web inspector (if applicable):


Additional information:

tap_action not supporting data: instead of deprecated service_data:

home-assistant/frontend#12628

I recently updated my entire UI config to comply with the new standard of using data: rather than service_data: for entity actions and discovered that the Big Slider Card has not updated yet to support the new syntax. It's the only card I've come across so far that doesn't. Since you link to the updated documentation, it might lead to some confusion.

New syntax (doesn't work):

tap_action:
  action: call-service
  service: script.some_script
  data: "some data"

Old syntax (works):

tap_action:
  action: call-service
  service: script.some_script
  service_data: "some data"

Checklist:

  • [ X] I updated to the latest version available
  • [X ] I cleared the cache of my browser

Release with the issue:
v1.1.2

Wrong brightness percentage

Checklist:

  • I updated to the latest version available
  • I cleared the cache of my browser

Release with the issue:
2023.3.6

Last working release (if known):

Browser and Operating System:
Google Chrome 112.0.5615.49, Windows 11

Description of problem:

When changing the brightness of a WLED light, the card sometimes shows a higher brightness percentage than the Home Assistant more-info card.

In this example, WLED reports a brightness level of 97 out of 255, which is 97/255 = 38.04%. It seems like this card rounds the brightness up to 39%, while Home Assistant only rounds up if the brightness level is >= *.5%, so it rounds down to 38%.

Javascript errors shown in the web inspector (if applicable):


Additional information:

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.