Control Energenie Mihome power sockets from HA?

I have Energenie Mihome power sockets which I’d like to control (pn/off) using a HA script. Can anyone tell me if/how I can set up the Energenie sockets as switches in HA?

You could use IFTTT or get one of the hats they sell for the Raspberry Pi.

There’s also the option to build a module with their API:
https://mihome4u.co.uk/docs/api-documentation

Thanks. I’ve been experimenting with the mihome API. I can get individual CURL commands to turn the switches on and off, but if I execute the on/off commands in a HA script it won’t run for some reason.
IFTTT wouldn’t really help me as I want to execute 3 commands:

  1. Turn off switch
  2. Wait 10 seconds
  3. Turn on switch.

Pretty sure you can still use automations with IFTTT commands?

Hmmm…I wonder if I’ll have the same trouble running automations with curl commands that I do with scripts (I’ve never investigated automations before). Could be worth a try…