Gh61/lovelace-hue-like-light-card

Feature Request: Option `switchOnScene`

danejur opened this issue · 4 comments

Love this add-on and all of the improvements that you've made to it! One handy thing I would love is for toggling a card's switch to the on position to always set a specific scene. I have a few physical switches that I have configured to always turn on to max brightness regardless of what the lights were set to before they were turned off. I'd love to replicate this functionality with the hue-like card! I imagine it word work something like this:

  1. User sets lights to a custom scene, brightness, color, etc.
  2. User turns off lights
  3. User turns lights back on via hue-like card on switch, which sets the light to the predefined "default state" instead of the previous state.

If this is already in the card and I'm not seeing it in the configuration, I apologize! I might try to poke around the JS myself if I get some time, but I figured I'd log this request regardless.

Gh61 commented

You can already achieve similar behaviour with this settings:

type: custom:hue-like-light-card
entities:
  - light.some_light1
  - light.some_light2
offClickAction: scene
offClickData:
  scene: scene.some_lights_bright

See Click action for more info about the Action settings.

With this setting if you click the card (not the switch) when all lights are off, it will activate the some_lights_bright scene.

It probably isn't exactly what you wanted (the switch will still be working the same), but maybe it can fit your needs?

I was thinking about this pattern as well, but my biggest issue is that clicking the card would no longer bring up the hue-like settings (with the different scenes and individual lights). This wouldn't be an issue for me personally, but I'm trying to make it as painless as possible for my wife. If its alright with you, I'll leave this issue open and try my hand at making the necessary modifications at some point in the near future. Thank you for the suggestion, though!

Gh61 commented

I thought this would be an issue. But as you pointed out with the analogy to physical switches (I am using them the same way), the
onScene (or some better name, that I could not figure out now) option makes sense.
So lets leave this issue opened and whoever gets to it first can implement it.

Will be in the next release.