We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
需要增加 unique_id 到mqtt发现。
源码src/dc1.cpp
大概在180行左右的位置,参照下面改吧
sprintf(topic, PSTR("%s/switch/%s_%d/config"), globalConfig.mqtt.discovery_prefix, UID, (ch + 1)); if (isEnable) { cmndTopic[strlen(cmndTopic) - 1] = ch + 49; // 48 + 1 + ch powerStatTopic[strlen(powerStatTopic) - 1] = ch + 49; // 48 + 1 + ch sprintf(message, PSTR("{\"name\":\"%s_%d\"," "\"cmd_t\":\"%s\"," "\"stat_t\":\"%s\"," "\"pl_off\":\"off\"," "\"pl_on\":\"on\"," "\"avty_t\":\"%s\"," "\"pl_avail\":\"online\"," "\"unique_id\":\"%s_%d\"," "\"pl_not_avail\":\"offline\"}"), UID, (ch), cmndTopic, powerStatTopic, availability.c_str(), UID, (ch)); Mqtt::publish(topic, message, true); //Debug::AddInfo(PSTR("discovery: %s - %s"), topic, message); } else { Mqtt::publish(topic, "", true); } }
have fun
The text was updated successfully, but these errors were encountered:
还有ch被我改了。 开关0是总开,依次1-2-3,更直观。
Sorry, something went wrong.
这个改哪里可以实现?
No branches or pull requests
需要增加 unique_id 到mqtt发现。
源码src/dc1.cpp
大概在180行左右的位置,参照下面改吧
have fun
The text was updated successfully, but these errors were encountered: