Add scene support for scenes defined in Home Assistant
See original GitHub issueIs 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:
- Created 2 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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
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?