KNX: Support for DS18S20 Temperature sensor

This commit is contained in:
Adrian Scillato 2018-06-12 15:30:17 -03:00 committed by GitHub
commit 8fdaa258ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 23 additions and 4 deletions

View File

@ -1,4 +1,6 @@
/* 6.0.0a /* 6.0.0a
* KNX: Support for DS18S20 Temperature sensor
* KNX: Fixed Bug when doing reply of sensors values
* Add CRC to Settings making future upgrades more fail-safe * Add CRC to Settings making future upgrades more fail-safe
* Add support for uploading Sonoff Bridge firmware found in tools/fw_efm8bb1 folder build by Portisch using Web Gui File Upload (#2886) * Add support for uploading Sonoff Bridge firmware found in tools/fw_efm8bb1 folder build by Portisch using Web Gui File Upload (#2886)
* Add support for I2C temperature sensor LM75AD (#2909) * Add support for I2C temperature sensor LM75AD (#2909)
@ -17,10 +19,11 @@
where [slot] is any of the 5 slots on the KNX Menu and value is a number where [slot] is any of the 5 slots on the KNX Menu and value is a number
example: KnxTx_Val1 35 example: KnxTx_Val1 35
* Add Slots on the KNX Web Menu to select Group Addess to send data from console commands * Add Slots on the KNX Web Menu to select Group Addess to send data from console commands
* Add Events to trigger rules when received data from KNX * Add Events to trigger rules when a command is received from KNX
usage on rules as: event#KnxRx_Val[slot] usage on rules as: event#KnxRx_Cmnd[slot]
where [slot] is any of the 5 slots on the KNX Menu where [slot] is any of the 5 slots on the KNX Menu
example: rule on event#KnxRx_Val1 do VAR1 %value% endon example: rule on event#KnxRx_Cmnd1 do VAR1 %value% endon
(where %value% can be 0 or 1)
* Add Events to trigger rules when received read requests from KNX * Add Events to trigger rules when received read requests from KNX
usage on rules as: event#KnxRx_Req[slot] usage on rules as: event#KnxRx_Req[slot]
where [slot] is any of the 5 slots on the KNX Menu where [slot] is any of the 5 slots on the KNX Menu

View File

@ -462,6 +462,7 @@ void KNX_INIT()
if (GetUsedInModule(GPIO_DHT11, my_module.gp.io)) { device_param[KNX_TEMPERATURE-1].show = true; } if (GetUsedInModule(GPIO_DHT11, my_module.gp.io)) { device_param[KNX_TEMPERATURE-1].show = true; }
if (GetUsedInModule(GPIO_DHT22, my_module.gp.io)) { device_param[KNX_TEMPERATURE-1].show = true; } if (GetUsedInModule(GPIO_DHT22, my_module.gp.io)) { device_param[KNX_TEMPERATURE-1].show = true; }
if (GetUsedInModule(GPIO_SI7021, my_module.gp.io)) { device_param[KNX_TEMPERATURE-1].show = true; } if (GetUsedInModule(GPIO_SI7021, my_module.gp.io)) { device_param[KNX_TEMPERATURE-1].show = true; }
if (GetUsedInModule(GPIO_DSB, my_module.gp.io)) { device_param[KNX_TEMPERATURE-1].show = true; }
if (GetUsedInModule(GPIO_DHT11, my_module.gp.io)) { device_param[KNX_HUMIDITY-1].show = true; } if (GetUsedInModule(GPIO_DHT11, my_module.gp.io)) { device_param[KNX_HUMIDITY-1].show = true; }
if (GetUsedInModule(GPIO_DHT22, my_module.gp.io)) { device_param[KNX_HUMIDITY-1].show = true; } if (GetUsedInModule(GPIO_DHT22, my_module.gp.io)) { device_param[KNX_HUMIDITY-1].show = true; }
if (GetUsedInModule(GPIO_SI7021, my_module.gp.io)) { device_param[KNX_HUMIDITY-1].show = true; } if (GetUsedInModule(GPIO_SI7021, my_module.gp.io)) { device_param[KNX_HUMIDITY-1].show = true; }
@ -547,7 +548,7 @@ void KNX_CB_Action(message_t const &msg, void *arg)
{ {
if (!toggle_inhibit) { if (!toggle_inhibit) {
char command[25]; char command[25];
snprintf_P(command, sizeof(command), PSTR("event KNXRX_VAL%d=%d"), ((chan->type) - KNX_SLOT1 + 1 ), msg.data[0]); snprintf_P(command, sizeof(command), PSTR("event KNXRX_CMND%d=%d"), ((chan->type) - KNX_SLOT1 + 1 ), msg.data[0]);
ExecuteCommand(command, SRC_KNX); ExecuteCommand(command, SRC_KNX);
if (Settings.flag.knx_enable_enhancement) { if (Settings.flag.knx_enable_enhancement) {
toggle_inhibit = TOGGLE_INHIBIT_TIME; toggle_inhibit = TOGGLE_INHIBIT_TIME;

View File

@ -199,6 +199,11 @@ void Ds18b20Show(boolean json)
#ifdef USE_DOMOTICZ #ifdef USE_DOMOTICZ
if (0 == tele_period) DomoticzSensor(DZ_TEMP, temperature); if (0 == tele_period) DomoticzSensor(DZ_TEMP, temperature);
#endif // USE_DOMOTICZ #endif // USE_DOMOTICZ
#ifdef USE_KNX
if (0 == tele_period) {
KnxSensor(KNX_TEMPERATURE, t);
}
#endif // USE_KNX
#ifdef USE_WEBSERVER #ifdef USE_WEBSERVER
} else { } else {
snprintf_P(mqtt_data, sizeof(mqtt_data), HTTP_SNS_TEMP, mqtt_data, "DS18B20", temperature, TempUnit()); snprintf_P(mqtt_data, sizeof(mqtt_data), HTTP_SNS_TEMP, mqtt_data, "DS18B20", temperature, TempUnit());

View File

@ -385,6 +385,11 @@ void Ds18x20Show(boolean json)
domoticz_flag = false; domoticz_flag = false;
} }
#endif // USE_DOMOTICZ #endif // USE_DOMOTICZ
#ifdef USE_KNX
if ((0 == tele_period) && (0 == i)) {
KnxSensor(KNX_TEMPERATURE, t);
}
#endif // USE_KNX
#ifdef USE_WEBSERVER #ifdef USE_WEBSERVER
} else { } else {
snprintf_P(mqtt_data, sizeof(mqtt_data), HTTP_SNS_TEMP, mqtt_data, (1 == ds18x20_sensors) ? ds18x20_types : stemp, temperature, TempUnit()); snprintf_P(mqtt_data, sizeof(mqtt_data), HTTP_SNS_TEMP, mqtt_data, (1 == ds18x20_sensors) ? ds18x20_types : stemp, temperature, TempUnit());

View File

@ -192,6 +192,11 @@ void Ds18x20Show(boolean json)
DomoticzSensor(DZ_TEMP, temperature); DomoticzSensor(DZ_TEMP, temperature);
} }
#endif // USE_DOMOTICZ #endif // USE_DOMOTICZ
#ifdef USE_KNX
if ((0 == tele_period) && (1 == dsxflg)) {
KnxSensor(KNX_TEMPERATURE, t);
}
#endif // USE_KNX
#ifdef USE_WEBSERVER #ifdef USE_WEBSERVER
} else { } else {
snprintf_P(stemp, sizeof(stemp), PSTR("%s-%d"), ds18x20_types, i +1); snprintf_P(stemp, sizeof(stemp), PSTR("%s-%d"), ds18x20_types, i +1);