0x5e / homebridge-tuya-platform

Make homebridge-tuya-platform great again.
MIT License
206 stars 58 forks source link

Not setting temp when turning heater on #365

Open zindello opened 10 months ago

zindello commented 10 months ago

Prerequisite

Cache

Version

v1.7.0-beta.49

Device Infomation JSON File

{
    "active_time": 1693364512,
    "biz_type": 0,
    "category": "qn",
    "create_time": 1693364512,
    "icon": "smart/icon/ay1536534747810ekKBj/b86f626c37f6fd7750cd7d6e24bad3b9.png",
    "id": "xxx",
    "ip": "xxx",
    "lat": "xxx",
    "local_key": "xxx",
    "lon": "xxx",
    "model": "PEH210HA",
    "name": "PEH210HA 2",
    "online": true,
    "owner_id": "xxx",
    "product_id": "khbg54x4rw8cmbn4",
    "product_name": "PEH210HA",
    "status": [
      {
        "code": "countdown_left",
        "value": 0
      },
      {
        "code": "level",
        "value": "2"
      },
      {
        "code": "light",
        "value": true
      },
      {
        "code": "switch",
        "value": false
      },
      {
        "code": "temp_current",
        "value": 13
      },
      {
        "code": "temp_set",
        "value": 21
      }
    ],
    "sub": false,
    "time_zone": "+10:00",
    "uid": "eu16933603403370R3As",
    "update_time": 1693364523,
    "uuid": "d67b0141d1c70b3e",
    "schema": [
      {
        "code": "countdown_left",
        "mode": "ro",
        "type": "Integer",
        "property": {
          "unit": "min",
          "min": 0,
          "max": 1440,
          "scale": 0,
          "step": 1
        }
      },
      {
        "code": "level",
        "mode": "ro",
        "type": "Enum",
        "property": {
          "range": [
            "1",
            "2"
          ]
        }
      },
      {
        "code": "light",
        "mode": "rw",
        "type": "Boolean",
        "property": {}
      },
      {
        "code": "switch",
        "mode": "rw",
        "type": "Boolean",
        "property": {}
      },
      {
        "code": "temp_current",
        "mode": "ro",
        "type": "Integer",
        "property": {
          "unit": "°C",
          "min": -20,
          "max": 50,
          "scale": 0,
          "step": 1
        }
      },
      {
        "code": "temp_set",
        "mode": "rw",
        "type": "Integer",
        "property": {
          "unit": "°C",
          "min": 10,
          "max": 49,
          "scale": 0,
          "step": 1
        }
      }
    ]
  },

Device Control Mode

Standard Instruction

Logs

Turns the fan on:


[30/08/2023, 1:47:40 pm] [Tuya] [TuyaOpenAPI] Request:
method = post
endpoint = https://openapi.tuyaeu.com
path = /v1.0/devices/bfaa50c640d7ec8524fapi/commands
query = null
headers = {
  "t": "1693367260681",
  "client_id": "d395dgytxkarwhgcvwa9",
  "nonce": "8f4e8ea5-07b9-4b8a-ae15-befa05d4c7ef",
  "Signature-Headers": "client_id",
  "sign": "30FFAF0CC32485C0D6730833BC31D0483D17711949E5D2F885CEEB61F1FF22AD",
  "sign_method": "HMAC-SHA256",
  "access_token": "9cf55fca82e64be724763aae3896586b",
  "lang": "en",
  "dev_lang": "javascript",
  "dev_channel": "homebridge",
  "devVersion": "1.7.0-beta.49"
}
body = {
  "commands": [
    {
      "code": "switch",
      "value": true
    }
  ]
}

Enables the heater:

[30/08/2023, 1:47:45 pm] [Tuya] [TuyaOpenAPI] Request:
method = post
endpoint = https://openapi.tuyaeu.com
path = /v1.0/devices/bfaa50c640d7ec8524fapi/commands
query = null
headers = {
  "t": "1693367265897",
  "client_id": "d395dgytxkarwhgcvwa9",
  "nonce": "e3be34ac-14fa-4087-8857-59051cf74f94",
  "Signature-Headers": "client_id",
  "sign": "7BABEA398745D991C8BB91A638979C6396AFC2D5D566565D10B5071CE1949AF1",
  "sign_method": "HMAC-SHA256",
  "access_token": "9cf55fca82e64be724763aae3896586b",
  "lang": "en",
  "dev_lang": "javascript",
  "dev_channel": "homebridge",
  "devVersion": "1.7.0-beta.49"
}
body = {
  "commands": [
    {
      "code": "temp_set",
      "value": 22
    }
  ]
}

Other Infomations

Hi,

I have an Arlec Grid Connect heater which is connected via the Tuya App.

I am trying to get it working via HomeKit using HomeBridge. If I send on/off command it only sends on/off to the device and doesn't start heating. The device needs to receive a "temp_set" command in order to start heating.

Is it possible to use the dp overrides to send this command with the "switch" command in order to get it to start heating by default? Currently I have to turn the switch on and then set the temp via HomeKit which works, but is a bit annoying.

Thanks,