I have a bunch of smart plugs that worked great with esphome. However I cannot find a way to get Alexa to switch on/off these smart plugs. What do I have to do please?
There is no direct code in Esphome to enable it with alexa devices but you can use emulated hue integration of HA to control esphome devices. Please check this.
Thanks for that. This Emulated Hue is for hue lights it seems?
I am seeking for ways to control my smart sockets (most of which are the ESP8266 devices which I flashed with the ESPHome firmware) that I then added to the esphome.
Will Emulated hue work with these devices?
yes, it works with all domains not just lights. you have plenty of settings to adjust.
Thanks mate. I read the documentation that you linked to and edited configuration.yaml to include these lines.
emulated_hue:
type: alexa
host_ip: 192.168.1.111
listen_port: 8300
expose_by_default: false
exposed_domains:
- light
- switch
- group
entities:
switch.mirabella_genio_smart_plug_2:
name: "Apple TV"
Then I restarted home-assistant and go to alexa.amazon.com → Smart Home → Devices → discover
but it is not listing any of my esphome devices. What do I need to do please?
Please try this.
emulated_hue:
host_ip: 192.168.1.111
listen_port: 80
expose_by_default: false
entities:
switch.mirabella_genio_smart_plug_2:
name: "Apple TV"
hidden: false
Thanks. Unfortunately setting the listen port to 80 is not working.
When I troubleshoot using http://192.168.1.111:80/description.xml I get a 404 Error not found. I guess this may have to do with the fact that my home assistant is in a docker container running on the Synology NAS.
If I set the listen port to 8300, http://192.168.1.111:8300/description.xml gives me the following:
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<root xmlns="urn:schemas-upnp-org:device-1-0">
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<URLBase>http://192.168.1.111:8300/</URLBase>
<device>
<deviceType>urn:schemas-upnp-org:device:Basic:1</deviceType>
<friendlyName>Home Assistant Bridge (192.168.1.111)</friendlyName>
<manufacturer>Royal Philips Electronics</manufacturer>
<manufacturerURL>http://www.philips.com</manufacturerURL>
<modelDescription>Philips hue Personal Wireless Lighting</modelDescription>
<modelName>Philips hue bridge 2015</modelName>
<modelNumber>BSB002</modelNumber>
<modelURL>http://www.meethue.com</modelURL>
<serialNumber>001788FFFE23BFC2</serialNumber>
<UDN>uuid:2f402f80-da50-11e1-9b23-001788255acc</UDN>
</device>
</root>
But if I do http://192.168.1.111:8300/api/pi/lights, it gives me just the following:
{}
How do I get this wokring?
Have you tried tasmota? The advantage of tasmota is that it has a build in hue emulation which can be used to integrate with alexa. Being inbuild, it is independent from HA and thus will work even if HA goes offline. It would be a better option.
Thanks mate. I just try to flash tasmota onto the esphome device and it says
Update Failed: ERROR[4]: Not Enough Space
Essentially what i did is to login to the web interface of the smart plug, under OTA update - select the tasmota binary and press update.
Any ideas?
Just tried the minimal firmware as per your suggestion. The error still pops up. Is there something I ought to first change in esphome config ?
Ok first make a very simple esphome configuration with just the baisc systems such as wifi, ota upload and web server. You can even remove logger component. Then upload this to the switch. After it boots up go to the web UI and upload tasmota minimal.
Make sure that you take a copy of the present esphome config.
Thanks for the suggestion. I just did a power cycle (remove the smart plug from socket and plug it in again) and now flashing the device with the minimal firmware works.
But how do i get to the tasmota interface on the smart plug? do I use the same 192.168.3.132 as my original esphome IP address? I tried that and it ask for username and password and i tried a bunch of them and i cant get in.
Any thoughts?
Since you have flashed a new device, after reboot we may have to configurate the wifi network. For this first we have to connect to the wifi hotspot of the device. Please check if the device is producing a wifi hotspot. Connect to it and then select wifi network and password. check the router for the ip of the device and just visit that ip.
Sometimes since we already had the esphome, the tasmota could take that wifi config, in that case there wont be any wifi hotspots and you can find the ip of the device form the router.
Makes sure that you update the system to full after you connect to the device UI.
Thanks mate. This is what I did.
I reboot the device, sign in to the device using the same IP address (in my case 192.168.3.132), then use the same username/password that i have had previously and i managed to get to the tasmota page that has says “MINIMAL firmware please ugrade”. I updated to the full firmware and the device restarted automatically.
When it restarted, I was greeted with the full tasmota firmware interface. I went to configuration and under Emulation, I select Hue Bridge multi device - save and reboot the device.
but when i go to alexa.amazon.com I am still not seeing the device.
Am I missing a step somewhere?
Till this what you have done is absolutely right.
Next thing you have to do is ask alexa to discover new devices. It will then discover this device and you can then see the devices in alexa app under devices tab.
Yes on alexa.amazon.au webpage, I press the discover button and it still did not discover this device.
On home-assistant itself though, I am able to add a tasmota device to home-assistant and everything works.
It is only Alexa that I am having trouble with.
Any ideas?
Do you have any amazon alexa echo devices connected to the same network?
Yep. I have the Tplink smartplugs added in home-assistant and also this shows up in Alexa devices. Also all my philips hue lights are also shown up in home-assistant and in Alexa.
It was just this particular ESP8266 smartplugs that does not work
Do you have any amazon echo or echo dot or echo show or any such devices in the network?