I finally got around to write the Tenda Beli plug integration. The integration implements the procedure described by this article (using “rendezvous” and “provisioning” servers running locally by Home Assistant).
One switch (tbp_switch_xxxx) and two sensor entities (tbp_power_xxxx and tbp_energy_xxxx) are created when plug is succesfully recognized by connecting to provisioning server. (xxxx are last 4 digits of the serial number)
To “install” the integration you need to
- download this code
- copy the folder named
tendabeli
to thehomeassistant/custom_components
folder - add the line bellow in configuration.yaml.
tendabeli:
- Then reboot the home assistant.
Before use, the plug must be configured:
- reset the plug by long pressing the on/off button until the orange LED lights up
- a plug Wi-Fi AP like Tenda_Smart_Plug_XXXX should appear, connect to it
- make a text file and provide credentials for Wi-Fi connection and ip address (if static) or the hostname of the device on which home assistant is running, hostname can´t be used for IPv6:
{"account":"1","ssid":"your_ap_ssid","key":"your_ap_passwd","server":"ipaddress_or_hostname_of_your_hass","location":"Europe/Prague","time_zone":0}
- using command line (Windows) send:
curl -d @"link_to_txt_file" http://192.168.25.1:5000/guideDone
or using powershell cmd
curl http://192.168.25.1:5000/guideDone -Method Post -Body '{"account":"1","ssid":"your_ap_ssid","key":"your_ap_passwd","server":"ipaddress_or_hostname_of_your_hass","location":"Europe/Prague","time_zone":0}'
This integration is not fully finished and has been tested with SP9 plugs only . There are easier solutions for SP3, but this should work as well.