@hazymat wrote:
Hi all
I'm looking for some critique of my implementation of lighting control in NR.
For a while I've just set up dashboards with static controls for each light, but I'd like to move towards a dynamic configuration. So the UI would basically "create itself", based on the configuration. Also, the config could be changed within Dashboard. (e.g. adding a light to a zone, or storing a scene preset)
The main items to store are:
- light fixtures
- zones, (each one containing an array of fixtures)
- scenes (e.g. a 2D array, each zone will have settings for each fixture in the given zone)
The obvious way to implement this is using a database, but I'd prefer to store everything in NR.
e.g. an object in context like below. What do you think of this idea? Should I just keep it simple / static? It would be pretty cool being able to make changes through the dashboard (more user friendly for others), also I should add we are building a new home, so will be setting up lighting over the course of a few months, hence it might be useful to have a framework to work in, for testing and ease of changing one's mind!
{ "lights" : [ { "id" : "3f_bedroom_ceiling", "friendly" : "3rd floor bedroom ceiling", "type" : "dimmable single colour", "topic" : "home/light/1", "defaultstate" : 20, "currentstate" : 50 }, { "id" : "3f_bedroom_bedside", "friendly" : "3rd floor bedroom bedside", "type" : "dimmable single colour", "topic" : "home/light/2", "defaultstate" : 20, "currentstate" : 50 } ], "zones" : [ { "id" : "3f_bedroom", "friendly" : "Master bedroom" "members" : ["3f_bedroom_ceiling", "3f_bedroom_bedside"], "scenes" : [ { "Name":"Off", "Values" : [ ] } ] }, { "id" : "3f_living", "friendly" : "Living Room", "members" : ["3f_living_ceiling", "3f_living_wall","huego1"] } ] }