Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
294 changes: 294 additions & 0 deletions custom_components/tuya_local/devices/casdon_16j3s_dishwasher.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,294 @@
name: Dishwasher
products:
- id: z9xmtevm2acowc62
manufacturer: Casdon
model: 16J3S
entities:
- entity: switch
icon: "mdi:dishwasher"
dps:
- id: 1
type: boolean
name: switch
- entity: button
name: Start
icon: "mdi:play"
dps:
- id: 2
type: boolean
name: button
- entity: button
name: Stop
icon: "mdi:stop"
dps:
- id: 3
type: boolean
name: button
mapping:
- dps_val: true
value: false
- dps_val: false
value: true
- entity: select
class: enum
name: Work mode
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leave out the name here, and let the translation_key be used instead.

translation_key: washing_mode
category: config
dps:
- id: 6
type: string
name: option
mapping:
- dps_val: strong
value: strong
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to find similar entries in the existing washing_mode translations first (eg, intensive), if there is really no match, then that list can be extended.

- dps_val: quick_wash
value: quick_wash
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rapid

- dps_val: "disinfect_wash"
value: disinfect_wash
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self_clean, or hygiene

- dps_val: hour_wash
value: hour_wash
- dps_val: dry
value: dry
- dps_val: chucun
value: chucun
- dps_val: smart_wash
value: smart_wash
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auto

- dps_val: soft_wash
value: soft_wash
- dps_val: hotpot_wash
value: hotpot_wash
- dps_val: eco_wash
value: eco_wash
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just eco

- dps_val: clean_wash
value: clean_wash
- dps_val: baby_wash
value: baby_wash
Comment on lines +64 to +65
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

baby_care

- entity: sensor
translation_key: status
class: enum
category: diagnostic
dps:
- id: 7
type: string
name: sensor
mapping:
- dps_val: standby
value: standby
- dps_val: cleaning
value: cleaning
- dps_val: done
value: done
- dps_val: draining
value: draining
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

emptying

- dps_val: appointment_countdown
value: appointmentSt
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scheduled

- dps_val: drying
value: drying
- dps_val: saving
value: saving
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is difficult to imagine what this is in context of a dishwasher activity. soaking or setting are possibilies

- dps_val: smartwash_detecting
value: smartwash_detecting
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

starting is probably enough

- entity: time
translation_key: appointment_time
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

appointment is strange wording, in English it is usually only used for doctor's, dentist's or other bookings where you visit somewhere. start_time or end_time would be more useful, as it is difficult to know from general names which of those you are setting.

category: config
dps:
- id: 8
type: integer
name: minute
range:
min: 0
max: 1440
- entity: sensor
translation_key: time_remaining
class: duration
category: diagnostic
dps:
- id: 9
type: integer
name: sensor
unit: min
class: measurement
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest not making this a measurement, as it does not make sense to keep long term statistics for a predictable countdown.

- entity: sensor
class: temperature
category: diagnostic
dps:
- id: 11
type: integer
name: sensor
unit: C
class: measurement
- entity: sensor
translation_key: caston_dishwasher_err
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Device specific translation_keys should not be used. In this case, the definition (bitfield) does not match the values (strings), and the values are not adding any real translatable value.

Most likely this should just be a conventional problem class binary_sensor that most other devices have.

class: enum
category: diagnostic
dps:
- id: 18
type: bitfield
name: sensor
mapping:
- dps_val: e1
value: e1
- dps_val: e2
value: e2
- dps_val: e3
value: e3
- dps_val: e4
value: e4
- dps_val: e5
value: e5
- dps_val: e6
value: e6
- dps_val: e7
value: e7
- dps_val: e8
value: e8
- dps_val: e9
value: e9
- entity: switch
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a lock entity, which has this translation_key defined (dp name below also needs changing from switch to lock for this)

translation_key: child_lock
category: config
dps:
- id: 19
type: boolean
optional: true
name: switch
mapping:
- dps_val: true
value: off

Check warning on line 157 in custom_components/tuya_local/devices/casdon_16j3s_dishwasher.yaml

View workflow job for this annotation

GitHub Actions / lint

157:20 [truthy] truthy value should be one of [false, true]
- dps_val: false
value: on

Check warning on line 159 in custom_components/tuya_local/devices/casdon_16j3s_dishwasher.yaml

View workflow job for this annotation

GitHub Actions / lint

159:20 [truthy] truthy value should be one of [false, true]
- entity: binary_sensor
class: door
category: diagnostic
dps:
- id: 101
type: boolean
name: sensor
mapping:
- dps_val: true
value: false
- dps_val: false
value: true
- entity: select
translation_key: water_hardness
icon: "mdi:water-opacity"
category: config
dps:
- id: 102
type: integer
name: option
mapping:
- dps_val: "1"
value: "1"
- dps_val: "2"
value: "2"
- dps_val: "3"
value: "3"
- dps_val: "4"
value: "4"
- dps_val: "5"
value: "5"
- dps_val: "6"
value: "6"
- dps_val: "7"
value: "7"
- entity: select
translation_key: rinse_aid_level
icon: "mdi:water-opacity"
category: config
dps:
- id: 103
type: integer
name: option
mapping:
- dps_val: "1"
value: "1"
- dps_val: "2"
value: "2"
- dps_val: "3"
value: "3"
- dps_val: "4"
value: "4"
- dps_val: "5"
value: "5"
- dps_val: "6"
value: "6"
- dps_val: "7"
value: "7"
- entity: binary_sensor
translation_key: salt
class: problem
category: diagnostic
dps:
- id: 104
type: boolean
name: sensor
- entity: switch
translation_key: auto_drt
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This translation_key is not understandable. What is drt?

icon: "mdi:clock"
category: config
dps:
- id: 105
type: boolean
name: switch
- entity: switch
translation_key: auto_chucun
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This translation key does not seem to be in English. What is chucun?

icon: "mdi:clock"
category: config
dps:
- id: 106
type: boolean
name: switch
- entity: sensor
class: duration
translation_key: chucun_day
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This translation key is also not understandable

category: diagnostic
dps:
- id: 107
type: integer
name: sensor
unit: d
class: measurement
- entity: binary_sensor
translation_key: rinse_aid
class: problem
category: diagnostic
dps:
- id: 108
type: boolean
name: sensor
- entity: select
translation_key: multi_level
icon: "mdi:water-opacity"
category: config
dps:
- id: 109
type: string
name: option
mapping:
- dps_val: all
value: all
- dps_val: up
value: up
- dps_val: down
value: down
- entity: sensor
class: duration
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a duration, it seems to be a volume

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it is the only volume sensor, I suggest using class: water and no translation_key to let the default translations be used.

translation_key: water_once
category: diagnostic
dps:
- id: 13
type: integer
name: sensor
unit: L
class: measurement
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

volume/water requires either total_increasing or no state class

- entity: sensor
class: duration
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also not a duration, it should be energy

translation_key: consumption_once
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is the only energy sensor, I suggest letting the default class translations be used, and not add a translation_key here.

category: diagnostic
dps:
- id: 14
type: integer
name: sensor
unit: kWh
class: measurement
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Energy requires total_increasing state class

Loading
Loading