0x5e / homebridge-tuya-platform

Make homebridge-tuya-platform great again.
MIT License
218 stars 67 forks source link

Homewerks Bathroom Vent Fan Speed Control Should Be Switch #453

Open IVIyg0t opened 6 months ago

IVIyg0t commented 6 months ago

Prerequisite

Cache

Version

v1.7.0-beta.53

Device Infomation JSON File

{
    "active_time": 1710529975,
    "biz_type": 0,
    "category": "fsd",
    "create_time": 1710529975,
    "icon": "smart/icon/bay1595473378663R4Il/165535793479962fd6dff.png",
    "id": "eb29db0040fa1ae004yaae",
    "ip": "174.179.190.15",
    "lat": "37.6300",
    "local_key": "|~RZ;XKr0n9&9]}L",
    "lon": "-77.3400",
    "model": "7148-110-G4",
    "name": "SmartVent",
    "online": true,
    "owner_id": "26947163",
    "product_id": "j0mkdu760cteac3c",
    "product_name": "SmartVent",
    "status": [
      {
        "code": "bright_value",
        "value": 1000
      },
      {
        "code": "countdown",
        "value": 0
      },
      {
        "code": "countdown_left_fan",
        "value": 0
      },
      {
        "code": "fan_mode",
        "value": "fresh"
      },
      {
        "code": "fan_speed",
        "value": 1
      },
      {
        "code": "fan_switch",
        "value": false
      },
      {
        "code": "switch_led",
        "value": true
      },
      {
        "code": "temp_value",
        "value": 0
      },
      {
        "code": "work_mode",
        "value": "white"
      }
    ],
    "sub": false,
    "time_zone": "-04:00",
    "uid": "az16058886003063vtG5",
    "update_time": 1711328813,
    "uuid": "9a6edd6d68a252ab",
    "schema": [
      {
        "code": "bright_value",
        "mode": "rw",
        "type": "Integer",
        "property": {
          "min": 10,
          "max": 1000,
          "scale": 0,
          "step": 1
        }
      },
      {
        "code": "control_data",
        "mode": "wo",
        "type": "String",
        "property": {
          "maxlen": 255
        }
      },
      {
        "code": "countdown",
        "mode": "rw",
        "type": "Integer",
        "property": {
          "unit": "s",
          "min": 0,
          "max": 86400,
          "scale": 0,
          "step": 1
        }
      },
      {
        "code": "countdown_left_fan",
        "mode": "rw",
        "type": "Integer",
        "property": {
          "unit": "min",
          "min": 0,
          "max": 540,
          "scale": 0,
          "step": 1
        }
      },
      {
        "code": "fan_mode",
        "mode": "rw",
        "type": "Enum",
        "property": {
          "range": [
            "fresh",
            "nature"
          ]
        }
      },
      {
        "code": "fan_speed",
        "mode": "rw",
        "type": "Integer",
        "property": {
          "unit": "",
          "min": 1,
          "max": 100,
          "scale": 0,
          "step": 1
        }
      },
      {
        "code": "fan_switch",
        "mode": "rw",
        "type": "Boolean",
        "property": {}
      },
      {
        "code": "switch_led",
        "mode": "rw",
        "type": "Boolean",
        "property": {}
      },
      {
        "code": "temp_value",
        "mode": "rw",
        "type": "Integer",
        "property": {
          "min": 0,
          "max": 1000,
          "scale": 0,
          "step": 1
        }
      },
      {
        "code": "work_mode",
        "mode": "rw",
        "type": "Enum",
        "property": {
          "range": [
            "white",
            "colour",
            "scene",
            "music"
          ]
        }
      }
    ]
  },

Device Control Mode

Standard Instruction

Logs

No response

Other Infomations

Hello! Thanks so much for this great plugin.

I installed a Homewerks bathroom Vent / Light combo recently. It uses Tuya's IoT platform, so naturally, I added it to my cloud account and got it integrated into Homekit. It shows up and everything works ok, but the problem is that Homekit seems to be recognizing the Fan controller as a percentage slider (0% - 100%). Stangely, the fan doesn't actually turn on unless the sliders is at exactly 1%. I suppose it kind of makes sense, as the fan itself only has 1 speed (On or Off).

I was wondering if there was any way to override the UI that homekit shows for this device and show a simple on/off switch for the fan instead of the percentage range.

here are screen shots of the Tuya app, and HomeKit for this device

Thanks!