Hi @bruderbell,
Have you looked at the Kasa drivers by @djgutheinz? Might also be worth posting on that thread.
Simon