Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using action: sevice brakes color customizing #32

Closed
radinsky opened this issue Nov 6, 2018 · 4 comments
Closed

Using action: sevice brakes color customizing #32

radinsky opened this issue Nov 6, 2018 · 4 comments

Comments

@radinsky
Copy link

radinsky commented Nov 6, 2018

When using 'action: service' the "color" (color on) parameter is not working

@kuuji
Copy link
Collaborator

kuuji commented Nov 6, 2018

@radinsky Can you show me your config? Thanks

@radinsky
Copy link
Author

radinsky commented Nov 6, 2018

sure,
This one is working with action to trigger my scene (but the color off is not working):

          - type: "custom:button-card"
            action: service
            service:
              domain: scene
              action: turn_on
              data:
                entity_id: scene.kitchen_entry_off
            icon: mdi:lightbulb
            color: auto
            color_type: card
            default_color: "#997701"
            color_off: "#555555"
            name: Off
            style:
              - font-size: 12px
              - font-weight: bold
              - text-transform: none

The button trigger the scene but has a wrong color:
image

This one with removed "action" section:

          - type: "custom:button-card"
            entity: scene.kitchen_entry_off
            icon: mdi:lightbulb
            color: auto
            color_type: card
            default_color: "#997701"
            color_off: "#555555"
            name: Off
            style:
              - font-size: 12px
              - font-weight: bold
              - text-transform: none

it makes this button with correct color (but the scene is not triggering):
image

@kuuji
Copy link
Collaborator

kuuji commented Nov 6, 2018

You do not have an entity on the first one. So color: auto doesn't know which color to pick.
You'll need an entity with a color attribute for color: auto to work.

Also for color_off to work, the entity needs to have an off state. So a scene might not have that.

I'd advise using my new state attribute to do what you want to do. You'll need to set the entity to the scene so that you can use the different attributes.

I don't recall if a scene entity has a color attribute, if it does, you can use color: auto so that you don't have to specify the color.

                state:
                  - value: 'scening'
                    color: "#997701"

This is just an example off the top of my head, I don't have hass available to try this right now.

@radinsky
Copy link
Author

radinsky commented Nov 6, 2018

Ok, adding the "entity" to the first one is solving the issue. Thanks!

          - type: "custom:button-card"
            entity: scene.kitchen_entry_off #for the auto color
            action: service
            service:
              domain: scene
              action: turn_on
              data:
                entity_id: scene.kitchen_entry_off
            icon: mdi:lightbulb
            color: auto
            color_type: card
            default_color: "#997701"
            color_off: "#555555"
            name: Off
            style:
              - font-size: 12px
              - font-weight: bold
              - text-transform: none

image

@radinsky radinsky closed this as completed Nov 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants