Feature Request: Activation of scene and script entities
Closed this issue · 4 comments
It would be great if it would be possible to activate scenes via your extension instead of controlling lights and switches directly
Alright, this makes sense and is a nice feature to have. I will need to take a look at the scenes API and test it indirectly since I don't have scenes in my instance.
Maybe I'll give it a shot myself today. I have also been wanting to get my feet wet with the Homeassistant API for a while now
Alright, please feel free to make a PR. I actually just implemented a mock environment to test this and it seems pretty straightforward. You need to hit the <url>/api/services/scene/turn_on
endpoint and send the entity id with the request data (similar to how we toggle switches in this extension). Let me know if you need any help with understanding the code.
As a side note, you should maybe clone the repo from PR #62 since the communication utilities will change from sync to async and that will change the structure of the code.
Just figured out that scripts also just use the turn_on
servicce, so I will implement script entities as well 🥳