Hi, this is quite a "beginner's" question but hopefully someone can help?
I want to build up a "definitions" file that describes the properties for various custom DIY home automation devices.
I'm thinking the best way might be some form of JSON file on disk.
Should I use context, and store to disk?
I have already turned on disk storage in settings.js by adding the following:
default: {
module:"localfilesystem"
},
},
So for example:
Light 1 (zone = bedroom1, name="Wall Light", fitting=wall, colour=warmwhite, currentlevel=50%)
Light 2 (zone = bedroom1, name="Ceiling Light", fitting=ceiling, colour=RGB, currentlevel=(40,50,0))
PIR 1 (zone = bedroom1, fitting=ceiling, state=idle, etc....)
BedroomScene0 (Light1=0%, Light2=0%, Light3=0%, Light4=0%)
BedroomScene1 (Light1=50%, Light2=25%, Light3=0%, Light4=100%)
BedroomScene2 (Light1=100%, Light2=100%, Light3=100%, Light4=100%)
etc...
The reason I think I'd like to do this, is so that in the future I might:
- dynamically generate dashboard buttons, sliders, etc.
- count the number of light circuits in a room (in case I add or remove some later)
- be able to set up / store light scene definitions, e.g. from the dashboard
- persist light levels across reboots
- more?
Does this seem like a good thing to do?
Any tips on how to manage this well, e.g. how to populate the settings initially, such as when I add a new light etc?
Sorry it's a general question, but I'm overwhelmed by the possibilities so far.