diff --git a/code/espurna/main.cpp b/code/espurna/main.cpp index 3c804351..6138f6c4 100644 --- a/code/espurna/main.cpp +++ b/code/espurna/main.cpp @@ -192,6 +192,10 @@ void setup() { #if LIGHT_PROVIDER != LIGHT_PROVIDER_NONE lightSetup(); #endif + // rpnSetup must be called before relaySetup + #if RPN_RULES_SUPPORT + rpnSetup(); + #endif #if RELAY_SUPPORT relaySetup(); #endif @@ -262,9 +266,6 @@ void setup() { #if SCHEDULER_SUPPORT schSetup(); #endif - #if RPN_RULES_SUPPORT - rpnSetup(); - #endif #if UART_MQTT_SUPPORT uartmqttSetup(); #endif