diff -r b4bfed3684d0 -r e75ce5bbda73 bmsd/mqtt.c --- a/bmsd/mqtt.c Fri Jan 03 15:21:22 2020 +0100 +++ b/bmsd/mqtt.c Sun Jan 05 11:42:02 2020 +0100 @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (C) 2017-2019 + * Copyright (C) 2017-2020 * * Michiel Broek * @@ -103,7 +103,7 @@ topic = xstrcpy((char *)"mbv1.0/co2meters/#"); // Subscribe to co2meter messages. mosquitto_subscribe(mosq, NULL, topic, 0); free(topic); - topic = xstrcpy((char *)"ispindel/#"); // Subscribe to ispindel messages. + topic = xstrcpy((char *)"mbv1.0/ispindels/#"); // Subscribe to ispindel messages. mosquitto_subscribe(mosq, NULL, topic, 0); free(topic); topic = NULL; @@ -183,8 +183,9 @@ co2meter_log(message->topic, (char *)message->payload); return; } - if (strstr(message->topic, (char *)"ispindel")) { - ispindel_mqtt(message->topic, (char *)message->payload); + if (strstr(message->topic, (char *)"ispindels") && strstr(message->topic, (char *)"DBIRTH")) { + ispindel_birth_data(message->topic, (char *)message->payload); + return; } syslog(LOG_NOTICE, "MQTT: message callback %s :: %d", message->topic, message->payloadlen); } else {