michielpost / Q42.HueApi

C# helper library to talk to the Philips Hue bridge
MIT License
411 stars 114 forks source link

Creating an entertainment zone on Api V2 #296

Closed Christanoid closed 1 year ago

Christanoid commented 1 year ago

Hello,

I am trying to get creation use and deletion of custom entertainment_configurations to work. More specifically I have the following use case: My software wants to use the entertainment API to control a certain set of lights, it has it's own map of where lights are and has more lights than just Philips Hue. Since my project is not centered around just Hue I don't want to refer a potential user to the Hue app to create a fitting entertainment zone. The zones need to be created on the fly. Switching to V2 I can't get this creation process to work. Using the function: _client.CreateEntertainmentConfigurationAsync(entConf) I can only seem to get the error: Unable to verify Entertainment Configuration locations

Looking at Philips Api documentation my config should have all required values, however I cannot get it to work. Can anyone give me a small minimal example of how to create and delete a zone? How to stream is already covered in a given example, however the creation and removal is not yet documented with an example.

michielpost commented 1 year ago

Make sure to check these things:

I created a basic sample test here: https://github.com/michielpost/Q42.HueApi/blob/master/src/HueApi.Tests/EntertainmentConfigurationTests.cs#L68

Christanoid commented 1 year ago

Thanks for the example, I finally managed to get everything to work :) While reading through the example it finally clicked in my head and I understood the connection between devices and services.