Exemplo n.º 1
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;
}
Exemplo n.º 2
0
void dht22Init(void) {
	pthread_mutexattr_init(&dht22attr);
	pthread_mutexattr_settype(&dht22attr, PTHREAD_MUTEX_RECURSIVE);
	pthread_mutex_init(&dht22lock, &dht22attr);

	protocol_register(&dht22);
	protocol_set_id(dht22, "dht22");
	protocol_device_add(dht22, "dht22", "1-wire Temperature and Humidity Sensor");
	protocol_device_add(dht22, "am2302", "1-wire Temperature and Humidity Sensor");
	dht22->devtype = WEATHER;
	dht22->hwtype = SENSOR;

	options_add(&dht22->options, 't', "temperature", OPTION_HAS_VALUE, DEVICES_VALUE, JSON_NUMBER, NULL, "^[0-9]{1,3}$");
	options_add(&dht22->options, 'h', "humidity", OPTION_HAS_VALUE, DEVICES_VALUE, JSON_NUMBER, NULL, "^[0-9]{1,3}$");
	options_add(&dht22->options, 'g', "gpio", OPTION_HAS_VALUE, DEVICES_ID, JSON_NUMBER, NULL, "^([0-9]{1}|1[0-9]|20)$");

	// options_add(&dht22->options, 0, "decimals", OPTION_HAS_VALUE, DEVICES_SETTING, JSON_NUMBER, (void *)1, "[0-9]");
	options_add(&dht22->options, 0, "temperature-offset", OPTION_HAS_VALUE, DEVICES_SETTING, JSON_NUMBER, (void *)0, "[0-9]");
	options_add(&dht22->options, 0, "humidity-offset", OPTION_HAS_VALUE, DEVICES_SETTING, JSON_NUMBER, (void *)0, "[0-9]");
	options_add(&dht22->options, 0, "decimals", OPTION_HAS_VALUE, GUI_SETTING, JSON_NUMBER, (void *)1, "[0-9]");
	options_add(&dht22->options, 0, "show-temperature", OPTION_HAS_VALUE, GUI_SETTING, JSON_NUMBER, (void *)1, "^[10]{1}$");
	options_add(&dht22->options, 0, "show-humidity", OPTION_HAS_VALUE, GUI_SETTING, JSON_NUMBER, (void *)1, "^[10]{1}$");
	options_add(&dht22->options, 0, "poll-interval", OPTION_HAS_VALUE, DEVICES_SETTING, JSON_NUMBER, (void *)10, "[0-9]");

	dht22->initDev=&dht22InitDev;
	dht22->threadGC=&dht22ThreadGC;
}
Exemplo n.º 3
0
void arctechSrInit(void) {

	protocol_register(&arctech_screen);
	protocol_set_id(arctech_screen, "arctech_screen");
	protocol_device_add(arctech_screen, "kaku_screen", "KlikAanKlikUit Screens");
	protocol_device_add(arctech_screen, "dio_screen", "DI-O Screens");
	protocol_plslen_add(arctech_screen, 251);
	protocol_plslen_add(arctech_screen, 294);
	protocol_plslen_add(arctech_screen, 303);
	arctech_screen->devtype = SCREEN;
	arctech_screen->hwtype = RF433;
	arctech_screen->pulse = 5;
	arctech_screen->rawlen = 132;
	arctech_screen->lsb = 3;

	options_add(&arctech_screen->options, 't', "up", OPTION_NO_VALUE, DEVICES_STATE, JSON_STRING, NULL, NULL);
	options_add(&arctech_screen->options, 'f', "down", OPTION_NO_VALUE, DEVICES_STATE, JSON_STRING, NULL, NULL);
	options_add(&arctech_screen->options, 'u', "unit", OPTION_HAS_VALUE, DEVICES_ID, JSON_NUMBER, NULL, "^([0-9]{1}|[1][0-5])$");
	options_add(&arctech_screen->options, 'i', "id", OPTION_HAS_VALUE, DEVICES_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_screen->options, 'a', "all", OPTION_OPT_VALUE, DEVICES_OPTIONAL, JSON_NUMBER, NULL, NULL);

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

	arctech_screen->parseBinary=&arctechSrParseBinary;
	arctech_screen->createCode=&arctechSrCreateCode;
	arctech_screen->printHelp=&arctechSrPrintHelp;
}
Exemplo n.º 4
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_plslen_add(impuls, 133);
	impuls->devtype = SWITCH;
	impuls->hwtype = RX433;
	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;
}
Exemplo n.º 5
0
void rsl366Init(void) {

	protocol_register(&rsl366);
	protocol_set_id(rsl366, "rsl366");
	protocol_device_add(rsl366, "rsl366", "RSL366 Switches");
	protocol_device_add(rsl366, "promax", "Pro MAX Switches");
	rsl366->devtype = SWITCH;
	rsl366->hwtype = RF433;
	rsl366->minrawlen = RAW_LENGTH;
	rsl366->maxrawlen = RAW_LENGTH;
	rsl366->maxgaplen = MAX_PULSE_LENGTH*PULSE_DIV;
	rsl366->mingaplen = MIN_PULSE_LENGTH*PULSE_DIV;

	options_add(&rsl366->options, 's', "systemcode", OPTION_HAS_VALUE, DEVICES_ID, JSON_NUMBER, NULL, "^([1234]{1})$");
	options_add(&rsl366->options, 'u', "programcode", OPTION_HAS_VALUE, DEVICES_ID, JSON_NUMBER, NULL, "^([1234]{1})$");
	options_add(&rsl366->options, 't', "on", OPTION_NO_VALUE, DEVICES_STATE, JSON_STRING, NULL, NULL);
	options_add(&rsl366->options, 'f', "off", OPTION_NO_VALUE, DEVICES_STATE, JSON_STRING, NULL, NULL);

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

	rsl366->parseCode=&parseCode;
	rsl366->createCode=&createCode;
	rsl366->printHelp=&printHelp;
	rsl366->validate=&validate;
}
Exemplo n.º 6
0
void rc101Init(void) {

	protocol_register(&rc101);
	protocol_set_id(rc101, "rc101");
	protocol_device_add(rc101, "rc101", "rc101 Switches");
	protocol_device_add(rc101, "rc102", "rc102 Switches");
	protocol_plslen_add(rc101, 241);
	rc101->devtype = SWITCH;
	rc101->hwtype = RF433;
	rc101->pulse = 3;
	rc101->rawlen = 66;
	rc101->binlen = 16;

	options_add(&rc101->options, 'i', "id", OPTION_HAS_VALUE, DEVICES_ID, JSON_NUMBER, NULL, "^([0-4])$");
	options_add(&rc101->options, 'u', "unit", OPTION_HAS_VALUE, DEVICES_ID, JSON_NUMBER, NULL, "^([0-4])$");
	options_add(&rc101->options, 't', "on", OPTION_NO_VALUE, DEVICES_STATE, JSON_STRING, NULL, NULL);
	options_add(&rc101->options, 'f', "off", OPTION_NO_VALUE, DEVICES_STATE, JSON_STRING, NULL, NULL);
	options_add(&rc101->options, 'a', "all", OPTION_OPT_VALUE, DEVICES_OPTIONAL, JSON_NUMBER, NULL, NULL);

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

	rc101->parseCode=&rc101ParseCode;
	rc101->createCode=&rc101CreateCode;
	rc101->printHelp=&rc101PrintHelp;
}
Exemplo n.º 7
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;
}
Exemplo n.º 8
0
void tfaInit(void) {
	protocol_register(&tfa);
	protocol_set_id(tfa, "tfa");
	protocol_device_add(tfa, "tfa", "TFA weather stations");
	protocol_device_add(tfa, "conrad_weather", "Conrad Weather Stations");
	tfa->devtype = WEATHER;
	tfa->hwtype = RF433;
	tfa->maxgaplen = MAX_PULSE_LENGTH*PULSE_DIV;
	tfa->mingaplen = MIN_PULSE_LENGTH*PULSE_DIV;
	tfa->minrawlen = 86;
	tfa->maxrawlen = 86;

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

	// options_add(&tfa->options, 0, "decimals", OPTION_HAS_VALUE, DEVICES_SETTING, JSON_NUMBER, (void *)2, "[0-9]");
	options_add(&tfa->options, 0, "temperature-offset", OPTION_HAS_VALUE, DEVICES_SETTING, JSON_NUMBER, (void *)0, "[0-9]");
	options_add(&tfa->options, 0, "humidity-offset", OPTION_HAS_VALUE, DEVICES_SETTING, JSON_NUMBER, (void *)0, "[0-9]");
	options_add(&tfa->options, 0, "temperature-decimals", OPTION_HAS_VALUE, GUI_SETTING, JSON_NUMBER, (void *)2, "[0-9]");
	options_add(&tfa->options, 0, "humidity-decimals", OPTION_HAS_VALUE, GUI_SETTING, JSON_NUMBER, (void *)2, "[0-9]");
	options_add(&tfa->options, 0, "show-humidity", OPTION_HAS_VALUE, GUI_SETTING, JSON_NUMBER, (void *)1, "^[10]{1}$");
	options_add(&tfa->options, 0, "show-temperature", OPTION_HAS_VALUE, GUI_SETTING, JSON_NUMBER, (void *)1, "^[10]{1}$");
	options_add(&tfa->options, 0, "show-battery", OPTION_HAS_VALUE, GUI_SETTING, JSON_NUMBER, (void *)1, "^[10]{1}$");

	tfa->parseCode=&parseCode;
	tfa->checkValues=&checkValues;
	tfa->validate=&validate;
	tfa->gc=&gc;
}
Exemplo n.º 9
0
void elro800SwitchInit(void) {

	protocol_register(&elro_800_switch);
	protocol_set_id(elro_800_switch, "elro_800_switch");
	protocol_device_add(elro_800_switch, "elro_800_switch", "Elro 800 series Switches");
	protocol_device_add(elro_800_switch, "brennenstuhl", "Brennenstuhl Comfort");
	protocol_device_add(elro_800_switch, "maxitronic", "Maxi-Tronic FUNK-LIGHT switches");
	elro_800_switch->devtype = SWITCH;
	elro_800_switch->hwtype = RF433;
	elro_800_switch->minrawlen = RAW_LENGTH;
	elro_800_switch->maxrawlen = RAW_LENGTH;
	elro_800_switch->maxgaplen = MAX_PULSE_LENGTH*PULSE_DIV;
	elro_800_switch->mingaplen = MIN_PULSE_LENGTH*PULSE_DIV;

	options_add(&elro_800_switch->options, "s", "systemcode", OPTION_HAS_VALUE, DEVICES_ID, JSON_NUMBER, NULL, "^102[0-3]|10[01][0-9]|[0-9]{1,3}$");
	options_add(&elro_800_switch->options, "u", "unitcode", OPTION_HAS_VALUE, DEVICES_ID, JSON_NUMBER, NULL, "^(3[012]?|[012][0-9]|[0-9]{1})$");
	options_add(&elro_800_switch->options, "t", "on", OPTION_NO_VALUE, DEVICES_STATE, JSON_STRING, NULL, NULL);
	options_add(&elro_800_switch->options, "f", "off", OPTION_NO_VALUE, DEVICES_STATE, JSON_STRING, NULL, NULL);

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

	elro_800_switch->parseCode=&parseCode;
	elro_800_switch->createCode=&createCode;
	elro_800_switch->printHelp=&printHelp;
	elro_800_switch->validate=&validate;
}
Exemplo n.º 10
0
void arctechSwitchInit(void) {
	protocol_register(&arctech_switch);
	protocol_set_id(arctech_switch, "arctech_switch");
	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");
	arctech_switch->devtype = SWITCH;
	arctech_switch->hwtype = RF433;
	arctech_switch->txrpt = NORMAL_REPEATS;
	arctech_switch->minrawlen = RAW_LENGTH;
	arctech_switch->maxrawlen = RAW_LENGTH;
	arctech_switch->maxgaplen = MAX_PULSE_LENGTH*PULSE_DIV;
	arctech_switch->mingaplen = MIN_PULSE_LENGTH*PULSE_DIV;

	options_add(&arctech_switch->options, "t", "on", OPTION_NO_VALUE, DEVICES_STATE, JSON_STRING, NULL, NULL);
	options_add(&arctech_switch->options, "f", "off", OPTION_NO_VALUE, DEVICES_STATE, JSON_STRING, NULL, NULL);
	options_add(&arctech_switch->options, "u", "unit", OPTION_HAS_VALUE, DEVICES_ID, JSON_NUMBER, NULL, "^([0-9]{1}|[1][0-5])$");
	options_add(&arctech_switch->options, "i", "id", OPTION_HAS_VALUE, DEVICES_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, DEVICES_OPTIONAL, JSON_NUMBER, NULL, NULL);
	options_add(&arctech_switch->options, "l", "learn", OPTION_NO_VALUE, DEVICES_OPTIONAL, JSON_NUMBER, NULL, NULL);

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

	arctech_switch->parseCode=&parseCode;
	arctech_switch->createCode=&createCode;
	arctech_switch->printHelp=&printHelp;
	arctech_switch->validate=&validate;
}
Exemplo n.º 11
0
void beamishSwitchInit(void) {

	protocol_register(&beamish_switch);
	protocol_set_id(beamish_switch, "beamish_switch");
	protocol_device_add(beamish_switch, "beamish_switch", "beamish_switch Switches");
	beamish_switch->devtype = SWITCH;
	beamish_switch->hwtype = RF433;
	beamish_switch->txrpt = NORMAL_REPEATS;
	beamish_switch->minrawlen = RAW_LENGTH;
	beamish_switch->maxrawlen = RAW_LENGTH;
	beamish_switch->maxgaplen = MAX_PULSE_LENGTH*PULSE_DIV;
	beamish_switch->mingaplen = MIN_PULSE_LENGTH*PULSE_DIV;

	options_add(&beamish_switch->options, "t", "on", OPTION_NO_VALUE, DEVICES_STATE, JSON_STRING, NULL, NULL);
	options_add(&beamish_switch->options, "f", "off", OPTION_NO_VALUE, DEVICES_STATE, JSON_STRING, NULL, NULL);
	options_add(&beamish_switch->options, "u", "unit", OPTION_HAS_VALUE, DEVICES_ID, JSON_NUMBER, NULL, "^([1-4])$");
	options_add(&beamish_switch->options, "i", "id", OPTION_HAS_VALUE, DEVICES_ID, JSON_NUMBER, NULL, "^([0-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$");
	options_add(&beamish_switch->options, "a", "all", OPTION_NO_VALUE, 0, JSON_NUMBER, NULL, NULL);

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

	beamish_switch->parseCode=&parseCode;
	beamish_switch->createCode=&createCode;
	beamish_switch->printHelp=&printHelp;
	beamish_switch->validate=&validate;
}
Exemplo n.º 12
0
void ds18s20Init(void) {
	pthread_mutexattr_init(&attr);
	pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
	pthread_mutex_init(&lock, &attr);

	protocol_register(&ds18s20);
	protocol_set_id(ds18s20, "ds18s20");
	protocol_device_add(ds18s20, "ds18s20", "1-wire Temperature Sensor");
	ds18s20->devtype = WEATHER;
	ds18s20->hwtype = SENSOR;

	options_add(&ds18s20->options, 't', "temperature", OPTION_HAS_VALUE, DEVICES_VALUE, JSON_NUMBER, NULL, "^[0-9]{1,5}$");
	options_add(&ds18s20->options, 'i', "id", OPTION_HAS_VALUE, DEVICES_ID, JSON_STRING, NULL, "^[a-z0-9]{12}$");

	// options_add(&ds18s20->options, 0, "decimals", OPTION_HAS_VALUE, DEVICES_SETTING, JSON_NUMBER, (void *)3, "[0-9]");
	options_add(&ds18s20->options, 0, "temperature-offset", OPTION_HAS_VALUE, DEVICES_SETTING, JSON_NUMBER, (void *)0, "[0-9]");
	options_add(&ds18s20->options, 0, "temperature-decimals", OPTION_HAS_VALUE, GUI_SETTING, JSON_NUMBER, (void *)3, "[0-9]");
	options_add(&ds18s20->options, 0, "show-temperature", OPTION_HAS_VALUE, GUI_SETTING, JSON_NUMBER, (void *)1, "^[10]{1}$");
	options_add(&ds18s20->options, 0, "poll-interval", OPTION_HAS_VALUE, DEVICES_SETTING, JSON_NUMBER, (void *)10, "[0-9]");

	memset(source_path, '\0', 21);
	strcpy(source_path, "/sys/bus/w1/devices/");

	ds18s20->initDev=&initDev;
	ds18s20->threadGC=&theadGC;
}
Exemplo n.º 13
0
void arctechDimmerInit(void) {

	protocol_register(&arctech_dimmer);
	protocol_set_id(arctech_dimmer, "arctech_dimmer");
	protocol_device_add(arctech_dimmer, "kaku_dimmer", "KlikAanKlikUit Dimmers");
	arctech_dimmer->devtype = DIMMER;
	arctech_dimmer->hwtype = RF433;
	arctech_dimmer->txrpt = NORMAL_REPEATS;
	arctech_dimmer->minrawlen = RAW_LENGTH;
	arctech_dimmer->maxrawlen = RAW_LENGTH;
	arctech_dimmer->maxgaplen = MAX_PULSE_LENGTH*PULSE_DIV;
	arctech_dimmer->mingaplen = MIN_PULSE_LENGTH*PULSE_DIV;

	options_add(&arctech_dimmer->options, 'd', "dimlevel", OPTION_HAS_VALUE, DEVICES_VALUE, JSON_NUMBER, NULL, "^([0-9]{1}|[1][0-5])$");
	options_add(&arctech_dimmer->options, 'u', "unit", OPTION_HAS_VALUE, DEVICES_ID, JSON_NUMBER, NULL, "^([0-9]{1}|[1][0-5])$");
	options_add(&arctech_dimmer->options, 'i', "id", OPTION_HAS_VALUE, DEVICES_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_dimmer->options, 't', "on", OPTION_NO_VALUE, DEVICES_STATE, JSON_STRING, NULL, NULL);
	options_add(&arctech_dimmer->options, 'f', "off", OPTION_NO_VALUE, DEVICES_STATE, JSON_STRING, NULL, NULL);
	options_add(&arctech_dimmer->options, 'a', "all", OPTION_OPT_VALUE, DEVICES_OPTIONAL, JSON_NUMBER, NULL, NULL);
	options_add(&arctech_dimmer->options, 'l', "learn", OPTION_NO_VALUE, DEVICES_OPTIONAL, JSON_NUMBER, NULL, NULL);

	options_add(&arctech_dimmer->options, 0, "dimlevel-minimum", OPTION_HAS_VALUE, DEVICES_SETTING, JSON_NUMBER, (void *)0, "^([0-9]{1}|[1][0-5])$");
	options_add(&arctech_dimmer->options, 0, "dimlevel-maximum", OPTION_HAS_VALUE, DEVICES_SETTING, JSON_NUMBER, (void *)15, "^([0-9]{1}|[1][0-5])$");
	options_add(&arctech_dimmer->options, 0, "readonly", OPTION_HAS_VALUE, GUI_SETTING, JSON_NUMBER, (void *)0, "^[10]{1}$");
	options_add(&arctech_dimmer->options, 0, "confirm", OPTION_HAS_VALUE, GUI_SETTING, JSON_NUMBER, (void *)0, "^[10]{1}$");

	arctech_dimmer->parseCode=&parseCode;
	arctech_dimmer->createCode=&createCode;
	arctech_dimmer->printHelp=&printHelp;
	arctech_dimmer->checkValues=&checkValues;
	arctech_dimmer->validate=&validate;
}
Exemplo n.º 14
0
void quiggGT7000Init(void) {

	protocol_register(&quigg_gt7000);
	protocol_set_id(quigg_gt7000, "quigg_gt7000");
	protocol_device_add(quigg_gt7000, "quigg_gt7000", "Quigg GT-7000 Switches");
	protocol_plslen_add(quigg_gt7000, (int)PULSE_QUIGG_FOOTER/PULSE_DIV); // SHORT: GT-FSI-04a range: 620... 960
	quigg_gt7000->devtype = SWITCH;
	quigg_gt7000->hwtype = RF433;
	quigg_gt7000->pulse = 2;        // LONG=QUIGG_PULSE_HIGH*SHORT
	quigg_gt7000->lsb = 0;
	// 42 SHORT (>600)[0]; 20 times 0-(SHORT-LONG) or 1-(LONG-SHORT) [1-2 .. 39-40];
	// footer PULSE_DIV*SHORT (>6000) [41]
	quigg_gt7000->rawlen = 42;
	// 20 sys-id[0 .. 11]; unit[12,13], unit_all[14], on/off[15], dimm[16],
	// null[17], var[18]; Parity[19]
	quigg_gt7000->binlen = 20;

	options_add(&quigg_gt7000->options, 't', "on", OPTION_NO_VALUE, DEVICES_STATE, JSON_STRING, NULL, NULL);
	options_add(&quigg_gt7000->options, 'f', "off", OPTION_NO_VALUE, DEVICES_STATE, JSON_STRING, NULL, NULL);
	options_add(&quigg_gt7000->options, 'u', "unit", OPTION_HAS_VALUE, DEVICES_ID, JSON_NUMBER, NULL, "^([0-3])$");
	options_add(&quigg_gt7000->options, 'i', "id", OPTION_HAS_VALUE, DEVICES_ID, JSON_NUMBER, NULL, "^([1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-3][0-9][0-9][0-9]|40[0-8][0-9]|409[0-5])$");
	options_add(&quigg_gt7000->options, 'a', "all", OPTION_NO_VALUE, DEVICES_SETTING, JSON_NUMBER, NULL, NULL);

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

	quigg_gt7000->parseCode=&quiggGT7000ParseCode;
	quigg_gt7000->createCode=&quiggGT7000CreateCode;
	quigg_gt7000->printHelp=&quiggGT7000PrintHelp;
}
Exemplo n.º 15
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;
}
Exemplo n.º 16
0
void programInit(void) {

	protocol_register(&program);
	protocol_set_id(program, "program");
	protocol_device_add(program, "program", "Start / Stop / State of a program");
	program->devtype = PENDINGSW;
	program->hwtype = API;
	program->multipleId = 0;

	options_add(&program->options, 'n', "name", OPTION_HAS_VALUE, CONFIG_ID, JSON_STRING, NULL, NULL);
	options_add(&program->options, 'x', "start-command", OPTION_HAS_VALUE, CONFIG_VALUE, JSON_STRING, NULL, NULL);
	options_add(&program->options, 'y', "stop-command", OPTION_HAS_VALUE, CONFIG_VALUE, JSON_STRING, NULL, NULL);
	options_add(&program->options, 'p', "program", OPTION_HAS_VALUE, CONFIG_VALUE, JSON_STRING, NULL, NULL);
	options_add(&program->options, 'i', "pid", OPTION_HAS_VALUE, CONFIG_VALUE, JSON_NUMBER, NULL, NULL);
	options_add(&program->options, 'a', "arguments", OPTION_HAS_VALUE, CONFIG_VALUE, JSON_STRING, NULL, NULL);
	options_add(&program->options, 't', "running", OPTION_NO_VALUE, CONFIG_STATE, JSON_STRING, NULL, NULL);
	options_add(&program->options, 'd', "pending", OPTION_NO_VALUE, CONFIG_STATE, JSON_STRING, NULL, NULL);
	options_add(&program->options, 'f', "stopped", OPTION_NO_VALUE, CONFIG_STATE, JSON_STRING, NULL, NULL);

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

	program->createCode=&programCreateCode;
	program->printHelp=&programPrintHelp;
	program->initDev=&programInitDev;
	program->threadGC=&programThreadGC;
}
Exemplo n.º 17
0
void impulsInit(void) {

	protocol_register(&impuls);
	protocol_set_id(impuls, "impuls");
	protocol_device_add(impuls, "impuls", "Impuls Switches");
	impuls->devtype = SWITCH;
	impuls->hwtype = RF433;
	impuls->minrawlen = RAW_LENGTH;
	impuls->maxrawlen = RAW_LENGTH;
	impuls->maxgaplen = MAX_PULSE_LENGTH*PULSE_DIV;
	impuls->mingaplen = MIN_PULSE_LENGTH*PULSE_DIV;

	options_add(&impuls->options, 's', "systemcode", OPTION_HAS_VALUE, DEVICES_ID, JSON_NUMBER, NULL, "^(3[012]?|[012][0-9]|[0-9]{1})$");
	options_add(&impuls->options, 'u', "programcode", OPTION_HAS_VALUE, DEVICES_ID, JSON_NUMBER, NULL, "^(3[012]?|[012][0-9]|[0-9]{1})$");
	options_add(&impuls->options, 't', "on", OPTION_NO_VALUE, DEVICES_STATE, JSON_STRING, NULL, NULL);
	options_add(&impuls->options, 'f', "off", OPTION_NO_VALUE, DEVICES_STATE, JSON_STRING, NULL, NULL);

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

	impuls->parseCode=&parseCode;
	impuls->createCode=&createCode;
	impuls->printHelp=&printHelp;
	impuls->validate=&validate;
}
Exemplo n.º 18
0
void quiggGT7000Init(void) {

	protocol_register(&quigg_gt7000);
	protocol_set_id(quigg_gt7000, "quigg_gt7000");
	protocol_device_add(quigg_gt7000, "quigg_gt7000", "Quigg GT-7000 Switches");
	quigg_gt7000->devtype = SWITCH;
	quigg_gt7000->hwtype = RF433;
	quigg_gt7000->txrpt = NORMAL_REPEATS;			 // SHORT: GT-FSI-04a range: 620... 960
	quigg_gt7000->minrawlen = RAW_LENGTH;
	quigg_gt7000->maxrawlen = RAW_LENGTH;
	quigg_gt7000->maxgaplen = (int)(PULSE_QUIGG_FOOTER*0.9);
	quigg_gt7000->mingaplen = (int)(PULSE_QUIGG_FOOTER*1.1);

	options_add(&quigg_gt7000->options, "t", "on", OPTION_NO_VALUE, DEVICES_STATE, JSON_STRING, NULL, NULL);
	options_add(&quigg_gt7000->options, "f", "off", OPTION_NO_VALUE, DEVICES_STATE, JSON_STRING, NULL, NULL);
	options_add(&quigg_gt7000->options, "u", "unit", OPTION_HAS_VALUE, DEVICES_ID, JSON_NUMBER, NULL, "^([0-3])$");
	options_add(&quigg_gt7000->options, "i", "id", OPTION_HAS_VALUE, DEVICES_ID, JSON_NUMBER, NULL, "^([0-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-3][0-9][0-9][0-9]|40[0-8][0-9]|409[0-5])$");
	options_add(&quigg_gt7000->options, "a", "all", OPTION_NO_VALUE, DEVICES_OPTIONAL, JSON_NUMBER, NULL, NULL);
	options_add(&quigg_gt7000->options, "l", "learn", OPTION_HAS_VALUE, DEVICES_OPTIONAL, JSON_NUMBER, NULL, NULL);

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

	quigg_gt7000->parseCode=&parseCode;
	quigg_gt7000->createCode=&createCode;
	quigg_gt7000->printHelp=&printHelp;
	quigg_gt7000->validate=&validate;
}
Exemplo n.º 19
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;
}
Exemplo n.º 20
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;
}
Exemplo n.º 21
0
void homeEasyOldInit(void) {

	protocol_register(&home_easy_old);
	protocol_set_id(home_easy_old, "home_easy_old");
	protocol_device_add(home_easy_old, "home_easy_old", "Old Home Easy Switches");
	protocol_plslen_add(home_easy_old, 289);
	home_easy_old->devtype = SWITCH;
	home_easy_old->hwtype = RF433;
	home_easy_old->pulse = 3;
	home_easy_old->rawlen = 50;
	home_easy_old->binlen = 12;
	home_easy_old->lsb = 3;

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

	protocol_setting_add_string(home_easy_old, "states", "on,off");	
	protocol_setting_add_number(home_easy_old, "readonly", 0);
	
	home_easy_old->parseBinary=&homeEasyOldParseBinary;
	home_easy_old->createCode=&homeEasyOldCreateCode;
	home_easy_old->printHelp=&homeEasyOldPrintHelp;
}
Exemplo n.º 22
0
void arctechScreenOldInit(void) {

	protocol_register(&arctech_screen_old);
	protocol_set_id(arctech_screen_old, "arctech_screen_old");
	protocol_device_add(arctech_screen_old, "kaku_screen_old", "Old KlikAanKlikUit Screens");
	arctech_screen_old->devtype = SCREEN;
	arctech_screen_old->hwtype = RF433;
	arctech_screen_old->minrawlen = RAW_LENGTH;
	arctech_screen_old->maxrawlen = RAW_LENGTH;
	arctech_screen_old->maxgaplen = MAX_PULSE_LENGTH*PULSE_DIV;
	arctech_screen_old->mingaplen = MIN_PULSE_LENGTH*PULSE_DIV;

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

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

	arctech_screen_old->parseCode=&parseCode;
	arctech_screen_old->createCode=&createCode;
	arctech_screen_old->printHelp=&printHelp;
	arctech_screen_old->validate=&validate;
}
Exemplo n.º 23
0
void ninjablocksWeatherInit(void) {

	protocol_register(&ninjablocks_weather);
	protocol_set_id(ninjablocks_weather, "ninjablocks_weather");
	protocol_device_add(ninjablocks_weather, "ninjablocks_weather", "Ninjablocks Weather Sensors");
	ninjablocks_weather->devtype = WEATHER;
	ninjablocks_weather->hwtype = RF433;
	ninjablocks_weather->minrawlen = MIN_RAW_LENGTH;
	ninjablocks_weather->maxrawlen = MAX_RAW_LENGTH;
	ninjablocks_weather->mingaplen = MIN_PULSE_LENGTH*PULSE_DIV;
	ninjablocks_weather->maxgaplen = MAX_PULSE_LENGTH*PULSE_DIV;

	// sync-id[4]; Homecode[4], Channel Code[2], Sync[3], Humidity[7], Temperature[15], Footer [1]
	options_add(&ninjablocks_weather->options, 'u', "unit", OPTION_HAS_VALUE, DEVICES_ID, JSON_NUMBER, NULL, "^([0-9]|1[0-5])$");
	options_add(&ninjablocks_weather->options, 'i', "id", OPTION_HAS_VALUE, DEVICES_ID, JSON_NUMBER, NULL, "^([0-3])$");
	options_add(&ninjablocks_weather->options, 't', "temperature", OPTION_HAS_VALUE, DEVICES_VALUE, JSON_NUMBER, NULL, "^[0-9]{1,5}$");
	options_add(&ninjablocks_weather->options, 'h', "humidity", OPTION_HAS_VALUE, DEVICES_VALUE, JSON_NUMBER, NULL, "^[0-9]{1,5}$");

	// options_add(&ninjablocks_weather->options, 0, "decimals", OPTION_HAS_VALUE, DEVICES_SETTING, JSON_NUMBER, (void *)2, "[0-9]");
	options_add(&ninjablocks_weather->options, 0, "temperature-decimals", OPTION_HAS_VALUE, GUI_SETTING, JSON_NUMBER, (void *)2, "[0-9]");
	options_add(&ninjablocks_weather->options, 0, "humidity-decimals", OPTION_HAS_VALUE, GUI_SETTING, JSON_NUMBER, (void *)2, "[0-9]");
	options_add(&ninjablocks_weather->options, 0, "readonly", OPTION_HAS_VALUE, GUI_SETTING, JSON_NUMBER, (void *)0, "^[10]{1}$");
	options_add(&ninjablocks_weather->options, 0, "show-humidity", OPTION_HAS_VALUE, GUI_SETTING, JSON_NUMBER, (void *)1, "^[10]{1}$");
	options_add(&ninjablocks_weather->options, 0, "show-temperature", OPTION_HAS_VALUE, GUI_SETTING, JSON_NUMBER, (void *)1, "^[10]{1}$");

	ninjablocks_weather->parseCode=&parseCode;
	ninjablocks_weather->checkValues=&checkValues;
	ninjablocks_weather->validate=&validate;
	ninjablocks_weather->gc=&gc;
}
Exemplo n.º 24
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;
}
Exemplo n.º 25
0
void tfa30Init(void) {

	protocol_register(&tfa30);
	protocol_set_id(tfa30, "tfa30");
	protocol_device_add(tfa30, "tfa30", "TFA 30.X Temp Hum Sensor");
	tfa30->devtype = WEATHER;
	tfa30->hwtype = RF433;
	tfa30->minrawlen = MIN_RAW_LENGTH;
	tfa30->maxrawlen = MAX_RAW_LENGTH;
	tfa30->maxgaplen = MAX_PULSE_LENGTH*PULSE_DIV;
	tfa30->mingaplen = MIN_PULSE_LENGTH*PULSE_DIV;

	options_add(&tfa30->options, "t", "temperature", OPTION_HAS_VALUE, DEVICES_VALUE, JSON_NUMBER, NULL, "^[0-9]{1,3}$");
	options_add(&tfa30->options, "i", "id", OPTION_HAS_VALUE, DEVICES_ID, JSON_NUMBER, NULL, "[0-9]");
	options_add(&tfa30->options, "h", "humidity", OPTION_HAS_VALUE, DEVICES_VALUE, JSON_NUMBER, NULL, "^[0-9]{1,3}$");

	// options_add(&tfa30->options, "0", "decimals", OPTION_HAS_VALUE, DEVICES_SETTING, JSON_NUMBER, (void *)1, "[0-9]");
	options_add(&tfa30->options, "0", "temperature-decimals", OPTION_HAS_VALUE, GUI_SETTING, JSON_NUMBER, (void *)1, "[0-9]");
	options_add(&tfa30->options, "0", "humidity-decimals", OPTION_HAS_VALUE, GUI_SETTING, JSON_NUMBER, (void *)1, "[0-9]");
	options_add(&tfa30->options, "0", "humidity-offset", OPTION_HAS_VALUE, DEVICES_SETTING, JSON_NUMBER, (void *)0, "[0-9]");
	options_add(&tfa30->options, "0", "temperature-offset", OPTION_HAS_VALUE, DEVICES_SETTING, JSON_NUMBER, (void *)0, "[0-9]");
	options_add(&tfa30->options, "0", "show-humidity", OPTION_HAS_VALUE, GUI_SETTING, JSON_NUMBER, (void *)1, "^[10]{1}$");
	options_add(&tfa30->options, "0", "show-temperature", OPTION_HAS_VALUE, GUI_SETTING, JSON_NUMBER, (void *)1, "^[10]{1}$");


	tfa30->parseCode=&parseCode;
	tfa30->checkValues=&checkValues;
	tfa30->validate=&validate;
	tfa30->gc=&gc;
}
Exemplo n.º 26
0
Arquivo: raw.c Projeto: 1000io/pilight
void rawInit(void) {

	protocol_register(&raw);
	protocol_set_id(raw, "raw");
	protocol_device_add(raw, "raw", "Raw Codes");
	raw->devtype = RAW;

	options_add(&raw->options, 'c', "code", has_value, 0, NULL);

	raw->createCode=&rawCreateCode;
	raw->printHelp=&rawPrintHelp;
}
Exemplo n.º 27
0
void arctechSwOldInit(void) {

	protocol_register(&arctech_switch_old);
	protocol_set_id(arctech_switch_old, "arctech_switch_old");
	protocol_device_add(arctech_switch_old, "kaku_switch_old", "Old KlikAanKlikUit Switches");
	protocol_device_add(arctech_switch_old, "cogex", "Cogex Switches");
	protocol_device_add(arctech_switch_old, "intertechno_old", "Old Intertechno Switches");
	protocol_device_add(arctech_switch_old, "byebyestandbye", "Bye Bye Standbye Switches");
	protocol_device_add(arctech_switch_old, "duwi", "Düwi Terminal Switches");
	protocol_device_add(arctech_switch_old, "eurodomest", "Eurodomest Switches");
	protocol_plslen_add(arctech_switch_old, 336);
	protocol_plslen_add(arctech_switch_old, 326);
	protocol_plslen_add(arctech_switch_old, 390);
	protocol_plslen_add(arctech_switch_old, 400);
	protocol_plslen_add(arctech_switch_old, 330);

	arctech_switch_old->devtype = SWITCH;
	arctech_switch_old->hwtype = RF433;
	arctech_switch_old->pulse = 3;
	arctech_switch_old->rawlen = 50;
	arctech_switch_old->binlen = 12;
	arctech_switch_old->lsb = 2;

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

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

	arctech_switch_old->parseBinary=&arctechSwOldParseBinary;
	arctech_switch_old->createCode=&arctechSwOldCreateCode;
	arctech_switch_old->printHelp=&arctechSwOldPrintHelp;
}
Exemplo n.º 28
0
void rawInit(void) {

	protocol_register(&raw);
	protocol_set_id(raw, "raw");
	protocol_device_add(raw, "raw", "Raw Codes");
	raw->devtype = RAW;
	raw->config = 0;

	options_add(&raw->options, 'c', "code", OPTION_HAS_VALUE, 0, JSON_STRING, NULL, NULL);

	raw->createCode=&rawCreateCode;
	raw->printHelp=&rawPrintHelp;
}
Exemplo n.º 29
0
void arctechContactInit(void) {

	protocol_register(&arctech_contact);
	protocol_set_id(arctech_contact, "arctech_contact");
	protocol_device_add(arctech_contact, "kaku_contact", "KlikAanKlikUit Contact Sensor");
	protocol_device_add(arctech_contact, "dio_contact", "D-IO Contact Sensor");

	arctech_contact->devtype = CONTACT;
	arctech_contact->hwtype = RF433;
	arctech_contact->minrawlen = MIN_RAW_LENGTH;
	arctech_contact->maxrawlen = MAX_RAW_LENGTH;
	arctech_contact->maxgaplen = MAX_PULSE_LENGTH*PULSE_DIV;
	arctech_contact->mingaplen = MIN_PULSE_LENGTH*PULSE_DIV;

	options_add(&arctech_contact->options, "u", "unit", OPTION_HAS_VALUE, DEVICES_ID, JSON_NUMBER, NULL, "^([0-9]{1}|[1][0-5])$");
	options_add(&arctech_contact->options, "i", "id", OPTION_HAS_VALUE, DEVICES_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_contact->options, "t", "opened", OPTION_NO_VALUE, DEVICES_STATE, JSON_STRING, NULL, NULL);
	options_add(&arctech_contact->options, "f", "closed", OPTION_NO_VALUE, DEVICES_STATE, JSON_STRING, NULL, NULL);

	options_add(&arctech_contact->options, "a", "all", OPTION_HAS_VALUE, DEVICES_SETTING, JSON_NUMBER, (void *)0, "^[10]{1}$");

	arctech_contact->parseCode=&parseCode;
	arctech_contact->validate=&validate;
}
Exemplo n.º 30
0
void arctechContactInit(void) {

  protocol_register(&arctech_contact);
  protocol_set_id(arctech_contact, "arctech_contact");
  protocol_device_add(arctech_contact, "kaku_contact", "KlikAanKlikUit Contact Sensor");
  protocol_device_add(arctech_contact, "dio_contact", "D-IO (Chacon) Contact Sensor");
  protocol_plslen_add(arctech_contact, 294);

  arctech_contact->devtype = SWITCH;
  arctech_contact->hwtype = RF433;
  arctech_contact->pulse = 4;
  arctech_contact->rawlen = 148;
  arctech_contact->lsb = 3;

  options_add(&arctech_contact->options, 'u', "unit", OPTION_HAS_VALUE, CONFIG_ID, JSON_NUMBER, NULL, "^([0-9]{1}|[1][0-5])$");
  options_add(&arctech_contact->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_contact->options, 't', "opened", OPTION_NO_VALUE, CONFIG_STATE, JSON_STRING, NULL, NULL);
  options_add(&arctech_contact->options, 'f', "closed", OPTION_NO_VALUE, CONFIG_STATE, JSON_STRING, NULL, NULL);

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

  arctech_contact->parseBinary=&arctechContactParseBinary;
}