Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Incomplete detection of Gratkit dryer v2 #501

Open
2 of 3 tasks
dewi-ny-je opened this issue Jan 21, 2025 · 5 comments
Open
2 of 3 tasks

[Bug]: Incomplete detection of Gratkit dryer v2 #501

dewi-ny-je opened this issue Jan 21, 2025 · 5 comments
Labels
auto configure Related to auto configure entities feature. master/next-release Fixed in master branch, Will be ready in the next release

Comments

@dewi-ny-je
Copy link

dewi-ny-je commented Jan 21, 2025

LocalTuya Version

2025.1.1

Home Assistant Version

2025.1.2

Environment

  • Does the device work using the Home Assistant Tuya Cloud component?
  • Is this device connected to another local integration, including Home Assistant and any other tools?
  • The devices are within the same HA subnet, and they get discovered automatically when I add them

What happened?

I have a Gratkit dryer V2. This integration recognises the following entities:

Image

However the device supports many more, as seen in tuya-local/custom_components/tuya_local/devices/gratkit_filament_dryer.yaml at cc374f213ad2796296e556e950ddf30884620c33 · make-all/tuya-local · GitHub 6

Can the integration be modified to import all entities? even adding them manually is not straightforward, especially for DPS=103,105,106, given the mapping needed.

Steps to reproduce.

  1. Add device using Cloud
  2. Detect entities (DPS numbers) automatically
  3. notice many are missing

Relevant log output

nothing relevant

Diagnostics information.

localtuya-01JGXVGNCB49XGAQZASRZF26D9-GratKit.Firefly.V2-47fa48744c40f4d940e07a984e298d86.json

@dewi-ny-je dewi-ny-je added the bug Something isn't working label Jan 21, 2025
@xZetsubou xZetsubou added auto configure Related to auto configure entities feature. and removed bug Something isn't working labels Jan 21, 2025
@xZetsubou
Copy link
Owner

Auto configure isn't rely a thing to rely on I can add the device but it will take time to releases an update sometimes or I may cannot add it since it made to be implemented by community, besides not all values exists named in yaml you posted.

You can map the three DPS you mentioned using select platform entity.

note: the right text it friendly name of the value if you want to change them

DP 103

0: OFF
1: Red
2: Green
3: Blue
4: White
5: Yellow
6: Cyan
7: Purple
8: Orange
9: Pink
10: Rainbow Fade
11: Rainbow Blink
12: Rainbow Smooth
13: 13 Unknown? # rename it later.
14: 14 Unknown?
15: 15 Unknown?
16: 16 Unknown?
17: 17 Unknown?
18: 18 Unknown?
19: 19 Unknown?
20: 20 Unknown?

DP 105

PLA: PLA
PLA_J: PLA_J
PETG: PETG
ABS: ABS
Nylon: Nylon
PC: PC
HIPS: HIPS
TPU: TPU
DIY1: DIY1
DIY2: DIY2

DP 106
Localtuya doesn't support sensor mapping it will report the but you can use select workaround and set entity category to diagnostics.

0: Normal
1: Dryer box tilted
2: Heat plate overheated
3: Dryer box overheated
4: Fan RPM too low
5: Unknown error
6: Unknown error
7: Unknown error
8: Unknown error
9: Unknown error

@dewi-ny-je
Copy link
Author

I'll publish the template for it as soon as I complete the setup then. Thanks.

xZetsubou added a commit that referenced this issue Jan 22, 2025
@xZetsubou xZetsubou added the master/next-release Fixed in master branch, Will be ready in the next release label Jan 22, 2025
@ndizazzo
Copy link

ndizazzo commented Jan 26, 2025

I don't have a cloud account and don't care to set one up, and I'm having problems with this device too. Not sure if this is relevant, but I tried doing a manual configuration based on @dewi-ny-je's debug JSON:

"device_config": {
      "device_id": "bf3e744f288605f614ir97",
      "dps_strings": [
        "1 ( code: switch , value: False )",
        "20 ( code: temp_set , value: 45 )",
        "21 ( code: temp_current , value: 22 )",
        "101 ( code: countdown , value: 493 )",
        "102 ( code: humidity , value: 43 )",
        "103 ( code: ledlight , value: 12 )",
        "104 ( code: heat_wd , value: 19 )",
        "105 ( code: material_type , value: PLA_J )",
        "106 ( code: erro , value: 3 )",
        "107 ( code: pvrpm , value: 0 )",
        "108 ( code: usb_bz , value: False )",
        "109 ( code: speek , value: False )",
        "110 ( code: lcd_onof , value: True )"
      ],
      "enable_debug": false,
      "entities": [
        {
          "entity_category": "None",
          "fan_direction_forward": "forward",
          "fan_direction_reverse": "reverse",
          "fan_speed_max": 100,
          "fan_speed_min": 1,
          "fan_speed_ordered_list": "disabled",
          "friendly_name": "Switch",
          "icon": "mdi:fan",
          "id": "1",
          "platform": "fan"
        },
        {
          "device_class": "temperature",
          "entity_category": "None",
          "friendly_name": "",
          "icon": "",
          "id": "21",
          "platform": "sensor",
          "state_class": "measurement",
          "unit_of_measurement": "\u00b0C"
        },
        {
          "entity_category": "config",
          "friendly_name": "Countdown",
          "icon": "mdi:timer-cog-outline",
          "id": "101",
          "is_passive_entity": false,
          "platform": "select",
          "restore_on_reconnect": false,
          "select_options": {
            "1": "1 Hour",
            "2": "2 Hours",
            "3": "3 Hours",
            "4": "4 Hours",
            "5": "5 Hours",
            "6": "6 Hours",
            "cancel": "Disable"
          }
        }
      ],
      "friendly_name": "GratKit Firefly V2",
      "host": "192.168.3.159",
      "local_key": "***",
      "manual_dps_strings": "1, 20, 21, 101, 102, 103, 104, 105, 106, 107",
      "model": "GratKit Firefly V2",
      "node_id": null,
      "product_key": "***",
      "protocol_version": "3.5"
    },

The connection succeeded, but I received the following error:

REMOVED

@dewi-ny-je
Copy link
Author

@ndizazzo it doesn't because you used my key and device id...
In fact, can you please remove the fields device_id, local_key, IP, product_key from your template? I think they should not be made public. I already censored them out from the original JSON. Thanks

@dewi-ny-je
Copy link
Author

dewi-ny-je commented Jan 26, 2025

This is my template I exported from my working configuration.
REMARK:
target temperature, speaker, LCD don't work (they appear greyed out in HA) so I might have misconfigured them or what they report is different from other fields.

Image

Any hint is appreciated.

- fan:
    entity_category: None
    fan_direction_forward: forward
    fan_direction_reverse: reverse
    fan_speed_max: 100
    fan_speed_min: 1
    fan_speed_ordered_list: disabled
    friendly_name: Switch
    icon: mdi:fan
    id: '1'
    platform: fan
- sensor:
    device_class: temperature
    entity_category: None
    friendly_name: ''
    icon: ''
    id: '21'
    platform: sensor
    state_class: measurement
    unit_of_measurement: °C
- select:
    entity_category: config
    friendly_name: Countdown
    icon: mdi:timer-cog-outline
    id: '101'
    is_passive_entity: false
    platform: select
    restore_on_reconnect: false
    select_options:
      '1': 1 Hour
      '2': 2 Hours
      '3': 3 Hours
      '4': 4 Hours
      '5': 5 Hours
      '6': 6 Hours
      cancel: Disable
- select:
    id: '103'
    friendly_name: LED light
    entity_category: config
    select_options:
      '0': 'OFF'
      '1': Red
      '2': Green
      '3': Blue
      '4': White
      '5': Yellow
      '6': Cyan
      '7': Purple
      '8': Orange
      '9': Pink
      '10': Rainbow Fade
      '11': Rainbow Blink
      '12': Rainbow Smooth
      '13': 13 Unknown?
      '14': 14 Unknown?
      '15': 15 Unknown?
      '16': 16 Unknown?
      '17': 17 Unknown?
      '18': 18 Unknown?
      '19': 19 Unknown?
      '20': 20 Unknown?
    restore_on_reconnect: false
    is_passive_entity: false
    platform: select
- select:
    id: '105'
    friendly_name: Presets
    entity_category: config
    select_options:
      PLA: PLA
      PLA_J: PLA_J
      PETG: PETG
      ABS: ABS
      Nylon: Nylon
      PC: PC
      HIPS: HIPS
      TPU: TPU
      DIY1: DIY1
      DIY2: DIY2
    restore_on_reconnect: false
    is_passive_entity: false
    platform: select
- select:
    id: '106'
    friendly_name: Error
    entity_category: diagnostic
    select_options:
      '0': Normal
      '1': Dryer box tilted
      '2': Heat plate overheated
      '3': Dryer box overheated
      '4': Fan RPM too low
      '5': Unknown error
      '6': Unknown error
      '7': Unknown error
      '8': Unknown error
      '9': Unknown error
    restore_on_reconnect: false
    is_passive_entity: false
    platform: select
- sensor:
    id: '20'
    friendly_name: Target temperature
    entity_category: config
    unit_of_measurement: °C
    device_class: temperature
    state_class: measurement
    platform: sensor
- sensor:
    id: '102'
    friendly_name: Humidity
    entity_category: None
    unit_of_measurement: '%'
    device_class: humidity
    state_class: measurement
    platform: sensor
- sensor:
    id: '104'
    friendly_name: Heating plate temperature
    entity_category: diagnostic
    unit_of_measurement: °C
    device_class: temperature
    state_class: measurement
    platform: sensor
- sensor:
    id: '107'
    friendly_name: Fan speed
    entity_category: diagnostic
    unit_of_measurement: rpm
    device_class: speed
    state_class: measurement
    platform: sensor
- binary_sensor:
    id: '108'
    friendly_name: USB
    entity_category: diagnostic
    state_on: 'True'
    device_class: connectivity
    platform: binary_sensor
- binary_sensor:
    id: '109'
    friendly_name: Speaker
    entity_category: config
    state_on: 'True'
    platform: binary_sensor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto configure Related to auto configure entities feature. master/next-release Fixed in master branch, Will be ready in the next release
Projects
None yet
Development

No branches or pull requests

3 participants