From 43b6ef03b6676d69a5b82ab485b21903f08bafc1 Mon Sep 17 00:00:00 2001 From: Thomas Schiex Date: Mon, 13 Jan 2025 10:06:40 +0100 Subject: [PATCH 1/2] YAML for the Casafan Eco Genuino --- .../devices/casafan_ceiling_fan.yaml | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 custom_components/tuya_local/devices/casafan_ceiling_fan.yaml diff --git a/custom_components/tuya_local/devices/casafan_ceiling_fan.yaml b/custom_components/tuya_local/devices/casafan_ceiling_fan.yaml new file mode 100644 index 0000000000..40f4e97399 --- /dev/null +++ b/custom_components/tuya_local/devices/casafan_ceiling_fan.yaml @@ -0,0 +1,42 @@ +name: Ceiling fan +products: + - id: 000001nbqb + name: Casafan Eco Genuino +primary_entity: + entity: fan + translation_only_key: fan_with_presets + dps: + - id: 1 + type: boolean + name: switch + - id: 2 + type: string + name: preset_mode + - id: 3 + type: integer + name: speed + range: + min: 1 + max: 6 + - id: 8 + type: string + name: direction +secondary_entities: + - entity: select + translation_key: timer + category: config + dps: + - id: 22 + type: string + name: option + mapping: + - dps_val: "off" + value: "off" + - dps_val: "1hour" + value: "1h" + - dps_val: "2hour" + value: "2h" + - dps_val: "4hour" + value: "4h" + - dps_val: "8hour" + value: "8h" From 4a33ad0b01ae042c56a86dfe5baae5fd003041e4 Mon Sep 17 00:00:00 2001 From: Thomas Schiex Date: Mon, 13 Jan 2025 10:22:38 +0100 Subject: [PATCH 2/2] The mapping for the preset mode is needed. --- .../tuya_local/devices/casafan_ceiling_fan.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/custom_components/tuya_local/devices/casafan_ceiling_fan.yaml b/custom_components/tuya_local/devices/casafan_ceiling_fan.yaml index 40f4e97399..6139f3ef7c 100644 --- a/custom_components/tuya_local/devices/casafan_ceiling_fan.yaml +++ b/custom_components/tuya_local/devices/casafan_ceiling_fan.yaml @@ -12,6 +12,13 @@ primary_entity: - id: 2 type: string name: preset_mode + mapping: + - dps_val: normal + value: normal + - dps_val: sleep + value: sleep + - dps_val: nature + value: nature - id: 3 type: integer name: speed