make-all / tuya-local

Local support for Tuya devices in Home Assistant
MIT License
1.2k stars 489 forks source link

Request support for Princess Smart DC Fan #2141

Open drcjb opened 1 month ago

drcjb commented 1 month ago

Log message

Error during integration of Princess Smart DC Pedestal Fan

This error originated from a custom integration.

Logger: custom_components.tuya_local.config_flow
Source: custom_components/tuya_local/config_flow.py:483
integration: Tuya Local (documentation, issues)
First occurred: 18:44:54 (1 occurrences)
Last logged: 18:44:54

Device matches peteme_smart_recessed_lighting with quality of 57%. DPS: {"updated_at": 1721407489.7067287, "1": true, "2": "nature", "3": "9", "6": "0", "9": false, "23": 0, "101": true}

Just to note that DPIP 3 is the fan speed and the error log show speed was 9 during integration attempt and this was indeed the fan speed!

DPS information

Device Data Points for Princess  from Tuya IoT site.

{
  "result": {
    "properties": [
      {
        "code": "switch",
        "custom_name": "",
        "dp_id": 1,
        "time": 1721322452748,
        "type": "bool",
        "value": false
      },
      {
        "code": "mode",
        "custom_name": "",
        "dp_id": 2,
        "time": 1720536054220,
        "type": "enum",
        "value": "nature"
      },
      {
        "code": "fan_speed",
        "custom_name": "",
        "dp_id": 3,
        "time": 1721257178071,
        "type": "enum",
        "value": "9"
      },
      {
        "code": "countdown",
        "custom_name": "",
        "dp_id": 6,
        "time": 1720536054282,
        "type": "enum",
        "value": "0"
      },
      {
        "code": "light",
        "custom_name": "",
        "dp_id": 9,
        "name": "Light",
        "time": 1721322452748,
        "type": "bool",
        "value": false
      },
      {
        "code": "countdown_left",
        "custom_name": "",
        "dp_id": 23,
        "time": 1720536054326,
        "type": "value",
        "value": 0
      },
      {
        "code": "OSC",
        "custom_name": "",
        "dp_id": 101,
        "time": 1720894766184,
        "type": "bool",
        "value": true
      }
    ]
  },
  "success": true,
  "t": 1721323532071,
  "tid": "bc33c527452a11ef982bea89d218984e"
}

Product ID

glhx4aeaqmzmp3sb

Product Name

Princess Bluetooth (which is odd as it is wifi connected)

Information about how the device functions

This is a smart fan that supports on/off, 24 different speeds, oscillation, 4 modes and a light (on/off). I can control all these from the Tuya Smart app. I installed Tuya and can only control the fan on/off and the light on/off. I have spent days trying to configure a YAML file but it never showed up in the similar file list. I'm not very good with YAML and can't understand how to handle the enum type that the fan uses for fan speed and other functions. I have one question as I have kept the Home Assistant Tuya integration to control the fan and light on/off functions, would that interfere with the Tuya-local integration of the same device as I understand HA has to have a unique code for each device? Any help gratefully received to get this fan under complete local control. If I have missed anything out please do not hesitate to contact me.

I also have a Wood's smart clim, so if I can understand what you do for the fan I might be able to create the YAML file for the clim and share it with the community.

Best regards, Colin

make-all commented 1 month ago

There is no range information for the dps. If you have access to the iot.tuya.com site, please paste the result for the QueryThingsDataModel cloud API specifically, as that is the only one that has all the information for the device, even though the format is not really made for human readability.

drcjb commented 1 month ago

response_container_BBPPID{font-family: initial; font-size:initial; color: initial;} OK, understood, I have that in my computer, I'll send it tomorrow. Many thanks, Colin  Sent via BlackBerry Hub+ Inbox for Android From: @.: 22 July 2024 00:28To: @. to: @.: @.; @.***: Re: [make-all/tuya-local] Request support for Princess Smart DC Fan (Issue #2141)

There is no range information for the dps. If you have access to the iot.tuya.com site, please paste the result for the QueryThingsDataModel cloud API specifically, as that is the only one that has all the information for the device, even though the format is not really made for human readability.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

drcjb commented 1 month ago

Copy from my mail yesterday.

Is this the list you mean Jason?

Best regards, Colin

Tuya IoT device spec.txt

switch Boolean

"{true,false}"

mode Enum

{ "range": [ "nature", "sleep", "fresh", "smart" ] }

fan_speed Enum

{ "range": [ "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24" ] }

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" ] }

light Boolean

"{true,false}"

OSC Boolean

"{true,false}"

make-all commented 1 month ago

Thank you

drcjb commented 1 week ago

Sorry to bother you but any news about my request, I see other requests after mine have already been processed? I need this for my handicaped wife, so she can control the fan easily with a large remote control. Any help greatfully received.

drcjb commented 6 days ago

Hi Jason,

Thanks for the rapid response, much appreciated. I will test the config tomorrow and get back to you.

Best regards, Colin

drcjb commented 5 days ago

Dear Jason,

I have just done the integration and the YAML file is correctly identified. However I only see 4 entities defined under the device. I called the device Fan Princess during the installation and the entities I see are:

1: light.fan_princess (this controls the light in the fan's base and works correctly)

2: fan.fan_princess_none (this is the fan on/off switch and works correctly)

3: sensor.fan_princess_time_remaining (which show a downcount in minutes for the delayed starting timer and this works correctly)

4: select.fan_princess_timer (which is a sort of combobox allowing me to choose the delay before the fan starts and this works correctly)

What I can not see or control is the fan's speed or the fan's oscillation mode (on/off).

In the system log I get the following error message during the integration:

This error originated from a custom integration.

Logger: custom_components.tuya_local.config_flow Source: custom_components/tuya_local/config_flow.py:483 integration: Tuya Local (documentation, issues) First occurred: 19:43:13 (1 occurrences) Last logged: 19:43:13

Device matches Princess 358450 DC pedestal fan with quality of 100%. DPS: {"updated_at": 1725298988.285963, "1": false, "2": "nature", "3": "3", "6": "0", "9": false, "23": 0, "101": true}

Please let me know if you need any other information, I really hope this can be made to work?

Best regards, Colin

make-all commented 4 days ago

The fan entity contains the speed and oscillation controls. It seems you have added it using a card that only shows the on/off control. Try using a tile card, which should allow adding other attributes to the card.

drcjb commented 4 days ago

response_container_BBPPID{font-family: initial; font-size:initial; color: initial;} Hi Jason, I'm looking under integrations, this is what I see.Could my original Tuya integration cause Tuya-local any problems?Many thanks for your help.Best regards, Colin  Sent via BlackBerry Hub+ Inbox for Android From: @.: 2 September 2024 23:57To: @. to: @.: @.; @.***: Re: [make-all/tuya-local] Request support for Princess Smart DC Fan (Issue #2141)

The fan entity contains the speed and oscillation controls. It seems you have added it using a card that only shows the on/off control. Try using a tile card, which should allow adding other attributes to the card.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

drcjb commented 4 days ago

Dear Jason,

Overnight I realised that I had not updated the fan.py file only the yaml file, so I just copied the fan.py from git hub and deleted the Princess integration and reinstalled it. The resut is odd as now I only have 3 entities, the light, the timer and the time remaining, the fan on/off has disappeared. I will now deleted Tuya-local and reinstall it.....

Best regards, Colin

drcjb commented 4 days ago

Hi again Jason.

Did a complete delete Tuya-local and reinstall from repository and I am back to the same 4 entities, as decribed above.

Hope you can solve this mystery?

Many thanks - Colin

make-all commented 4 days ago

The updates to fan.py in this release cycle are not relevant to supporting this fan. They are only to silence some deprecation warnings in HA 2024.8 and later. The device yaml file by itself should be all that is needed. 4 entities is as expected.

drcjb commented 4 days ago

Ok Jason, it was just a thought. Ah you say 4 entities as expected, but I was expecting to see speed.fan_princess and oscillate.fan_princess as well. Are you saying I can't control the speed and oscillation or am I looking in the wrong place for them because they are not entities? Sorry but I am still a nooby to HA.

Best regards, Colin

make-all commented 3 days ago

speed and oscillate are part of the fan entity

drcjb commented 3 days ago

response_container_BBPPID{font-family: initial; font-size:initial; color: initial;} Progress!  In the entities list if I open the fan entity I see the oscillation and the preset mode, and a vertical slider for the speed.Will test these 3 tomorrow but it is looking good.How do I reference these 'sub' entities in a script or automation?Many thanks for you patience Jason.Best regards, Colin  Sent via BlackBerry Hub+ Inbox for Android From: @.: 4 September 2024 00:06To: @. to: @.: @.; @.***: Re: [make-all/tuya-local] Request support for Princess Smart DC Fan (Issue #2141)

speed and oscillate are part of the fan entity

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

drcjb commented 3 days ago

response_container_BBPPID{font-family: initial; font-size:initial; color: initial;} Just had a session with chatGPT and so I finally understand what I need to do to access these sub entities.Many thanks, will give final green light after test tomorrow.Best regards, Colin  Sent via BlackBerry Hub+ Inbox for Android From: @.: 4 September 2024 00:21To: @.; @.: @.: Re: [make-all/tuya-local] Request support for Princess Smart DC Fan (Issue #2141) #ssc53615 #response_container_BBPPID{font-family: initial;font-size: initial;color: initial;} Progress!  In the entities list if I open the fan entity I see the oscillation and the preset mode, and a vertical slider for the speed.Will test these 3 tomorrow but it is looking good.How do I reference these 'sub' entities in a script or automation?Many thanks for you patience Jason.Best regards, Colin  Sent via BlackBerry Hub+ Inbox for Android From: @.: 4 September 2024 00:06To: @. to: @.: @.; @.***: Re: [make-all/tuya-local] Request support for Princess Smart DC Fan (Issue #2141)

speed and oscillate are part of the fan entity

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

drcjb commented 3 days ago

response_container_BBPPID{font-family: initial; font-size:initial; color: initial;} Dear Jason,I am pleased to confirm the config file is working perfectly. Many many thanks for your time and patience. Best regards, Colin  Sent via BlackBerry Hub+ Inbox for Android From: @.: 4 September 2024 00:52To: @.; @.: @.: Re: [make-all/tuya-local] Request support for Princess Smart DC Fan (Issue #2141) #ssc53618 #response_container_BBPPID{font-family: initial;font-size: initial;color: initial;}#ssc53618 #ssc53615 #response_container_BBPPID{font-family: initial;font-size: initial;color: initial;} Just had a session with chatGPT and so I finally understand what I need to do to access these sub entities.Many thanks, will give final green light after test tomorrow.Best regards, Colin  Sent via BlackBerry Hub+ Inbox for Android From: @.: 4 September 2024 00:21To: @.; @.: @.: Re: [make-all/tuya-local] Request support for Princess Smart DC Fan (Issue #2141) Progress!  In the entities list if I open the fan entity I see the oscillation and the preset mode, and a vertical slider for the speed.Will test these 3 tomorrow but it is looking good.How do I reference these 'sub' entities in a script or automation?Many thanks for you patience Jason.Best regards, Colin  Sent via BlackBerry Hub+ Inbox for Android From: @.: 4 September 2024 00:06To: @. to: @.: @.; @.***: Re: [make-all/tuya-local] Request support for Princess Smart DC Fan (Issue #2141)

speed and oscillate are part of the fan entity

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

drcjb commented 3 days ago

Dear Jason,

I am pleased to confirm the config file is working perfectly. Many many thanks for your time and patience.

Best regards, Colin