By default these plugs phone home and I'm not so fond of that sort of behaviour so with a bit of wire sniffing and the usual decompilation trick they can now be controlled locally using a script that can be found here: https://github.com/suborb/huafan-wifiswitch
I've not (yet) reversed the AP registration so you'll have to use the hfsmart app to get it signed onto your network. At that point you should be able to firewall it off and the app will continue to work okay.
But where's the fun in that?
So you'll need to create two dummy devices:
1. A switch
The on command should be:
Code: Select all
script:///home/domoticz/hfswitch.py --host 192.168.0.2 on
Code: Select all
script:///home/domoticz/hfswitch.py --host 192.168.0.2 off
2. An electric meter
Then you can set up a cronjob to periodically ask the switch the current power usage:
Code: Select all
/home/domoticz/hfswitch.py --domoticz_url http://localhost:8090 --domoticz_idx 848 --host 192.168.0.2 current