[ONOFF] Add overcurrent protection (#1426)

Add a function that switches OFF the actuator if the current measured is more than MAX_CURRENT_ACTUATOR
This commit is contained in:
Florian authored and GitHub committed 2023-01-26 19:51:12 -06:00
1 parent 8d2aacc358
commit 51357191df
4 files changed
+77 -18

No files matched your search

+13 -11
View File
@@ -692,6 +692,19 @@ void setup() {
Log.notice(F("OpenMQTTGateway Version: " OMG_VERSION CR));
# endif
/*
The 2 modules below are not connection dependent so start them before the connectivity functions
Note that the ONOFF module need to start after the RN8209 so that the overCurrent task is launched after the setup of the sensor
*/
# ifdef ZsensorRN8209
setupRN8209();
modules.add(ZsensorRN8209);
# endif
# ifdef ZactuatorONOFF
setupONOFF();
modules.add(ZactuatorONOFF);
# endif
String s = WiFi.macAddress();
# ifdef USE_MAC_AS_GATEWAY_NAME
sprintf(gateway_name, "%.2s%.2s%.2s%.2s%.2s%.2s",
@@ -757,10 +770,6 @@ void setup() {
delay(1500);
#ifdef ZactuatorONOFF
setupONOFF();
modules.add(ZactuatorONOFF);
#endif
#ifdef ZsensorBME280
setupZsensorBME280();
modules.add(ZsensorBME280);
@@ -898,10 +907,6 @@ void setup() {
# endif
# define ACTIVE_RECEIVER ACTIVE_RTL
#endif
#ifdef ZsensorRN8209
setupRN8209();
modules.add(ZsensorRN8209);
#endif
#if defined(ZgatewayRTL_433) || defined(ZgatewayRF) || defined(ZgatewayPilight) || defined(ZgatewayRF2)
# ifdef DEFAULT_RECEIVER // Allow defining of default receiver as a compiler directive
activeReceiver = DEFAULT_RECEIVER;
@@ -1587,9 +1592,6 @@ void loop() {
#ifdef ZactuatorFASTLED
FASTLEDLoop();
#endif
#ifdef ZactuatorONOFF
OverHeatingRelayOFF();
#endif
#ifdef ZactuatorPWM
PWMLoop();
#endif