[ONOFF] Publish state at start and at a given frequency (#1427)
To update state of the controllers
This commit is contained in:
1 parent
51357191df
commit
23160ad8b4
2 files changed
+10
No files matched your search
@@ -174,4 +174,11 @@ void ActuatorTrigger() {
|
||||
pub(subjectGTWONOFFtoMQTT, ONOFFdata);
|
||||
}
|
||||
|
||||
void stateONOFFMeasures() {
|
||||
//Publish actuator state
|
||||
StaticJsonDocument<JSON_MSG_BUFFER> jsonBuffer;
|
||||
JsonObject ONOFFdata = jsonBuffer.to<JsonObject>();
|
||||
ONOFFdata["cmd"] = (int)digitalRead(ACTUATOR_ONOFF_GPIO);
|
||||
pub(subjectGTWONOFFtoMQTT, ONOFFdata);
|
||||
}
|
||||
#endif
|
||||
@@ -1499,6 +1499,9 @@ void loop() {
|
||||
stateMeasures();
|
||||
# ifdef ZgatewayBT
|
||||
stateBTMeasures(false);
|
||||
# endif
|
||||
# ifdef ZactuatorONOFF
|
||||
stateONOFFMeasures();
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user