|
@ -718,7 +718,7 @@ void relayMQTT(unsigned char id) { |
|
|
// Send state topic
|
|
|
// Send state topic
|
|
|
if (_relays[id].report) { |
|
|
if (_relays[id].report) { |
|
|
_relays[id].report = false; |
|
|
_relays[id].report = false; |
|
|
mqttSend(MQTT_TOPIC_RELAY, id, _relays[id].current_status ? "1" : "0"); |
|
|
|
|
|
|
|
|
mqttSend(MQTT_TOPIC_RELAY, id, _relays[id].current_status ? RELAY_MQTT_ON : RELAY_MQTT_OFF); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Check group topic
|
|
|
// Check group topic
|
|
@ -728,7 +728,7 @@ void relayMQTT(unsigned char id) { |
|
|
if (t.length() > 0) { |
|
|
if (t.length() > 0) { |
|
|
bool status = relayStatus(id); |
|
|
bool status = relayStatus(id); |
|
|
if (getSetting("mqttGroupInv", id, 0).toInt() == 1) status = !status; |
|
|
if (getSetting("mqttGroupInv", id, 0).toInt() == 1) status = !status; |
|
|
mqttSendRaw(t.c_str(), status ? "1" : "0"); |
|
|
|
|
|
|
|
|
mqttSendRaw(t.c_str(), status ? RELAY_MQTT_ON : RELAY_MQTT_OFF); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -743,7 +743,7 @@ void relayMQTT(unsigned char id) { |
|
|
|
|
|
|
|
|
void relayMQTT() { |
|
|
void relayMQTT() { |
|
|
for (unsigned int id=0; id < _relays.size(); id++) { |
|
|
for (unsigned int id=0; id < _relays.size(); id++) { |
|
|
mqttSend(MQTT_TOPIC_RELAY, id, _relays[id].current_status ? "1" : "0"); |
|
|
|
|
|
|
|
|
mqttSend(MQTT_TOPIC_RELAY, id, _relays[id].current_status ? RELAY_MQTT_ON : RELAY_MQTT_OFF); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|