I'm making a graduation project where I need to connect a smart plug to a web server through WAN (obviously the smart plug and the server aren't on the same network).
In other words, I want to be able to turn the smart plug on/off through my website and have the smart plug send power readings to my server's API.
Most smart plugs out there connect to their manufacturer's API. I want to buy a smart plug that I can configure/program to connect to my own API.
Are there any smart plugs out there that support that?
I would appreciate any more suggestions or information because I'm kinda lost.
EDIT: I did an extensive google searching, most methods out there :
reverse engineering the API between the android app and the manufacturer's server and calling the manufacturer's server to control the smart plug, or using IFFT which also calls the manufacturer's server.
Creating a script on the local network that receives commands from WAN and sends commands to the smartplug through it's LAN API , but obviously this is not what I need as it requires that you run the script on a device (raspberry pie) 24 hours.
There are also upnp and port forwarding methods that allow you to use the local network API on WAN but that's also not an option for security reasons.
I need a smart plug that has power monitoring capabilities that I can make it connect to my own server.
- I read about flashing a custom firmware (tasmota) on a smartplug (sonoff) to make it connect to an MQTT broker on WAN. I think this satisfies what I need, I can install an MQTT brocker on my server and make the smartplug connect to it, but this method is kinda hacky and I don't wanna risk. I also don't know if it supports power monitoring or not.
there's a smart plug called MOKO SMART MK112 that supports MQTT and power monitoring out of the box, but the problem is that I couldn't get it from china due to COVID19.
If you know any good resources to do that or any smartplug that supports MQTT as well as power monitoring I or any other suggestions would really appreciate it.