-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code error for Scene-operations main.ts line 489 #541
Comments
Legacy just adds a useless device object in between instance and first channel. So this should not make a difference. Can you show me the light scenes folder |
issue still persists after latest update to 3.10.2. Your example above shows a scene-example for a group scene. When polling the Bridge info and creating the scene-objects, you do differntiate between group-scenes and global scenes ( Line 2136 in 0012c50
I am using global scenes, you are just handling group scenes in the code for the command-handling. |
Sorry but what you are writing does not seem right from code perspective or you see something which I do not see. Group scenes are handled in a way that they are created at the corresponding group, else they are created at Lines 2161 to 2190 in 21194ae
And the state change handling is implemented for every dp starting with Lines 256 to 273 in 21194ae
You should also see the corresponding log message |
Hi @foxriver76 : I think the misunderstanding is about how these scene get triggered. I am NOT changing the state of a scene datapoint. I am issueing a command in order to set a certain scene to a group of lights. The scene is not defined as a group scene for this group, but as a global scene. Following example for the data structure:
This code here Lines 490 to 497 in 21194ae
can only handle a scene handed over in the command, which is a scene within the scope of the light/group I want to change. It refers to ${channelId}.scene_${commands.scene.toLowerCase()} .
If you want to set a global scene, which is not defined in the scope of the light/group, but as a global scene under the lightScenes folder, you would need to refer to another namespace, which is |
Okay, maybe I do not fully understand which kind of scene this is. AFAIR there were scenes corresponding to a group and the Light Scenes which you can create and also define which lights are connected to the scene https://github.com/peter-murray/node-hue-api/blob/typescript/docs/scenes.md#createscene So I am not aware how we can set a scene to lights not correlated to the specific scene by its configuration. But if you have a setup running, please feel free to create a PR. |
I am afraid I do not know how PRs work and how to interact.
|
And you have tested that this works as expected? ;-) |
yes, but only by modifying the code directly in the node_modules folder :P |
@foxriver76 I created a PR for this |
In the current source code of /src/main.js of commit aa7c8fb has a code-error in line 489 which prohibits changes of scenes for light-groups.
The reference to the lightScene is not found.
Current code
const sceneObj = await this.getObjectAsync(
${channelId}.scene_${commands.scene.toLowerCase()});
it needs to be changed at least to
const sceneObj = await this.getObjectAsync(
${this.namespace}.lightScenes.scene_${commands.scene.toLowerCase()});
or better with replacing "lightScenes" with the dynamic object-group-namespace.
The text was updated successfully, but these errors were encountered: