0

i´m using the node-hue-api to control my hue system. Depending on brightness i automatically call different scenes. This all works fine.

But when i change a scene at the iOS app from Philips (because e.g. i added a philips go to my scenes) i have a new scene with different id but same name within my list. Actually i have no idea how to identify, which scene is the newest one to use it. Does anyone has a hint how to solve this problem?

 { id: '197bac2ca-on-0',
  name: 'Computer Arbeit ',
  lights: [ '2', '3', '4', '5', '6', '7', '8', '9', '10' ],
  active: true }

{ id: '15ecdb18b-on-0',
  name: 'Computer Arbeit ',
  lights: [ '2', '3', '4', '5', '6', '7', '8' ],
  active: true }

{ id: '389a393d6-on-0',
  name: 'Computer Arbeit ',
  lights: [ '2', '3', '4', '5', '6', '7', '8' ],
  active: true }
solick
  • 2,325
  • 3
  • 17
  • 29

1 Answers1

0

Scenes are still a bit problematic to handle, especially since you get nearly no information out of the bridge, since the configuration of the lights in a scene are stored in the lights and can't be requested without recalling a scene. Afaik, there is no timestamp saved for scenes.

According to the API Description of "Get all scenes", there is a difference between the "app scenes" and the "bridge scenes". The configuration of the scenes in the app are stored internally in the app and only pushed onto the bridge when called. Since there is no information saved in the bridge, you can only solve this problem on your side.

Also the Description of "Create scenes" states, that if a new scene with the same name is created, it will be overwritten. Make sure, that you have the newest firmware, maybe there was a bug in an older one. Or maybe it has a problem with the trailing whitespace in your name. I haven't tried it out myself yet.

One workaround is to store the IDs you know of a scene, and if you see that there is another one with the same name, remember the new id since the one you found has to be newer. For this to work, you would need to save all existing one once and choose the newest one manually, since there is no option to delete old ones... This will also only work, if only one scene with the same name is added between two checking cycles (if there are more, it is again not distinguishable).

  • Hi and thanks, i´m a little bit surprised that the hue api is so uncomfortable. I will find a workaround but it is really unnecessary work from my point of view – solick Oct 20 '15 at 15:06