Clean Air Optima purifier - Home Assistant

Pagina: 1
Acties:

Onderwerpen


Acties:
  • +2 Henk 'm!

  • mcosti097
  • Registratie: Oktober 2023
  • Laatst online: 18-11-2023
Hey guys! I don't speak Dutch, but I thought this would be useful for everyone.

I just purchased a Clean Air Optima purifier which seems to be a Dutch brand, so if you look online there are no resources on how to connect it to Home Assistant.


I've noticed that under the hood, it's a Tuya IoT device, so here is a tutorial on how to connect it to HASS.


1. Remove the device from the Clean Air Optima app
2. Install the Smart Life app from Tuya: https://developer.tuya.com/en/docs/iot/tuya-smart-app-smart-life-app-advantages?id=K989rqa49rluq
3. Make sure that the purifier is in pairing mode (mine was automatically in pairing mode after I removed it from the manufacturer app)
4. Set it up in the Smart Life app.
5. Follow the instructions here https://www.home-assistant.io/integrations/tuya/


For me it all worked smoothly.

Small tip: When making the Tuya cloud project, select the Central Europe server, as that is the one used for the Netherlands

Acties:
  • 0 Henk 'm!

  • wasdadan
  • Registratie: Oktober 2023
  • Laatst online: 27-10-2023
Hi, thanks a lot for these instructions. After I add a device in Tuya with read/write permissions, the device remains read only in the list.
In HA I can see the device but I can not operate it. I am new to Tuya. How do you set the permissions to read/write?

Acties:
  • 0 Henk 'm!

  • mcosti097
  • Registratie: Oktober 2023
  • Laatst online: 18-11-2023
Do you have some screenshots? I do not remember seeing anything about read/write permissions to be honest, I just followed the instructions from the HA page about setting up the app in their cloud dashboard

Acties:
  • 0 Henk 'm!

  • kai_the_one
  • Registratie: Juni 2007
  • Laatst online: 06-05 07:47
@mcosti097 Thanks for the instructions! what is your HASS version? and what Clean Air model do you have?

My HASS version is: 2023.11.2 and Clean air model is CA-705
@wasdadan I believe i've a similar issue as you. Did you manged to solve the permission issue (doubt if its permission issue, see reddit url below) or found a solution to operate the device?

Via HASS UI i'm only able to successful adjust the present mode (from 0>1,2 or 3) - I hear a " biep" at the device when changing, also the result in the debug log confirms it was successful (see below). However, all other operating commands are not working (e.g. on/off) - Response in debug log is "param is empty". In the Tuya IOT platform (Device debugging) i'm able to send the on/off commands to the device and it works well. So I’m assuming there is something wrong with the integration hass > tuya IOT platform?

HASS device logbook says:
Dehumidifier CA-705 Smart V3 became unknown 12:50:34 - 1 hour ago
Dehumidifier CA-705 Smart V3 became unavailable 12:50:32 - 1 hour ago

I noticed more users experienced the issue and magically it was solved the next day: https://www.reddit.com/r/..._permission_is_read_only/

Also i found the instructions to adjust the Read/write permissions (unfortunately i'm not having the option to adjust the permission during the setup, i've tried various ways): https://developer.tuya.co...0a%20Tuya%20app%20account

HASS debugging log:

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
---------failing command Example 1--------- 

2023-11-27 13:16:34.511 DEBUG (SyncWorker_5) [homeassistant.components.tuya] Sending commands for device bfbaxxxxxxxxxxxxxxxxx: [{'code': None, 'value': False}]
2023-11-27 13:16:34.512 DEBUG (SyncWorker_5) [tuya_iot] Request: method = POST, url = https://openapi.tuyaeu.com/v1.0/devices/bfbxxxxxxxxxxxxxxxxxx/commands, params = None, body = {'commands': [{'code': None, 'value': False}]}, t = 1701087394512
2023-11-27 13:16:34.572 DEBUG (SyncWorker_5) [tuya_iot] Response: {
"code": 1100,
[b]"msg": "param is empty",[/b]
"success": false,
"t": 1701087394557,
"tid": "ce5582498dxxxxxxxxxxxxxxxxxxxxxxxxxx"
}\


---------failing command Example 2---------

2023-11-27 13:22:42.016 DEBUG (SyncWorker_2) [homeassistant.components.tuya] Sending commands for device bfbaxxxxxxxxxxxxxxxxx: [{'code': None, 'value': False}]
2023-11-27 13:22:42.034 DEBUG (SyncWorker_2) [tuya_iot] Request: method = POST,                 url = https://openapi.tuyaeu.com/v1.0/devices/bfba4936cfaf3a86a1v2ju/commands,                params = None,                body = {'commands': [{'code': None, 'value': False}]},                t = 1701087762034
2023-11-27 13:22:42.437 DEBUG (SyncWorker_2) [tuya_iot] Response: {
  "code": 1100,
  [b]"msg": "param is empty",[/b]
  "success": false,
  "t": 1701087762425,
  "tid": "a98c95918dxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}

---------working command(set present mode from 0>1)---------

2023-11-27 13:16:43.994 DEBUG (Thread-7 (_thread_main)) [tuya_iot] _on_log: Sending PINGREQ
2023-11-27 13:16:44.016 DEBUG (Thread-7 (_thread_main)) [tuya_iot] _on_log: Received PINGRESP
2023-11-27 13:16:58.608 DEBUG (SyncWorker_5) [homeassistant.components.tuya] Sending commands for device bfbaxxxxxxxxxxxxxxxxx: [{'code': <DPCode.MODE: 'mode'>, 'value': '1'}]
2023-11-27 13:16:58.609 DEBUG (SyncWorker_5) [tuya_iot] Request: method = POST, url = https://openapi.tuyaeu.com/v1.0/devices/bfbxxxxxxxxxxxxxxxxxxxxxxxxxxxx/commands, params = None, body = {'commands': [{'code': <DPCode.MODE: 'mode'>, 'value': '1'}]}, t = 1701087418609
2023-11-27 13:16:58.683 DEBUG (SyncWorker_5) [tuya_iot] Response: {
"result": true,
"success": true,
"t": 1701087418670,
"tid": "dcb285408dxxxxxxxxxxxxxxxxxxx"
}


Does anyone has an idea to fix this?

Acties:
  • 0 Henk 'm!

  • The_Ownman
  • Registratie: Juli 2007
  • Laatst online: 12-03 22:46
I just bought one (CA-704 Smart). Was following this topic.
I integrated a Tuya Air Conditioner before in HA.

Will let you know here if I find anything useful!

Acties:
  • 0 Henk 'm!

  • The_Ownman
  • Registratie: Juli 2007
  • Laatst online: 12-03 22:46
I am not getting a whole lot in HA.
I am not getting information (though the device is added through my existing Tuya integration).

I figure since the device is in read-only mode we cannot send commands.

I do see the commands 'arriving' in the Tuya cloud but the Tuya cloud or device refuses the control.

To be continued

Acties:
  • +1 Henk 'm!

  • The_Ownman
  • Registratie: Juli 2007
  • Laatst online: 12-03 22:46
The cloud is lost.

I noticed I was able to control it from the Tuya smart app.
And I saw these commands do not flow through the cloud.
So I figured local control must be possible.

I installed the local tuya integration via HACS.
While still referencing my Tuya IoT Cloud account.

It found the Dehumidifier (CA-704 Smart) and relevant entities.

I used this: https://community.home-as...art-dehumidifier/417301/3
To translate the settings to HA.

A short summary of what I did:
1 – switch (to switch entity)
2 – mode: 0-normal, 1=continuous, 2=dry clothes, 3=purify (to select entity)
4 – target humidity (to number entity)
5 – uv (='ion', to switch entity)
6 – fan speed: 1=low, 3=high (value 2 is unused for my model) (to select entity)
7 – Not working (child_lock)
11 – status; 0 = OK, 8 = tank full or missing (to binary sensor, do not know if 8 means full for my model)
12 – timer (i did not implement this one yet)
102 – sleep mode (to switch entity)
103 – temperature (to sensor entity)
104 – humidity (to sensor entity)
101 – related to timer (don't know exactly)
105 – defrost (my device does not have defrost, did not implement it).

See screenshot below for result.

Afbeeldingslocatie: https://tweakers.net/i/JJmWVmkCJMPZfFcCmnTOmyaKImE=/800x/filters:strip_exif()/f/image/QMDc5ta7CUq8LroD8uPLAhkJ.png?f=fotoalbum_large

Edit: @kai_the_one check this out!

Acties:
  • 0 Henk 'm!

  • kai_the_one
  • Registratie: Juni 2007
  • Laatst online: 06-05 07:47
Thanks @The_Ownman appreciated. Was indeed experimenting with localtuya as well, while for me it did not retrieved any device or entity when connecting/ adding the cloud. However, I was able to connect manually to the device and send commands and retrieve humidity & temp. Unfortunately I did not concluded on the different values yet, so this is very helpful thanks!

About the “standard” tuya integration: in the tuya IoT platform I noticed the commands arrive but with errors. In debugging device module i was able to operate the device and send the relevant commands (via standard instruction set). Reference documentation: https://developer.tuya.co...g-device?id=Kar2zdgghi2vu

So I believe (for me?) the issue might not be related to “permissions”. Also based on the HA debug log above, it seems that incorrect parameters are sent for 95% of the buttons/settings. Failed examples contains msg: "Param is empty". A successful command contains a value for "code" example: <DPCode.MODE: 'mode'>, a failed command does not contain a value for "code". So it’s possibly a bug or device not yet supported ?

Tuya instruction set I retrieved from IoT platform (where for me only the command “mode” is correctly processed):

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Code | Type | Values
-- | -- | --
Power | Boolean | "{true,false}"
mode | Enum | {   "range": [     "0",     "1",     "2",     "3"   ] }
humidity | Integer | {   "unit": "%",   "min": 30,   "max": 80,   "scale": 0,   "step": 5 }
anion | Boolean | "{true,false}"
windspeed | Enum | {   "range": [     "1",     "3"   ] }
lock | Boolean | "{true,false}"
fault | Bitmap | {   "label": [     "0",     "1",     "2",     "3"   ],   "maxlen": 4 }
countdown | Enum | {   "range": [     "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7",     "8",     "9",     "10",     "11",     "12",     "13",     "14",     "15",     "16",     "17",     "18",     "19",     "20",     "21",     "22",     "23",     "24"   ] }
time | Boolean | "{true,false}"
SLEEP | Boolean | "{true,false}"
get_temp | Integer | {   "unit": "℃",   "min": 0,   "max": 99,   "scale": 0,   "step": 1 }
get_hum | Integer | {   "unit": "%",   "min": 0,   "max": 99,   "scale": 0,   "step": 1 }
hs | Boolean | "{true,false}"


Will test your recommendations after the weekend.

Acties:
  • 0 Henk 'm!

  • kai_the_one
  • Registratie: Juni 2007
  • Laatst online: 06-05 07:47
@The_Ownman thanks again for pointing this out. The majority is working for me as well!

[ Voor 11% gewijzigd door kai_the_one op 03-12-2023 08:10 ]


Acties:
  • 0 Henk 'm!

  • DBrothers
  • Registratie: Oktober 2024
  • Laatst online: 28-12-2024
Afbeeldingslocatie: https://tweakers.net/i/8biVfN33V66t4DB6GC3j7Lk-03o=/800x/filters:strip_exif()/f/image/4GT8nvw55ebqjIAJ4FCq99Mx.png?f=fotoalbum_large


Works completely for me

Grt Tim
Pagina: 1