Component is named TuyaLocal to allow usage of built-in Tuya component as well.
You will need to put tuyalocal.py and pytuya.py in custom_components and then also put switch\tuyalocal.py and light\tuyalocal.py in the corresponding subfolders.
If you just want ON\OFF control, the version you’re already using should be enough. You only need mine if you want control over the mist mode (intermittent\continuous).
Keep in mind though that I only plan to maintain my hacks as needed for my environment - i.e. I don’t intent to merge any fixes made to the “official” custom component, etc.
If you’re happy with the existing custom component, I would continue to use that for most devices and you can try mine to just control the diffuser (hopefully the official component will properly support diffusers at some point and my hacks will become unnecessary:)). My component is conveniently named “tuyalocal” to allow both to be used at the same time.
OK, tried again with 2 devices: a switch and the diffuser, same component (yours, tuyalocal), localkey and deviceid are correct… the switch works, the diffuser doesn’t
I’m starting to think there’s something wrong with the location of tuyalocal.py and ptuya.py, where should I copy them?
Just match the locations to what I have on GitHub (i.e. pytuya.py should be directly in the custom_components folder). Since the switch works, the locations are almost certainly correct.
Please make sure the Tuya\Smart Life\whatever app is completely closed (i.e. force-stop on Android). I’ve seen the app maintain connection to the devices when running in background which wreaks havoc with the custom component.
Also, can you send the debug log? Maybe I can figure something out from that.
Ideally just turn on debug logging for custom_components.pytuya and custom_components.switch.tuyalocal:
Can you please confirm that you don’t have the Smart Life (or whatever app variant you’re using) opened? Even if it doesn’t show up in the recent apps list, please force-close it.
This is an error I used to see when the Smart Life app was open since it connects to the device locally and the device only allows a single connection.
do you have updated your custom component? don’t work with new version. Actualy i use localtuya custom component but with version 3.3 i control only on/off have you a news?
I have the same (Asakuki branded 500ml) diffuser. It’s working with the Tuya Smart app, and integrates happily with Google Home via the Tuya account.
I installed and set up the Tuya custom component. Like several have reported, the diffuser does not appear in HA.
If I create a “tap to run” routine in the Tuya app (e.g. turn on the diffuser and set the colour to red), the routine appears in HA through the custom component.
Has anyone managed to get a diffuser working through the Tuya component? Or is there any other relatively straightforward way of controlling the diffuser through HA?
I would love to be able to use the diffuser locally, but I have no experience with Tasmota or ESPHome, and the complexity of trying this, plus the time required, plus the difficulty people in this thread and others appear to be having in getting it to work, means it doesn’t feel like a wise option for me.
I too recently purchased a Tuya / Smart Life compatible diffuser this past week. While I was not able to see any device added to Home Assistant after completing the integration setup for Tuya, I too can confirm that creating a Tap-To-Run automation and setting all the states you want for the spray and lighting modes, will create a scene using the Tuya Integration in Home Assistant after a reboot or reload of the integration. I was able to create a Master Bedroom Full Spray, Partial Spray and Off scene which fit my needs and can be easily added to any automation or script or be used for manual execution in lovelace.
hi have done the same but I see it only has activate in the entity is this correct, I added to HomeKit via HA when I turn on its does come on and stay on but HomeKit shows it as on then shows off, did you find the same?
The official integration doesn’t show any of my diffusers available to me within the Tuya Smart App. The following brings them into HA, giving me on/off for light and mist:
Install HACS
Buy a diffuser and add it to the Tuya Smart App
Go to iot.tuya.com, create a new Cloud Project, then Link Tuya App Account toit