question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add scene support for scenes defined in Home Assistant

See original GitHub issue

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

I bought this light switch, which displays and allows you to activate Hue scenes for the chosen room. Violet smart switch lite It would be great to have this work natively with hass-emulated-hue !

Describe the feature that you would like to be added

Support for scenes:

  • Scenes defined in HomeAssistant should be exposed by the /scenes API route.
  • Scenes defined in HomeAssistant can can be recalled/activated by calls to the /groups/id/action route, specifying a scene ID in the request body as per the standard API.

Describe alternatives you’ve considered

I have used Postman to call the create scene API endpoint to define scenes manually, with some success.

Describe your use case for this feature

Exposing the scenes defined in home assistant will avoid having to create them manually and would be of benefit to all users, not just those who want to use the light switch I’ve mentioned!

Additional context

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
finopsfuntimescommented, Jul 29, 2021

Made some changes in my own fork that have got this working for my use case - compare

All the existing scene functionality is retained, but now the hass scenes are exposed as well. Hass scenes are identified by the presence of an entity_id attribute in the scene config and as such, when the action to recall a scene is handled, the command is directed to hass to turn_on the scene instead of running the original code.

If a user deletes a hass scene through the api, the scene does not get deleted from hass and will therefore get recreated automatically the next time the /scenes endpoint is called.

If a user edits a hass scene through the api, the changes are not propagated to hass, so the changes have no effect

0reactions
finopsfuntimescommented, Jul 26, 2021

That’s a good point about the crashes. I guess the other option is to discard the new values in the request and then return an OK response?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scenes - Home Assistant
You can create scenes that capture the states you want certain entities to be. For example, a scene can specify that light A...
Read more >
Using Scenes in Home Assistant - YouTube
Learn how to use scenes to simplify your Home Assistant automations.Links:Magic Cube Automations: https://youtu.be/wRf9RT2YgaISmart TV ...
Read more >
Home Assistant Scenes to bring your smart home ... - YouTube
Scenes in Home Assistant provide the functionality that give power to ... to create a Scene that you want to activate with an...
Read more >
How to Cycle through Scenes like Hue using a ... - YouTube
How to Cycle through Scenes like Hue using a Button in Home Assistant - TUTORIAL. 7K views · 2 months ago ...more ...
Read more >
Scenes on Steroids in Home Assistant - How To - Tutorial
With scenes, you can take snapshots of a certain status of your devices in Home Assistant. This allows you to quickly transform your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found