Aroma diffuser / essential oil diffuser that works with Smart Life (Tuya)?

Ok, uploaded to:

TuyaLocal Component

README.md has all the details

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.

awesome!
since I already used the tuya custom component, do I need to replace it with yours?

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.

Morning Alexanv.

Could you tell me how I go about finding my localkey and device ID please?

Follow this guide, there’s several methods

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:

logger:
  default: warning
  logs:
    pytuya: debug

Hello, I have the same problem; I have one switch working as expected but the diffuser no; I have the following error:
2019-05-22 16:47:03 DEBUG (SyncWorker_8) [pytuya] 192.168.2.63: async_status() called
2019-05-22 16:47:03 DEBUG (SyncWorker_8) [pytuya] 192.168.2.63: Generated JSON payload=b’{“gwId”:“xxxxxxx”,“devId”:“xxxxxx”}’
2019-05-22 16:47:03 WARNING (SyncWorker_8) [pytuya] 192.168.2.63: Send error (‘NoneType’ object has no attribute ‘send’), re-connect and retry (counter=0)
2019-05-22 16:47:03 ERROR (SyncWorker_8) [pytuya] 192.168.2.63: Connect error ([Errno 111] Connection refused)
2019-05-22 16:47:03 WARNING (SyncWorker_8) [pytuya] 192.168.2.63: Send error (‘NoneType’ object has no attribute ‘send’), re-connect and retry (counter=1)
2019-05-22 16:47:03 ERROR (SyncWorker_8) [pytuya] 192.168.2.63: Connect error ([Errno 111] Connection refused)
2019-05-22 16:47:03 WARNING (SyncWorker_8) [pytuya] 192.168.2.63: Send error (‘NoneType’ object has no attribute ‘send’), re-connect and retry (counter=2)
2019-05-22 16:47:03 ERROR (SyncWorker_8) [pytuya] 192.168.2.63: Connect error ([Errno 111] Connection refused)
2019-05-22 16:47:03 WARNING (SyncWorker_8) [pytuya] 192.168.2.63: Send error (‘NoneType’ object has no attribute ‘send’), re-connect and retry (counter=3)
2019-05-22 16:47:03 ERROR (SyncWorker_8) [pytuya] 192.168.2.63: Connect error ([Errno 111] Connection refused)
2019-05-22 16:47:03 ERROR (SyncWorker_8) [pytuya] 192.168.2.63: Send error (‘NoneType’ object has no attribute ‘send’), passing exception to caller
File “/config/custom_components/pytuya.py”, line 337, in async_status
File “/config/custom_components/pytuya.py”, line 262, in _send

Both codes are correct.
Can you help me?

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.

1 Like

Thank you, that was exactly the problem.
Regards.

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?

Another option is to flash it with Tasmota or ESPHome.

I tried it, but I don’t even see the device in the entities list. I have no error in the logs… what’s wrong?

Hi all

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.

1 Like

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.

2 Likes

Being able to get the LocalKey is very complicated! I have not succeeded … I give up!

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?

I have a tuya oil aroma diffuser which has been seamlessly integrated in my HA instance with this. It’s local, no cloud:

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:

  1. Install HACS
  2. Buy a diffuser and add it to the Tuya Smart App
  3. Go to iot.tuya.com, create a new Cloud Project, then Link Tuya App Account toit
  4. Add the Tuya v2 repository described here: How to Use Tuya Home Assistant Integration-Documentation-Tuya Developer
  5. Add the Tuya v2 integration and add credentials from above

Limitations:

  • This is cloud, not local.
  • Can’t change light colour, just on/of and brightness (can set this in the Tuya Smart App).
  • Can’t increase/decrease mist volume, only on/off (can set this in the Tuya Smart App)
1 Like

Hi, i am new in this, wihich the best working aroma diffuser works with home assistant?
THx