From 7d45e935f0d05bd254186a5e83b9edf0e9c3af5a Mon Sep 17 00:00:00 2001 From: "y.karlykov" Date: Wed, 19 Feb 2025 22:51:32 +0300 Subject: [PATCH 1/4] Create neatsvor_x520ru_vacuum.yaml --- .../devices/neatsvor_x520ru_vacuum.yaml | 152 ++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 custom_components/tuya_local/devices/neatsvor_x520ru_vacuum.yaml diff --git a/custom_components/tuya_local/devices/neatsvor_x520ru_vacuum.yaml b/custom_components/tuya_local/devices/neatsvor_x520ru_vacuum.yaml new file mode 100644 index 0000000000..6ecc6f9831 --- /dev/null +++ b/custom_components/tuya_local/devices/neatsvor_x520ru_vacuum.yaml @@ -0,0 +1,152 @@ +name: neatsvor_x520_vacuum_cleaner +products: + id: dbougox8k7ntyxeh + name: Neatsvor X520RU +primary_entity: + entity: vacuum + dps: + - id: 1 + type: boolean + name: power + - id: 2 + type: boolean + name: activate + - id: 3 + type: string + name: command + mapping: + - dps_val: "standby" + value: "standby" + - dps_val: "smart" + value: "smart" + - dps_val: "wall_follow" + value: "wall_follow" + - dps_val: "mop" + value: "mop" + - dps_val: "spiral" + value: "clean_spot" + - dps_val: "chargego" + value: "return_to_base" + - id: 5 + type: string + name: status + mapping: + - dps_val: "0" + value: "Standby" + - dps_val: "1" + value: "Smart cleaning" + - dps_val: "2" + value: "Mopping" + - dps_val: "3" + value: "Cleaning along the walls" + - dps_val: "4" + value: "Recharging" + - dps_val: "5" + value: "Charging" + - dps_val: "6" + value: "Spot cleaning" + - dps_val: "7" + value: "Manual cleaning" + - id: 14 + type: string + name: fan_speed + optional: true + mapping: + - dps_val: "max" + value: "max" + - dps_val: "strong" + value: "strong" + - dps_val: "normal" + value: "normal" + - dps_val: "weak" + value: "weak" + - id: 18 + type: bitfield + name: error + mapping: + - dps_val: 2 + value: "side scan exception" + - dps_val: 4 + value: "middle scan exception" + - dps_val: 8 + value: "left wheel exception" + - dps_val: 16 + value: "right wheel exception" + - dps_val: 32 + value: "garbage box exception" + - dps_val: 64 + value: "ground inspection exception" + - dps_val: 128 + value: "collision exception" + - dps_val: 256 + value: "Other problems" +secondary_entities: + - entity: sensor + class: battery + dps: + - id: 6 + name: sensor + type: integer + unit: "%" + class: measurement + - entity: sensor + name: Last cleaning area + icon: mdi:floor-plan + dps: + - id: 16 + name: sensor + type: integer + unit: m² + class: measurement + mapping: + - scale: 10 + - entity: sensor + class: duration + name: Last cleaning duration + dps: + - id: 17 + name: sensor + type: integer + unit: min + class: measurement + - entity: select + name: Language + category: config + icon: mdi:earth + dps: + - id: 29 + type: string + name: option + mapping: + - dps_val: "russian" + value: "russian" + - dps_val: "english" + value: "english" + - entity: select + name: Water step + category: config + icon: "mdi:water" + dps: + - id: 101 + type: string + name: option + mapping: + - dps_val: "low_step" + value: "low" + - dps_val: "mid_step" + value: "mid" + - dps_val: "high_step" + value: "high" + - entity: switch + name: Mute + category: config + icon: mdi:bell-cancel-outline + dps: + - id: 102 + type: boolean + name: switch + mapping: + - dps_val: true + value: false + - dps_val: false + value: true \ No newline at end of file From 535abd567f0438b2dcf9d076440453a40167e33c Mon Sep 17 00:00:00 2001 From: "y.karlykov" Date: Thu, 20 Feb 2025 21:33:35 +0300 Subject: [PATCH 2/4] Correction linter error --- .../tuya_local/devices/neatsvor_x520ru_vacuum.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/custom_components/tuya_local/devices/neatsvor_x520ru_vacuum.yaml b/custom_components/tuya_local/devices/neatsvor_x520ru_vacuum.yaml index 6ecc6f9831..62dd19fb6d 100644 --- a/custom_components/tuya_local/devices/neatsvor_x520ru_vacuum.yaml +++ b/custom_components/tuya_local/devices/neatsvor_x520ru_vacuum.yaml @@ -1,7 +1,9 @@ name: neatsvor_x520_vacuum_cleaner products: - id: dbougox8k7ntyxeh - name: Neatsvor X520RU + - id: dbougox8k7ntyxeh + name: Neatsvor X520RU + manufacturer: Neatsvor + model: X520RU primary_entity: entity: vacuum dps: @@ -149,4 +151,4 @@ secondary_entities: - dps_val: true value: false - dps_val: false - value: true \ No newline at end of file + value: true From 0f06c4066c08ac3cd66314bf68cbd827663d4c11 Mon Sep 17 00:00:00 2001 From: "y.karlykov" Date: Sun, 23 Feb 2025 21:49:00 +0300 Subject: [PATCH 3/4] Delete primary and seconadary entities --- .../devices/neatsvor_x520ru_vacuum.yaml | 157 +++++++++--------- 1 file changed, 78 insertions(+), 79 deletions(-) diff --git a/custom_components/tuya_local/devices/neatsvor_x520ru_vacuum.yaml b/custom_components/tuya_local/devices/neatsvor_x520ru_vacuum.yaml index 62dd19fb6d..fada892875 100644 --- a/custom_components/tuya_local/devices/neatsvor_x520ru_vacuum.yaml +++ b/custom_components/tuya_local/devices/neatsvor_x520ru_vacuum.yaml @@ -4,85 +4,84 @@ products: name: Neatsvor X520RU manufacturer: Neatsvor model: X520RU -primary_entity: - entity: vacuum - dps: - - id: 1 - type: boolean - name: power - - id: 2 - type: boolean - name: activate - - id: 3 - type: string - name: command - mapping: - - dps_val: "standby" - value: "standby" - - dps_val: "smart" - value: "smart" - - dps_val: "wall_follow" - value: "wall_follow" - - dps_val: "mop" - value: "mop" - - dps_val: "spiral" - value: "clean_spot" - - dps_val: "chargego" - value: "return_to_base" - - id: 5 - type: string - name: status - mapping: - - dps_val: "0" - value: "Standby" - - dps_val: "1" - value: "Smart cleaning" - - dps_val: "2" - value: "Mopping" - - dps_val: "3" - value: "Cleaning along the walls" - - dps_val: "4" - value: "Recharging" - - dps_val: "5" - value: "Charging" - - dps_val: "6" - value: "Spot cleaning" - - dps_val: "7" - value: "Manual cleaning" - - id: 14 - type: string - name: fan_speed - optional: true - mapping: - - dps_val: "max" - value: "max" - - dps_val: "strong" - value: "strong" - - dps_val: "normal" - value: "normal" - - dps_val: "weak" - value: "weak" - - id: 18 - type: bitfield - name: error - mapping: - - dps_val: 2 - value: "side scan exception" - - dps_val: 4 - value: "middle scan exception" - - dps_val: 8 - value: "left wheel exception" - - dps_val: 16 - value: "right wheel exception" - - dps_val: 32 - value: "garbage box exception" - - dps_val: 64 - value: "ground inspection exception" - - dps_val: 128 - value: "collision exception" - - dps_val: 256 - value: "Other problems" -secondary_entities: +entities: + - entity: vacuum + dps: + - id: 1 + type: boolean + name: power + - id: 2 + type: boolean + name: activate + - id: 3 + type: string + name: command + mapping: + - dps_val: "standby" + value: "standby" + - dps_val: "smart" + value: "smart" + - dps_val: "wall_follow" + value: "wall_follow" + - dps_val: "mop" + value: "mop" + - dps_val: "spiral" + value: "clean_spot" + - dps_val: "chargego" + value: "return_to_base" + - id: 5 + type: string + name: status + mapping: + - dps_val: "0" + value: "Standby" + - dps_val: "1" + value: "Smart cleaning" + - dps_val: "2" + value: "Mopping" + - dps_val: "3" + value: "Cleaning along the walls" + - dps_val: "4" + value: "Recharging" + - dps_val: "5" + value: "Charging" + - dps_val: "6" + value: "Spot cleaning" + - dps_val: "7" + value: "Manual cleaning" + - id: 14 + type: string + name: fan_speed + optional: true + mapping: + - dps_val: "max" + value: "max" + - dps_val: "strong" + value: "strong" + - dps_val: "normal" + value: "normal" + - dps_val: "weak" + value: "weak" + - id: 18 + type: bitfield + name: error + mapping: + - dps_val: 2 + value: "side scan exception" + - dps_val: 4 + value: "middle scan exception" + - dps_val: 8 + value: "left wheel exception" + - dps_val: 16 + value: "right wheel exception" + - dps_val: 32 + value: "garbage box exception" + - dps_val: 64 + value: "ground inspection exception" + - dps_val: 128 + value: "collision exception" + - dps_val: 256 + value: "Other problems" - entity: sensor class: battery dps: From e9488fc57c460ccd8f91f9c564a6446061d0c9b9 Mon Sep 17 00:00:00 2001 From: Flegm Date: Tue, 29 Apr 2025 16:45:56 +0300 Subject: [PATCH 4/4] Fix Neatsvor X520RU vacuum config according to code review feedback: change status values to lowercase, use translation_keys for language and mopping, update values mapping --- .../devices/neatsvor_x520ru_vacuum.yaml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/custom_components/tuya_local/devices/neatsvor_x520ru_vacuum.yaml b/custom_components/tuya_local/devices/neatsvor_x520ru_vacuum.yaml index fada892875..9183757ed0 100644 --- a/custom_components/tuya_local/devices/neatsvor_x520ru_vacuum.yaml +++ b/custom_components/tuya_local/devices/neatsvor_x520ru_vacuum.yaml @@ -34,7 +34,7 @@ entities: name: status mapping: - dps_val: "0" - value: "Standby" + value: "standby" - dps_val: "1" value: "Smart cleaning" - dps_val: "2" @@ -42,9 +42,9 @@ entities: - dps_val: "3" value: "Cleaning along the walls" - dps_val: "4" - value: "Recharging" + value: "charging" - dps_val: "5" - value: "Charging" + value: "charged" - dps_val: "6" value: "Spot cleaning" - dps_val: "7" @@ -91,8 +91,8 @@ entities: unit: "%" class: measurement - entity: sensor + class: area name: Last cleaning area - icon: mdi:floor-plan dps: - id: 16 name: sensor @@ -111,9 +111,8 @@ entities: unit: min class: measurement - entity: select - name: Language + translation_key: language category: config - icon: mdi:earth dps: - id: 29 type: string @@ -124,9 +123,8 @@ entities: - dps_val: "english" value: "english" - entity: select - name: Water step + translation_key: mopping category: config - icon: "mdi:water" dps: - id: 101 type: string @@ -135,7 +133,7 @@ entities: - dps_val: "low_step" value: "low" - dps_val: "mid_step" - value: "mid" + value: "medium" - dps_val: "high_step" value: "high" - entity: switch