I’ve tried both with and without the switch section and under switch the states I only see my 2 xiaomi zigbee switches, not the tuya/medion one. Also it is not showing in the default HA page.
Under Tuya, country code, I think you need to add something like
platform: smart_life
The platform should match whatever app you used to setup the device.
My plugs show up in the device list as switch.ReallyLongNumber
The really long number is the mac address or something like that, it matches what I see in router for my plugs.
BTW, in my router, the plugs showed up as esp’s, took me a little while to figure that out too.
EDIT: After you update the config.yaml and restart, you need to go to services and do a tuya.force.update then tuya.pull.devices
version 77.3 on a pi3b.
I remember when I first installed on an older version, maybe 74 or 75, I didn’t need to add the platform line and it showed up differently on the device list
I could be wrong here, but AFAIK, there are two ways to control Tuya like switches.
One is via the cloud and the tuya (or other) service. Here, you configure your device with the Tuya (or similar) app, and configure them to the cloud service. Home assistant will then use your login credentials to connect to the cloud service and control them via that cloud service. So, you communicate with the cloud service to turn on the switch, and it communicates with the switch.
Tuya seems to be a platform that other manufacturers can use to avoid developing their own firmware, phone app and back-end cloud service. For example, I bought my switches from CostCo in Canada from CESmartHome. They have their own app and service that looks like a clone of Tuya. However, I was able to get my switches talking to the Tuya app, so that is the integration I used. If you’re using a different app (eg Smart Life or Jinvoo Smart)m that is what you have to define with the platform parameter.
The other way, is by determining the IP, local_ley and device_id. If you can figure out the correct details, then you can communicate with the device directly, without going thru the cloud service.
The way I understand it, you can only use one way or the other.
Thanks @idbaker, your comment about using one or the other method was a help as I was mixing a bit of old and new methods together.
I finally succeeded in setting up the plug using the old tuya method.
Steps were:
Add the old tuya.py custom component to your custom_components/switch folder
Find the device Id and localkey, important here is that localkey changes each time you add the plug to an app
Add the switch using the below, host is IP address of the plug.
I have an amazon tuya/smart life based smart multi socket plug. I am on Home assistant 0.80.2 and was able to discover the multi socket after adding the tuya user/pw and platform into the configuration.
My problem right now is it doesnt reflect my switch states in the UI. Did anyone get the tuya switch states to reflect accurately?
Hi all,
Just getting started with Homeassistant on a Raspberry Pi. I’ve been able to link all my intelligent device except a Smart Heater branded “Thorben”, that use the Tuya Platform. The heather works perfectly with the Tuya App, Smart Life and even Goldair App, but I haven’t been able to add it in my Homessistant.
This is the code have been using and even though I don’t get any errors, the Heather is not visible the Home of mi Hassio. This is my configuration:
I even tried to install other unit of the same heather using the Goldair component but with this option I get the following some errors. Here is the code and the error I am getting:
the heater probably isn’t supported - the Tuya integrations (there are two that I am aware of) don’t support all the devices that the app supports (motion sensors for example)
Well I have a Tuya based heater as well and I got it running via the cloud service from Tuya. I do want to add it locally so if I get a chance to I’ll report back if I get it going.
What guide did you use to get the local key?
Hi Nikoraus69, what do you mean with “running via the cloud service from Tuya”. Do you mean using the Tuya Smart App?
What is the brand of your heater?
To get the local key, I downloaded an App called “SSL Capture” from Google Play. Then I started it and enrolled the device (Heater) on the Tuya App. Then I opened once again “SSL Capture” and local for the data captured from the Tuya App. In one of these captured data packed you can find the local key.
There are other methods described on this forum and GitHub, please let me know if you can get the local kay and if you can linked your heater to homeassistant?
It’s a Eurom heater which is a branded Tuya product.
If you can connect via the app you should be able to connect to it using the Tuya component in HA.
Thanks for the info about getting the local key. I will try it if my heater starts acting up again
Hi,
Sorry to hijack this subject. I have my tuya plugs showing in HA and I can control them through google home mini and also through automations, however, I am not able to switch them on/off from the frontend (the overview screen), which I used to do but not any more (they always revert to their previous state within a second). I removed the plugs and added them again, and also downgrade the HA version to 80.0, with no luck. Any suggestions?