hi guys…i’m a new member of this community so i m a bit inexperienced…so i installed home assistant on my raspberry pi 2 following the guide and finally i added xiaomi gateway…in my dashboard i can see my smart plug and my binary sensor switch…so i make an automation in this way to start the plug after ther press of the button
obviously doesn’t work…the click event of the button is not seen from home assistant and the plug stay off…but if i active the automation from the dashboard the plug start so i suppose that the problem is the switch…maybe is not compatible?..i guess is the model WXKG01LM
if i move the line the system in the home assistant home page says to me that there is an error in the configuration…i noted that in general neither a simple automation with a timer works…for example a i made this with the automation tool:
ok…i tried a lot of different automation and the only component that doesn’t work is the switch…i fear that the problem is the compatibility (it is strange because the system see it)…the switch it’s always off…i don’t know maybe is there some setting to change?
@faro92, just to clarify, is the Xiaomi switch you have the Zigbee version, or the WiFi version? If it is a WiFi switch, you will need to extract the token and save that into a configuration file for it to work correctly. You will also need to make sure you have the token for the hub, and have that stored in your configuration file.
If you can see it in HA already though, it’s likely it is a Zigbee switch. Have you allowed permissions in the MiHome app so you can control it with external devices?
You need to select the select the Gateway from the devices list, click the ‘3 dots’ on the top right, select about, tap the version info down the bottom until a new option called “Hub Info” pops up, select that option, click the left button of the popup (probably in Chinese) and enable the wireless communication protocol. This is also where the Gateway key is stored.
Ok male some clarifications…the gateway is correctly configured in configuration.yaml with also the key (i followed the guide)…then i didn’ add other things in configurazione.yaml…i have to add also the switch?..in the gui i can see the binary sensor switch but the register show me that it always off…i don’t know what versione i have i only know that the model is WXKG01LM
the switch is connected to the gateway and there is nothing in my router about it so i think that it has not its own ip…the log file show me that messages
2018-08-27 07:08:38 WARNING (MainThread) [homeassistant.components.http] You have been advised to set http.api_password.
2018-08-27 07:15:13 ERROR (MainThread) [frontend.js.latest.201808200] :0:0 Script error.
I have the same problem. My Xiaomi switch worked fine until last ha change. Only long press show a state change to on at HA. I checked it at my Home and switch works fine ( single, double and long_click). Also I tried to make automation with HA UI with any result. I have the same code like faro92 and I ajusted lines in my yaml file, but switch still not working…
I have the same code and doesn’t works. I’d wrote code like faro92 and doesn’t works. In the beginning my code worked fine but with last switch ha changes not works. Seems signal switch is too short to be recognized by HA. Only long press change switch state.
Finally i founded switch problem. Really problem is not on switch. Problem is Yi light bulb do not toggle with light toggle, you must change it by homeassistant toggle instructions…after this change automation with switch single click works fine again.