Example #1
0
void threechanInit(void) {

	protocol_register(&threechan);
	protocol_set_id(threechan, "threechan");
	protocol_device_add(threechan, "threechan", "3 Channel Weather Stations");
	protocol_plslen_add(threechan, 266);
	protocol_conflict_add(threechan, "alecto");
	protocol_conflict_add(threechan, "teknihall");
	threechan->devtype = WEATHER;
	threechan->hwtype = RF433;
	threechan->pulse = 15;
	threechan->rawlen = 74;

	options_add(&threechan->options, 't', "temperature", OPTION_HAS_VALUE, CONFIG_VALUE, JSON_NUMBER, NULL, "^[0-9]{1,3}$");
	options_add(&threechan->options, 'i', "id", OPTION_HAS_VALUE, CONFIG_ID, JSON_NUMBER, NULL, "[0-9]");
	options_add(&threechan->options, 'h', "humidity", OPTION_HAS_VALUE, CONFIG_VALUE, JSON_NUMBER, NULL, "[0-9]");
	options_add(&threechan->options, 'b', "battery", OPTION_HAS_VALUE, CONFIG_VALUE, JSON_NUMBER, NULL, "^[01]$");

	options_add(&threechan->options, 0, "device-decimals", OPTION_HAS_VALUE, CONFIG_SETTING, JSON_NUMBER, (void *)1, "[0-9]");
	options_add(&threechan->options, 0, "gui-decimals", OPTION_HAS_VALUE, CONFIG_SETTING, JSON_NUMBER, (void *)1, "[0-9]");
	options_add(&threechan->options, 0, "gui-show-humidity", OPTION_HAS_VALUE, CONFIG_SETTING, JSON_NUMBER, (void *)1, "^[10]{1}$");
	options_add(&threechan->options, 0, "gui-show-temperature", OPTION_HAS_VALUE, CONFIG_SETTING, JSON_NUMBER, (void *)1, "^[10]{1}$");
	options_add(&threechan->options, 0, "gui-show-battery", OPTION_HAS_VALUE, CONFIG_SETTING, JSON_NUMBER, (void *)1, "^[10]{1}$");

	threechan->parseCode=&threechanParseCode;
}
Example #2
0
void arctechSwInit(void) {

	protocol_register(&arctech_switch);
	protocol_set_id(arctech_switch, "arctech_switches");
	protocol_device_add(arctech_switch, "kaku_switch", "KlikAanKlikUit Switches");
	protocol_device_add(arctech_switch, "dio_switch", "D-IO Switches");
	protocol_device_add(arctech_switch, "nexa_switch", "Nexa Switches");
	protocol_device_add(arctech_switch, "coco_switch", "CoCo Technologies Switches");
	protocol_device_add(arctech_switch, "intertechno_switch", "Intertechno Switches");
	protocol_conflict_add(arctech_switch, "arctech_screens");
	protocol_conflict_add(arctech_switch, "arctech_contact");

	protocol_plslen_add(arctech_switch, 315);
	protocol_plslen_add(arctech_switch, 303);
	protocol_plslen_add(arctech_switch, 251);
	arctech_switch->devtype = SWITCH;
	arctech_switch->hwtype = RF433;
	arctech_switch->pulse = 5;
	arctech_switch->rawlen = 132;
	arctech_switch->lsb = 3;
	options_add(&arctech_switch->options, 't', "on", OPTION_NO_VALUE, CONFIG_STATE, JSON_STRING, NULL, NULL);
	options_add(&arctech_switch->options, 'f', "off", OPTION_NO_VALUE, CONFIG_STATE, JSON_STRING, NULL, NULL);
	options_add(&arctech_switch->options, 'u', "unit", OPTION_HAS_VALUE, CONFIG_ID, JSON_NUMBER, NULL, "^([0-9]{1}|[1][0-5])$");
	options_add(&arctech_switch->options, 'i', "id", OPTION_HAS_VALUE, CONFIG_ID, JSON_NUMBER, NULL, "^([0-9]{1,7}|[1-5][0-9]{7}|6([0-6][0-9]{6}|7(0[0-9]{5}|10([0-7][0-9]{3}|8([0-7][0-9]{2}|8([0-5][0-9]|6[0-3]))))))$");
	options_add(&arctech_switch->options, 'a', "all", OPTION_OPT_VALUE, CONFIG_OPTIONAL, JSON_NUMBER, NULL, NULL);

	options_add(&arctech_switch->options, 0, "gui-readonly", OPTION_HAS_VALUE, CONFIG_SETTING, JSON_NUMBER, (void *)0, "^[10]{1}$");

	arctech_switch->parseBinary=&arctechSwParseBinary;
	arctech_switch->createCode=&arctechSwCreateCode;
	arctech_switch->printHelp=&arctechSwPrintHelp;
}
Example #3
0
void arctechSwInit(void) {

	protocol_register(&arctech_switch);
	protocol_set_id(arctech_switch, "archtech_switches");
	protocol_device_add(arctech_switch, "kaku_switch", "KlikAanKlikUit Switches");
	protocol_device_add(arctech_switch, "dio_switch", "D-IO (Chacon) Switches");
	protocol_device_add(arctech_switch, "nexa_switch", "Nexa Switches");
	protocol_device_add(arctech_switch, "coco_switch", "CoCo Technologies Switches");
	protocol_device_add(arctech_switch, "intertechno_switch", "Intertechno Switches");
	protocol_conflict_add(arctech_switch, "archtech_screens");
	protocol_plslen_add(arctech_switch, 303);
	protocol_plslen_add(arctech_switch, 251);
	arctech_switch->devtype = SWITCH;
	arctech_switch->hwtype = RX433;
	arctech_switch->pulse = 5;
	arctech_switch->rawlen = 132;
	arctech_switch->lsb = 3;

	options_add(&arctech_switch->options, 'a', "all", no_value, 0, NULL);
	options_add(&arctech_switch->options, 't', "on", no_value, config_state, NULL);
	options_add(&arctech_switch->options, 'f', "off", no_value, config_state, NULL);
	options_add(&arctech_switch->options, 'u', "unit", has_value, config_id, "^([0-9]{1}|[1][0-5])$");
	options_add(&arctech_switch->options, 'i', "id", has_value, config_id, "^([0-9]{1,7}|[1-5][0-9]{7}|6([0-6][0-9]{6}|7(0[0-9]{5}|10([0-7][0-9]{3}|8([0-7][0-9]{2}|8([0-5][0-9]|6[0-3]))))))$");

	protocol_setting_add_string(arctech_switch, "states", "on,off");
	protocol_setting_add_number(arctech_switch, "readonly", 0);
	
	arctech_switch->parseBinary=&arctechSwParseBinary;
	arctech_switch->createCode=&arctechSwCreateCode;
	arctech_switch->printHelp=&arctechSwPrintHelp;
}
Example #4
0
void arctechSrOldInit(void) {

	protocol_register(&arctech_screen_old);
	protocol_set_id(arctech_screen_old, "arctech_screens_old");
	protocol_device_add(arctech_screen_old, "kaku_screen_old", "Old KlikAanKlikUit Screens");
	protocol_conflict_add(arctech_screen_old, "arctech_switches_old");	
	protocol_plslen_add(arctech_screen_old, 336);
	arctech_screen_old->devtype = SCREEN;
	arctech_screen_old->hwtype = RF433;
	arctech_screen_old->pulse = 3;
	arctech_screen_old->rawlen = 50;
	arctech_screen_old->binlen = 12;
	arctech_screen_old->lsb = 2;

	options_add(&arctech_screen_old->options, 't', "up", OPTION_NO_VALUE, CONFIG_STATE, JSON_STRING, NULL, NULL);
	options_add(&arctech_screen_old->options, 'f', "down", OPTION_NO_VALUE, CONFIG_STATE, JSON_STRING, NULL, NULL);
	options_add(&arctech_screen_old->options, 'u', "unit", OPTION_HAS_VALUE, CONFIG_ID, JSON_NUMBER, NULL, "^([0-9]{1}|[1][0-5])$");
	options_add(&arctech_screen_old->options, 'i', "id", OPTION_HAS_VALUE, CONFIG_ID, JSON_NUMBER, NULL, "^(3[012]?|[012][0-9]|[0-9]{1})$");

	options_add(&arctech_screen_old->options, 0, "gui-readonly", OPTION_HAS_VALUE, CONFIG_SETTING, JSON_NUMBER, (void *)0, "^[10]{1}$");
	
	arctech_screen_old->parseBinary=&arctechSrOldParseBinary;
	arctech_screen_old->createCode=&arctechSrOldCreateCode;
	arctech_screen_old->printHelp=&arctechSrOldPrintHelp;
}
Example #5
0
void clarusSwInit(void) {

	protocol_register(&clarus_switch);
	protocol_set_id(clarus_switch, "clarus_switch");	
	protocol_device_add(clarus_switch, "clarus_switch", "Clarus Switches");
	protocol_conflict_add(clarus_switch, "rev_switch");
	protocol_plslen_add(clarus_switch, 190);
	protocol_plslen_add(clarus_switch, 180);
	clarus_switch->devtype = SWITCH;
	clarus_switch->hwtype = RF433;
	clarus_switch->pulse = 3;
	clarus_switch->rawlen = 50;
	clarus_switch->binlen = 12;

	options_add(&clarus_switch->options, 't', "on", OPTION_NO_VALUE, CONFIG_STATE, JSON_STRING, NULL, NULL);
	options_add(&clarus_switch->options, 'f', "off", OPTION_NO_VALUE, CONFIG_STATE, JSON_STRING, NULL, NULL);
	options_add(&clarus_switch->options, 'u', "unit", OPTION_HAS_VALUE, CONFIG_ID, JSON_NUMBER, NULL, "^([0-9]|[1-5][0-9]|6[0-3])$");
	options_add(&clarus_switch->options, 'i', "id", OPTION_HAS_VALUE, CONFIG_ID, JSON_STRING, NULL, "^[ABCDEF](3[012]?|[012][0-9]|[0-9]{1})$");

	options_add(&clarus_switch->options, 0, "gui-readonly", OPTION_HAS_VALUE, CONFIG_SETTING, JSON_NUMBER, (void *)0, "^[10]{1}$");
	
	clarus_switch->parseCode=&clarusSwParseCode;
	clarus_switch->createCode=&clarusSwCreateCode;
	clarus_switch->printHelp=&clarusSwPrintHelp;
}
Example #6
0
void arctechDimInit(void) {

	protocol_register(&arctech_dimmer);
	protocol_set_id(arctech_dimmer, "arctech_dimmers");
	protocol_device_add(arctech_dimmer, "kaku_dimmer", "KlikAanKlikUit Dimmers");
	protocol_conflict_add(arctech_dimmer, "arctech_contact");
	protocol_plslen_add(arctech_dimmer, 300);
	arctech_dimmer->devtype = DIMMER;
	arctech_dimmer->hwtype = RF433;
	arctech_dimmer->pulse = 5;
	arctech_dimmer->rawlen = 148;
	arctech_dimmer->lsb = 3;

	options_add(&arctech_dimmer->options, 'd', "dimlevel", has_value, config_value, "^([0-9]{1}|[1][0-5])$");
	options_add(&arctech_dimmer->options, 'a', "all", no_value, 0, NULL);
	options_add(&arctech_dimmer->options, 'u', "unit", has_value, config_id, "^([0-9]{1}|[1][0-5])$");
	options_add(&arctech_dimmer->options, 'i', "id", has_value, config_id, "^([0-9]{1,7}|[1-5][0-9]{7}|6([0-6][0-9]{6}|7(0[0-9]{5}|10([0-7][0-9]{3}|8([0-7][0-9]{2}|8([0-5][0-9]|6[0-3]))))))$");
	options_add(&arctech_dimmer->options, 't', "on", no_value, config_state, NULL);
	options_add(&arctech_dimmer->options, 'f', "off", no_value, config_state, NULL);
	
	protocol_setting_add_number(arctech_dimmer, "min", 0);
	protocol_setting_add_number(arctech_dimmer, "max", 15);
	protocol_setting_add_string(arctech_dimmer, "states", "on,off");
	protocol_setting_add_number(arctech_dimmer, "readonly", 0);

	arctech_dimmer->parseBinary=&arctechDimParseBinary;
	arctech_dimmer->createCode=&arctechDimCreateCode;
	arctech_dimmer->printHelp=&arctechDimPrintHelp;
	arctech_dimmer->checkValues=&arctechDimCheckValues;
}
Example #7
0
void impulsInit(void) {

	protocol_register(&impuls);
	protocol_set_id(impuls, "impuls");
	protocol_device_add(impuls, "impuls", "Impuls Switches");
	protocol_device_add(impuls, "select-remote", "SelectRemote Switches");
	protocol_conflict_add(impuls, "rev_switch");
	protocol_plslen_add(impuls, 171);
	protocol_plslen_add(impuls, 141);
	protocol_plslen_add(impuls, 133);
	impuls->devtype = SWITCH;
	impuls->hwtype = RF433;
	impuls->pulse = 3;
	impuls->rawlen = 50;
	impuls->binlen = 12;

	options_add(&impuls->options, 's', "systemcode", has_value, config_id, "^(3[012]?|[012][0-9]|[0-9]{1})$");
	options_add(&impuls->options, 'u', "programcode", has_value, config_id, "^(3[012]?|[012][0-9]|[0-9]{1})$");
	options_add(&impuls->options, 't', "on", no_value, config_state, NULL);
	options_add(&impuls->options, 'f', "off", no_value, config_state, NULL);

	protocol_setting_add_string(impuls, "states", "on,off");
	protocol_setting_add_number(impuls, "readonly", 0);

	impuls->parseCode=&impulsParseCode;
	impuls->createCode=&impulsCreateCode;
	impuls->printHelp=&impulsPrintHelp;
}