Open schneiderr opened 10 years ago
Hi nice idea,
I will fork it tonight, but basically, touchplate is a low voltage lighting solution. The system uses mechanical latch relay's. I will be using an 8 channel 5V relay to switch the state of the touchplate relay. Since the touchplate relays are mechanical. I only need to trigger my relay for .75 seconds in order for the mechanical latch to switch. Hence the toggle switch and not the on - off buttons.
I am not sure , that's what i need to figure out. I am pretty new to node, socket, mongo and all of the other projects heimcontrol use's so i am still trying to figure that out.
I have not had to do much if anything with the db when adding my other features, i used javascript and duino. but now im trying to add a column in the database to store the groupid. that i can then get from item
ok MongoDB is Object oriented to there's no column in the DB but keys of the object your working on all JSON style. The way I think it could work is simply adding a groupid property to the items object on the client. Heimcontrol should take care of the rest as it iterates through all property's and updates the DB as settings are saved. Item.groupid = "No Light Group" //?? might work
Here is my forked repo. i will be adding the group lighting code to it tonight or tomorrow.on a sperate branch.
I have figured out how to get the id into the database, it was the same thing i was trying before but i must have been making a mistake somewhere.
div.touchplateah(class=(item.method != 'touchplateah' ? 'hidden' : ''))
label(for="groupid") Group Id:
select(name="data[#{i}][groupid]")
option(disabled="disabled",selected=(item.groupid == '')) Choose Group
option(value="1",selected=(item.groupid == '1')) No Group
option(value="2",selected=(item.groupid == '2')) Group 1
option(value="3",selected=(item.groupid == '3')) Group 2
option(value="4",selected=(item.groupid == '4')) Group 3
I will be using heimcontrol to control outdoor lights that are on a touchplate system. I thought it would be nice to add light groupings into my program. Right now i am using jquery to trigger specific buttons that ive hardcoded.
Now i am trying to give the user the choice between no light group, group 1 or group 2.
The trouble i am having is with the database. I want to to store the group id as part of the "item" ( item.groupid ). However, when i do this, the database does not like it and i cannot figure out where the initial representation is stored and how i can add item.groupid to the item.