In the last post we looked at some initial code to get basic information about the lights connected to a Philips Hue bridge. In this post we’re going to extend the code to expose more information but also to query the bridge repeatedly, allowing the graph to display the latest light colours as they change.
Here’s a view of the updated graph. A few things have changed: firstly the Bridge object exposes some new information – in our case we can see the names of the lights, but we could also access the names and IDs of the various groups, scenes, rules, schedules and sensors stored in the bridge. Secondly we’ve inserted a Light.RefreshData node, which has the “CanUpdatePeriodicallyAttribute” set to true. It simply refreshes the data for the light and returns the Light object to the downstream node. This means we can change the execution of the graph from manual to periodic, so that it polls the bridge repeatedly.
Let’s take a look at the graph in action, with the Dynamo…