Dear Forum,
I got a smart plug with an energy meter. I flashed it with OpenBeken. Inside, there is 1 LED positioned behind the (only) button.
I can assign the pin of the LED to WifiLED. It then flashes at startup, but after the connection is established, it goes off and stays off.
I can assign it to LED with the same channel as the button and relay. It then reacts to the state of the relay (on/off).
Now, I want both functionalities for the LED.
So, at startup, it flashes indicating that it is trying to establish a WiFi connection, and after that has settled, the LED will follow the relay state. If the relay is on, then the LED will be on, and vice versa.
It would also be nice if the LED flashes in other cases, e.g., when an OTA is in progress or when the WiFi connection is down. Maybe even with different flash frequencies to distinguish between states.
I tried the following script, but nothing changed. The pin is assigned to LED, and it will follow the relay state.
Is there a simple way to achieve this dual functionality? Please help.
I got a smart plug with an energy meter. I flashed it with OpenBeken. Inside, there is 1 LED positioned behind the (only) button.
I can assign the pin of the LED to WifiLED. It then flashes at startup, but after the connection is established, it goes off and stays off.
I can assign it to LED with the same channel as the button and relay. It then reacts to the state of the relay (on/off).
Now, I want both functionalities for the LED.
So, at startup, it flashes indicating that it is trying to establish a WiFi connection, and after that has settled, the LED will follow the relay state. If the relay is on, then the LED will be on, and vice versa.
It would also be nice if the LED flashes in other cases, e.g., when an OTA is in progress or when the WiFi connection is down. Maybe even with different flash frequencies to distinguish between states.
I tried the following script, but nothing changed. The pin is assigned to LED, and it will follow the relay state.
/LedScript.bat
// 3 November 2023
//
// Sets pin 10 to WifiLED_n
// after WIFI connection
// change it to LED_n
// and connect to channel 1
// (Relay and Button)
setPinRole 10 WifiLED_n
waitFor WiFiState 4
setPinRole 10 LED_n
setPinChannel 10 1
Is there a simple way to achieve this dual functionality? Please help.