I finally got my breadbord up again with an ESP and a C1101 and was able to fiddle arround with the code you provided, to make a ESPHOME version.
I slightly modified it, to add back the missing features it had against the original ESPEASY plugin.
Added:
- Timer countdown, when a timerfunction is called
- LastID, so you are able to see which control device issued the last command (Toilet, Kitchen, Bathroom etc… (max. 3 devices is implemented, but could easily be adjuster to more devices)