Two Tasmota rules
Tasmota is an incredibly powerful alternative/open source firmware for the ever popular Espressif family of WiFi equipped microcontrollers. This does not need to be another post espousing it’s many awesome qualities, so just trust me on this; Tasmota is AWESOME.
Tasmota supports user configurable rules which are simple commands wired into various device triggers. In short; a device running Tasmota gains some autonomy to react to events without needing to report the event to, and wait for commands from, a remote server.