• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


CONTACT devices
#1
I would like to request a device type 'CONTACT' for devices like doorbells and contact sensors that only just monitor a state.
 
Reply
#2
I believe contacs and bells are different. Contact have a state "opened or closed" while doorbells only ring. This means that you want to be able to see what the state of a contact is. For a doorbell you just want to receive a message that it rang.

Can you do a pull request will all necessary changes to implement this?
 
Reply
#3
(02-26-2014, 04:34 PM)curlymo Wrote: I believe contacs and bells are different. Contact have a state "opened or closed" while doorbells only ring. This means that you want to be able to see what the state of a contact is. For a doorbell you just want to receive a message that it rang.

Can you do a pull request will all necessary changes to implement this?

Your right maybe we need 2 different device types for that
 
Reply
#4
In my opinion a doorbell and a sensor are both some kind of switches. Difference is that doorbells and cheap door sensors only send one state. To fix thath, I would propose a fuction like below for protocol sensor_1527. It isn't working 100% yet and the compiler gives a warning on the conversion from signed int to unsigned int.

The function assumes that the switch sends an "on" state when the doorbell is pressed or the door is opened. Prerequisite is:

Code:
options_add(&sensor_1527->options, 'd', "resetdelay", has_value, config_value, "[0-9]");

Resetdelay is the time in secs after which the switch should be reset. If 0, the switch isn't reset.

Code:
void sensor1527ResetSwitch(JsonNode *code) {
    int id =-1;
    int resetdelay =-1;
    unsigned int unsignedresetdelay;
    
    json_find_number(code, "id", &id);
    json_find_number(code, "resetdelay", &resetdelay);
        
    if (delay > 0) {
        unsignedresetdelay = (int)resetdelay;
        sleep(unsignedresetdelay);
        sensor_1527->message = json_mkobject();
        json_append_member(sensor_1527->message, "id", json_mknumber(id));
        json_append_member(sensor_1527->message, "state", json_mkstring("off"));
    }
}
 
Reply
#5
Just thinking outloud; how to catogorise all sort of devices to come up with good device types/protocols.

'Notification' device like doorbell, smoke alarm, movement detection, generic alarms, 'and ?'
'State' device like DoorSensor, 'and?'

Maybe someone can add up or has ideas Wink
 
Reply
#6
I have door contact devices and motion sensors which send only one state on motion or opening. So my opinion is simply triggering the rules and updating the device values every time those devices are received.
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  Add devices via the web GUI Redeyes 1 2,441 11-09-2013, 03:07 PM
Last Post: curlymo

Forum Jump:


Browsing: 1 Guest(s)