Treatlife Smart Ceiling Fan and Light Dimmer Switch

Following. I didn’t think to look up integration either & I just got it installed. :expressionless:

I’m interested in the entities config as well. I don’t get it & the LocalTuya docuementation doesn’t relate what each value is? I get the Tuya IOT portal & those settings, but I don’t necessarily understand the correlation between that & the LocalTuya entity config. I tried following your example of the ID: 1 = fan, ID: 9 = light, but what’s the correct entity to pick from the beginning? I selected switch kinda mapping it to IOT debugging.

I guess I could debug the values sent via the debugging . . . ?

Ok, debugging the api call doesn’t provide any more insight:

image

Update:

After some repeated configure/deleting the localTuya integration with this Treatlife, I was able to determine what each of the main IDs are . . . except I just get an on/off switch for the brightness or speed? I can’t configure 2 switches, the second I try to do so, it just says “successfully added”.


I’m also not sure what the 3 digit IDs are.

As for the entity types, if I set select “fan”, I set the ID = 1, Fan Speed Control = 3, I still only get a single entity as an on/off switch. How do I control the speed? If I set both to ID/FSC to 3, I still get a switch.

Same thing for trying to set light entities. I’ve tried ID = 1, Brightness = 10 & ID = 10 & Brightness = 10. I get 1 entity if I do light/fan & I don’t see any changes reflected in the Tuya Smart app or Tuya IOT debug portal.

See? I just get a single entity with on/off capabilities? Are ya’ll getting the ability to select the speed/brightness? (I tried to see what ID 105 does as a switch, but it starts on & just turns back on after turning off)

image

Any feedback would be appreciated!

2 Likes

Did you get any further?

I have not. Might have even regressed some because after a few more times, I was only able to get 1 entity no matter which way I tried setting it up.

I have a better one for you, i couldn’t turn off the fan after trying. I finally did by changing the speed.

1 Like

Ok, I think I know your issue. You got everything right, only annoying part is that there are 4 speeds (still haven’t figured what to do for that) but the issue is that you need to add a few special cards to add it to an entity. I suggest the slider-entity-row, use HACS and search in the front end for it.

image

all you need to do is follow the info and use the code editor.

1 Like

So add it as {Light: {ID: 9,Brightness: 10}}? and for the {Fan: {ID: 1, Speed: 3}}?

Same! Also 5.

But watch out guys. Now the treatlife ones have the non Tuya chip so you can’t flash them. Buy the esmlf ones instead. Still shipping with the TuyaMCU!

I think it is crazy to flash them, at that point isnt there a shelly that can do the job.

Really? I love shellies I have 18 of them in my walls (1, 1P, 2.5, Dim2)

But as far as I know you can’t speed control a fan with a shelly.

Yea, I’d love for this to work. I bought a 2 pack before realizing of my 5-6 ceiling fan drops, only 1 really has cabling for light AND fan.

@LAYGO this integration was not that hard after a bit of reading.

Use the LocalTuya plugin. You can install yourself from their GitHub (custom_components) or you can install using HACS (easy).

Once installed, you will need to make sure you have a Tuya cloud account. I would assume you would, as you would have already done that to link Tuya to HA. Once completed, follow the steps below:

  1. You will need your API key from Tuya and secret key. (Cloud >> Development >> Overview)
  2. You will need local keys from your device(s). (use NPM package “tuya-cli”)
sudo npm i @tuyapi/cli -g

then you will want to access the script.

tuya-cli wizard

You will need to input your API/Secret combination. Then, it will ask you for a virtual ID. This was is confusing, but you will want to input one of your device ID’s (found in the Devices section of the Tuya Cloud). Once completed, it will print a list of device keys and their local keys.

Navigate to HA >> Integrations, LocalTuya.

Find the device by ID (if on your network). Enter information required and profit. Switch 9 is the light portion. Switch 1 is the fan, if I remember correctly.

Good luck!

Go back a lil further into the history of this thread. I already have all that setup, but the integration isn’t working for me.

@LAYGO I missed that. Switch entity didn’t work for me. I had to use “light” as the entity type and then I was able to control the switch.

2 Likes

Well. I’m new to HA and doing well getting everything in my home configured within Home Assistant and creating all kinds of cool automations. But it looks like this Treatlife Ceiling Fan and Light Dimmer Switch is not being so nice!

I’ve read through this post, and I must say it’s quite confusing. All kinds of recommendations and all kinds of methods, but it seems that no one has gotten it all to work yet, no matter the method.

I have mine integrated into the “TreatLife” app on my Android phone currently. I was able to integrate that into SmartThings on my phone, but as others mentioned it only added a Fan on/off and a Light on/off devices. So I didn’t even bother integrating SmartThings into HA.

Not interested in flashing firmware either.

What’s the definitive guide, if there is one?!

Thanks!

2 Likes

For what it’s worth, I had set up LocalTuya with partial success, but I still wasn’t completely happy with the available controls. But I just updated HA to 2022.2.2 and the fan/light dimmer control works much better now with the standard Tuya integration! It now recognizes a light entity and a fan entity, as expected. I’m using the Slider Button Card via HACS, and I haven’t gotten it configured exactly the way I want yet, but it’s getting close.

Just a small mention in the 2022.2 release notes about Fans:

  • Tuya now supports Pet Feeders (thanks @vauriga), Circuit Breakers (thanks @slydiman), and Alarms (thanks @leeyuentuen). Additionally, support for Fans has been improved.
2 Likes

Well that’s great to hear and sounds promising.

The standard Tuya integration prerequisites require the device to be added to the Tuya Smart or Smart Life app. I have downloaded the Smart Life app but it does not find my device. I am thinking this is because I have already configured the device using the “Treatlife” app…

Do you think that is my problem and I need to perform a factory reset of this device, and then use the “Smart Life” app to set it up, so then I can end up using the Tuya integration?

I haven’t tried the Treatlife app because I’ve been using the Smart Life app since before I bought my first Treatlife device, and I bought this particular device in part because it’s Tuya-compatible. I believe you’re correct that each Tuya device can only be paired with one instance of an app at a time.

Especially if you have multiple Tuya-compatible devices, I’d recommend consolidating to either the Tuya app or the Smart Life app. And then yes, you’d have to reset your switch, but it’s not hard to do, I think you just hold down the light button for 5 seconds and then start the pairing process again. I’ve done it on other switches when I wanted to change which wi-fi network they connect to.

1 Like

FWIW, I couldn’t get LocalTuya working anymore. I would only ever get 1 entity & not able to control brightness or speeds. I tried the Tuya integration & it’s working. :man_shrugging:

1 Like

Finally got back to this. Originally I used the Treatlife app with this switch, so I couldn’t add it to HA via the Tuya Integration. I factory reset the switch and then added it to the Tuya Smart app. (FYI to factory reset, hold the light switch for 5 seconds. The WiFi light within the light switch will begin flashing quickly. Hold the light switch again for 5 seconds. The WiFi light within the light switch will begin flashing slowly, indicating pairing mode is ready).

Went through all the instructions to setup the Tuya Integration, which were great. In the end, my fan/light switch device was successfully added to HA. However, just like so many have mentioned here, I only have two entities, as shown here:

image

When I activate the fan toggle, it sets it to Level 1 in the Tuya Smart app, and the fans speed at that level (very, very slowly). Any ideas on how to get all 4 levels?

@LAYGO , when you say “it’s working”, are you able to control the 4 speeds of the fan? If so, how does yours look as compared to mine?

Thanks,

1 Like