make-all / tuya-local

Local support for Tuya devices in Home Assistant
MIT License
1.2k stars 489 forks source link

Request support for Sanden Wifi Controller to control Sanden GAU-A45HPD heat pump unit #1940

Open InyoEndo opened 3 months ago

InyoEndo commented 3 months ago

Log Message

Logger: custom_components.tuya_local.config_flow
Source: custom_components/tuya_local/config_flow.py:97
integration: Tuya Local ([documentation](https://github.com/make-all/tuya-local), [issues](https://github.com/make-all/tuya-local/issues))
First occurred: 22 May 2024 at 22:30:39 (1 occurrences)
Last logged: 22 May 2024 at 22:30:39

Device matches None with quality of 0%. DPS: {"updated_at": 1716381034.6746192, "101": false, "102": false, "103": true, "104": false, "105": true, "106": 1350, "107": 0, "108": 0, "109": "--", "110": "--", "111": "--", "112": "--", "113": "--", "114": "--", "115": "--", "116": "--", "117": "50/10/5", "118": "Off", "119": 58, "120": 21, "121": 16, "122": 15, "123": 14, "124": 8, "125": 8, "126": 0, "127": 0, "128": 0, "129": 26, "130": 11, "131": 0, "132": 25, "133": 0, "134": 0, "135": 37, "136": 1000, "139": "GAUS-300FQTS", "140": "", "142": "", "143": "17/05/2024", "144": "1111", "145": "", "146": "", "147": "", "150": "", "151": "", "152": "", "155": 0, "156": 823, "157": 0, "158": 0}

Information about DPS mappings

{
  "result": {
    "model": "{\"modelId\":\"000004khpx\",\"services\":[{\"actions\":[],\"code\":\"\",\"description\":\"\",\"events\":[],\"name\":\"默认服务\",\"properties\":[
{\"abilityId\":101,\"accessMode\":\"rw\",\"code\":\"heatup\",\"description\":\"0:off 1:on \\n\",\"name\":\"heatup\",\"typeSpec\":{\"type\":\"bool\"}},
{\"abilityId\":102,\"accessMode\":\"rw\",\"code\":\"air_purge\",\"description\":\"0:off 1:on\",\"name\":\"air_purge\",\"typeSpec\":{\"type\":\"bool\"}},
{\"abilityId\":103,\"accessMode\":\"rw\",\"code\":\"heat_set\",\"description\":\"0:off 1:nor\\n\\\"1\\\"代表允许heat-up  \\\"0\\\"代表不允许heat-up\",\"name\":\"heat_set\",\"typeSpec\":{\"type\":\"bool\"}},
{\"abilityId\":104,\"accessMode\":\"rw\",\"code\":\"manual_auto\",\"description\":\"0:auto 1:manual\",\"name\":\"manual_auto\",\"typeSpec\":{\"type\":\"bool\"}},
{\"abilityId\":105,\"accessMode\":\"rw\",\"code\":\"clock_synchronization\",\"description\":\"0:手动,时间由APP设置   1:自动,WIFI模块自动获取网络时间\",\"name\":\"Clock synchronization\",\"typeSpec\":{\"type\":\"bool\"}},
{\"abilityId\":106,\"accessMode\":\"rw\",\"code\":\"clock_setting\",\"description\":\"\",\"name\":\"Clock setting\",\"typeSpec\":{\"type\":\"value\",\"max\":1439,\"min\":0,\"scale\":0,\"step\":1,\"unit\":\"min\"}},
{\"abilityId\":107,\"accessMode\":\"rw\",\"code\":\"block_out_time_set_start\",\"description\":\"\",\"name\":\"block_out_time_set_start\",\"typeSpec\":{\"type\":\"value\",\"max\":23,\"min\":0,\"scale\":0,\"step\":1,\"unit\":\"\"}},
{\"abilityId\":108,\"accessMode\":\"rw\",\"code\":\"block_out_time_set_end\",\"description\":\"\",\"name\":\"block_out_time_set_end\",\"typeSpec\":{\"type\":\"value\",\"max\":23,\"min\":0,\"scale\":0,\"step\":1,\"unit\":\"\"}},
{\"abilityId\":109,\"accessMode\":\"ro\",\"code\":\"error_code\",\"description\":\"\",\"name\":\"Current error code\",\"typeSpec\":{\"type\":\"string\",\"maxlen\":255}},
{\"abilityId\":110,\"accessMode\":\"ro\",\"code\":\"error_history_1\",\"description\":\"\",\"name\":\"Error history 1\",\"typeSpec\":{\"type\":\"string\",\"maxlen\":255}},
{\"abilityId\":111,\"accessMode\":\"ro\",\"code\":\"error_history_2\",\"description\":\"\",\"name\":\"Error history 2\",\"typeSpec\":{\"type\":\"string\",\"maxlen\":255}},
{\"abilityId\":112,\"accessMode\":\"ro\",\"code\":\"error_history_3\",\"description\":\"\",\"name\":\"Error history 3\",\"typeSpec\":{\"type\":\"string\",\"maxlen\":255}},
{\"abilityId\":113,\"accessMode\":\"ro\",\"code\":\"error_history_4\",\"description\":\"\",\"name\":\"Error history 4\",\"typeSpec\":{\"type\":\"string\",\"maxlen\":255}},
{\"abilityId\":114,\"accessMode\":\"ro\",\"code\":\"error_history_5\",\"description\":\"\",\"name\":\"Error history 5\",\"typeSpec\":{\"type\":\"string\",\"maxlen\":255}},
{\"abilityId\":115,\"accessMode\":\"ro\",\"code\":\"error_history_6\",\"description\":\"\",\"name\":\"Error history 6\",\"typeSpec\":{\"type\":\"string\",\"maxlen\":255}},
{\"abilityId\":116,\"accessMode\":\"ro\",\"code\":\"error_history_7\",\"description\":\"\",\"name\":\"Error history 7\",\"typeSpec\":{\"type\":\"string\",\"maxlen\":255}},
{\"abilityId\":117,\"accessMode\":\"rw\",\"code\":\"eco_weight_params\",\"description\":\"Weight Parameter Format: Integration/Large/Small\",\"name\":\"Energy Saving Parameter\",\"typeSpec\":{\"type\":\"string\",\"maxlen\":255}},
{\"abilityId\":118,\"accessMode\":\"ro\",\"code\":\"operation_status\",\"description\":\"0:Standby\\n1:Air purge operation\\n2:Freeze protection operation\\n3:Heat-up operation\",\"name\":\"operation_status\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"Off\",\"Air_purging\",\"Freeze_protection\",\"Working\"]}},
{\"abilityId\":119,\"accessMode\":\"ro\",\"code\":\"tank_temp\",\"description\":\"\",\"name\":\"Tank temp.\",\"typeSpec\":{\"type\":\"value\",\"max\":127,\"min\":-128,\"scale\":0,\"step\":1,\"unit\":\"℃\"}},
{\"abilityId\":120,\"accessMode\":\"ro\",\"code\":\"outlet_temp\",\"description\":\"\",\"name\":\"Outlet temp.\",\"typeSpec\":{\"type\":\"value\",\"max\":127,\"min\":-128,\"scale\":0,\"step\":1,\"unit\":\"℃\"}},
{\"abilityId\":121,\"accessMode\":\"ro\",\"code\":\"inlet_temp\",\"description\":\"\",\"name\":\"Inlet temp.\",\"typeSpec\":{\"type\":\"value\",\"max\":127,\"min\":-128,\"scale\":0,\"step\":1,\"unit\":\"℃\"}},
{\"abilityId\":122,\"accessMode\":\"ro\",\"code\":\"discharge_temp\",\"description\":\"\",\"name\":\"Discharge temp.\",\"typeSpec\":{\"type\":\"value\",\"max\":127,\"min\":-128,\"scale\":0,\"step\":1,\"unit\":\"℃\"}},
{\"abilityId\":123,\"accessMode\":\"ro\",\"code\":\"suction_temp\",\"description\":\"\",\"name\":\"Suction temp.\",\"typeSpec\":{\"type\":\"value\",\"max\":127,\"min\":-128,\"scale\":0,\"step\":1,\"unit\":\"℃\"}},
{\"abilityId\":124,\"accessMode\":\"ro\",\"code\":\"evaporator_temp\",\"description\":\"\",\"name\":\"Evaporator temp.\",\"typeSpec\":{\"type\":\"value\",\"max\":127,\"min\":-128,\"scale\":0,\"step\":1,\"unit\":\"℃\"}},
{\"abilityId\":125,\"accessMode\":\"ro\",\"code\":\"ambient_temp\",\"description\":\"\",\"name\":\"Ambient temp.\",\"typeSpec\":{\"type\":\"value\",\"max\":127,\"min\":-128,\"scale\":0,\"step\":1,\"unit\":\"℃\"}},
{\"abilityId\":126,\"accessMode\":\"ro\",\"code\":\"compressor_speed\",\"description\":\"\",\"name\":\"compressor_speed\",\"typeSpec\":{\"type\":\"value\",\"max\":9999,\"min\":0,\"scale\":0,\"step\":1,\"unit\":\"\"}},
{\"abilityId\":127,\"accessMode\":\"ro\",\"code\":\"water_pump_speed\",\"description\":\"\",\"name\":\"water_pump_speed\",\"typeSpec\":{\"type\":\"value\",\"max\":9999,\"min\":0,\"scale\":0,\"step\":1,\"unit\":\"\"}},
{\"abilityId\":128,\"accessMode\":\"ro\",\"code\":\"fan_motor_speed\",\"description\":\"\",\"name\":\"fan_motor_speed\",\"typeSpec\":{\"type\":\"value\",\"max\":999,\"min\":0,\"scale\":0,\"step\":1,\"unit\":\"\"}},
{\"abilityId\":129,\"accessMode\":\"ro\",\"code\":\"compressor_total_time\",\"description\":\"\",\"name\":\"Comp operation total time\",\"typeSpec\":{\"type\":\"value\",\"max\":65535,\"min\":0,\"scale\":0,\"step\":1,\"unit\":\"h\"}},
{\"abilityId\":130,\"accessMode\":\"ro\",\"code\":\"num_compressor_starts\",\"description\":\"\",\"name\":\"Number of comp. starts\",\"typeSpec\":{\"type\":\"value\",\"max\":65535,\"min\":0,\"scale\":0,\"step\":1,\"unit\":\"\"}},
{\"abilityId\":131,\"accessMode\":\"ro\",\"code\":\"input_current\",\"description\":\"\",\"name\":\"input_current\",\"typeSpec\":{\"type\":\"value\",\"max\":99,\"min\":0,\"scale\":0,\"step\":1,\"unit\":\"A\"}},
{\"abilityId\":132,\"accessMode\":\"ro\",\"code\":\"heating_up_total_time\",\"description\":\"\",\"name\":\"Total time of heating up\",\"typeSpec\":{\"type\":\"value\",\"max\":65535,\"min\":0,\"scale\":0,\"step\":1,\"unit\":\"h\"}},
{\"abilityId\":133,\"accessMode\":\"ro\",\"code\":\"defrosting_total_time\",\"description\":\"\",\"name\":\"Total time of defrosting\",\"typeSpec\":{\"type\":\"value\",\"max\":65535,\"min\":0,\"scale\":0,\"step\":1,\"unit\":\"h\"}},
{\"abilityId\":134,\"accessMode\":\"ro\",\"code\":\"freeze_total_time\",\"description\":\"\",\"name\":\"Total time of freeze\",\"typeSpec\":{\"type\":\"value\",\"max\":65535,\"min\":0,\"scale\":0,\"step\":1,\"unit\":\"h\"}},
{\"abilityId\":135,\"accessMode\":\"ro\",\"code\":\"electricity_consumption_1\",\"description\":\"用I=input_current来计算。 electricity_consumption=U*I*功率因素*t\",\"name\":\"Normal\",\"typeSpec\":{\"type\":\"value\",\"max\":2000000000,\"min\":0,\"scale\":1,\"step\":1,\"unit\":\"\"}},
{\"abilityId\":136,\"accessMode\":\"rw\",\"code\":\"for_services_password\",\"description\":\"\",\"name\":\"for_services_password\",\"typeSpec\":{\"type\":\"value\",\"max\":6000,\"min\":1000,\"scale\":0,\"step\":1,\"unit\":\"\"}},
{\"abilityId\":139,\"accessMode\":\"rw\",\"code\":\"product_model_hp_tank\",\"description\":\"\",\"name\":\"Product model of HP/TANK\",\"typeSpec\":{\"type\":\"string\",\"maxlen\":255}},
{\"abilityId\":140,\"accessMode\":\"rw\",\"code\":\"hp_serial_number\",\"description\":\"\",\"name\":\"hp_serial_number\",\"typeSpec\":{\"type\":\"string\",\"maxlen\":255}},
{\"abilityId\":142,\"accessMode\":\"rw\",\"code\":\"tank_uint_serial_number\",\"description\":\"\",\"name\":\"tank_uint_serial_number\",\"typeSpec\":{\"type\":\"string\",\"maxlen\":255}},
{\"abilityId\":143,\"accessMode\":\"rw\",\"code\":\"installation_date\",\"description\":\"\",\"name\":\"Installation date\",\"typeSpec\":{\"type\":\"string\",\"maxlen\":255}},
{\"abilityId\":144,\"accessMode\":\"rw\",\"code\":\"post_code\",\"description\":\"\",\"name\":\"post_code\",\"typeSpec\":{\"type\":\"string\",\"maxlen\":255}},
{\"abilityId\":145,\"accessMode\":\"rw\",\"code\":\"service_date_1\",\"description\":\"\",\"name\":\"service_date_1\",\"typeSpec\":{\"type\":\"string\",\"maxlen\":255}},
{\"abilityId\":146,\"accessMode\":\"rw\",\"code\":\"service_date_2\",\"description\":\"\",\"name\":\"service_date_2\",\"typeSpec\":{\"type\":\"string\",\"maxlen\":255}},
{\"abilityId\":147,\"accessMode\":\"rw\",\"code\":\"service_date_3\",\"description\":\"\",\"name\":\"service_date_3\",\"typeSpec\":{\"type\":\"string\",\"maxlen\":255}},
{\"abilityId\":150,\"accessMode\":\"rw\",\"code\":\"service_error_code_1\",\"description\":\"\",\"name\":\"service_error_code_1\",\"typeSpec\":{\"type\":\"string\",\"maxlen\":255}},
{\"abilityId\":151,\"accessMode\":\"rw\",\"code\":\"service_error_code_2\",\"description\":\"\",\"name\":\"service_error_code_2\",\"typeSpec\":{\"type\":\"string\",\"maxlen\":255}},
{\"abilityId\":152,\"accessMode\":\"rw\",\"code\":\"service_error_code_3\",\"description\":\"\",\"name\":\"service_error_code_3\",\"typeSpec\":{\"type\":\"string\",\"maxlen\":255}},
{\"abilityId\":155,\"accessMode\":\"rw\",\"code\":\"boost_hours\",\"description\":\"\",\"name\":\"boost_hours\",\"typeSpec\":{\"type\":\"value\",\"max\":9,\"min\":0,\"scale\":0,\"step\":1,\"unit\":\"\"}},
{\"abilityId\":156,\"accessMode\":\"ro\",\"code\":\"estimated_hot_water\",\"description\":\"hot water = 4.5*860 / (63 - Ti),\\nTi: the data of previous day as saved.\",\"name\":\"estimated hot water\",\"typeSpec\":{\"type\":\"value\",\"max\":65535,\"min\":0,\"scale\":1,\"step\":1,\"unit\":\"L\"}},
{\"abilityId\":157,\"accessMode\":\"ro\",\"code\":\"electricity_consumption_2\",\"description\":\"\",\"name\":\"Defrost\",\"typeSpec\":{\"type\":\"value\",\"max\":2000000000,\"min\":0,\"scale\":1,\"step\":1,\"unit\":\"\"}},
{\"abilityId\":158,\"accessMode\":\"ro\",\"code\":\"electricity_consumption_3\",\"description\":\"\",\"name\":\"Anti-frost\",\"typeSpec\":{\"type\":\"value\",\"max\":2000000000,\"min\":0,\"scale\":1,\"step\":1,\"unit\":\"\"}}]}]}"
  },
  "success": true,
  "t": 1716429462591,
  "tid": "d767820d18a711ef95070a4483f43617"
}

Product ID

ssqd7htb3tbhxqvk

Information about how the device functions

https://www.sanden-hot-water.com.au/wifi-controller/ https://saheatpumps.com.au/wp-content/uploads/2023/12/Wifi-controller-installation-manual.pdf

From within Smart Life app

Main Screen Status so from from what I have seen is either standby or heating. Heatin being the pump active. image

Time Setting For blocking out when you want to pump to be active. Ticking "Clock sync" will sync it to presumably your current phone time. image

Boost Can specify a number of hours to activly turn the pump on. Need to switch on for it to activate. Also provides an estimate of how many litres you have left of hot water, assume this is current total as changing the boost hours does not affect this value. Could test some more. image

Electricity Consumption Can't drill down and dont have a legend either so no idea what the number represents. Would be nicer to have a current consumption if that is availble. image

Setting Can enter "Intial Setting" or turn on energy saving mode. Unsure what service access does, but could fiddle with it if required. image

Intial Setting Series for free text fields, not sure of point of these, maybe just for your own records. image

InyoEndo commented 3 months ago

Im in the process of typing out the yaml for this, have it working getting values in, so will add that in as well when done.

make-all commented 1 month ago

I don't think there is enough info to figure this out, the naming of your UI screenshots does not match the dp naming from the tuya docs.

I guess Boost is the auto/manual switch, and eco may be linked with the heatup or heat_set, but it isn't really clear exactly how.

InyoEndo commented 1 month ago

@make-all Thanks, sorry meant to get back tto doing this but life. I'll post what I have built out so far in YAML, I just dont know wtf im doing with the primary_entity or any of the switch's (cause they dont work and its obviously wrong) or any of the values where you can write a change. As far as the reading sensors, they all work and I think I have them right.

image

image

name: Sanden Heat Pump
products:
  - id: ssqd7htb3tbhxqvk
    name: Sanden Wifi controller for Sanden GAU-A45HPD Heat Pump
primary_entity:
  entity: switch
  dps:
    - id: 101
      type: boolean
      name: Boost     
secondary_entities:
  - entity: switch    
    name: Booster
    dps:
      - id: 104
        type: boolean
  - entity: sensor
    name: Status
    icon: "mdi:heat-pump"
    class: enum
    category: diagnostic
    dps:
      - id: 118
        type: string
        name: sensor
        optional: true
        persist: false
        mapping:
        - dps_val: "Off"
          value: "Standby"
        - dps_val: "Air_purging"
          value: "Air Purge"
        - dps_val: "Freeze protection operation"
          value: "Freeze_protection"
        - dps_val: "Working"
          value: "Heating"
  - entity: sensor    
    name: Current Error Code
    icon: "mdi:alert-circle"
    category: diagnostic
    dps:
      - id: 109
        type: string
        name: sensor
        optional: true
        readonly: true
  - entity: sensor    
    name: Error History 1
    icon: "mdi:alert-circle"
    category: diagnostic
    dps:
      - id: 110
        type: string
        name: sensor
        optional: true
        readonly: true
  - entity: sensor    
    name: Error History 2
    icon: "mdi:alert-circle"
    category: diagnostic
    dps:
      - id: 111
        type: string
        name: sensor
        optional: true
        readonly: true
  - entity: sensor    
    name: Error History 3
    icon: "mdi:alert-circle"
    category: diagnostic
    dps:
      - id: 112
        type: string
        name: sensor
        optional: true
        readonly: true
  - entity: sensor    
    name: Error History 4
    icon: "mdi:alert-circle"
    category: diagnostic
    dps:
      - id: 113
        type: string
        name: sensor
        optional: true
        readonly: true
  - entity: sensor    
    name: Error History 5
    icon: "mdi:alert-circle"
    category: diagnostic
    dps:
      - id: 114
        type: string
        name: sensor
        optional: true
        readonly: true
  - entity: sensor    
    name: Error History 6
    icon: "mdi:alert-circle"
    category: diagnostic
    dps:
      - id: 115
        type: string
        name: sensor
        optional: true
        readonly: true
  - entity: sensor    
    name: Error History 7
    icon: "mdi:alert-circle"
    category: diagnostic
    dps:
      - id: 116
        type: string
        name: sensor
        optional: true
        readonly: true
  - entity: sensor    
    class: temperature
    name: Tank Temperature
    dps:
      - id: 119
        name: sensor
        type: integer
        class: measurement
        unit: "°C"        
        readonly: true
  - entity: sensor    
    class: temperature
    name: Outlet Temperature
    dps:
      - id: 120
        name: sensor
        type: integer
        class: measurement
        unit: "°C"        
        readonly: true
  - entity: sensor    
    class: temperature
    name: Inlet Temperature
    dps:
      - id: 121
        name: sensor
        type: integer
        class: measurement
        unit: "°C"        
        readonly: true
  - entity: sensor    
    class: temperature
    name: Discharge Temperature
    dps:
      - id: 122
        name: sensor
        type: integer
        class: measurement
        unit: "°C"        
        readonly: true
  - entity: sensor    
    class: temperature
    name: Suction Temperature
    dps:
      - id: 123
        name: sensor
        type: integer
        class: measurement
        unit: "°C"        
        readonly: true
  - entity: sensor    
    class: temperature
    name: Evaporator Temperature
    dps:
      - id: 124
        name: sensor
        type: integer
        class: measurement
        unit: "°C"        
        readonly: true
  - entity: sensor    
    class: temperature
    name: Ambiet Temperature
    dps:
      - id: 125
        name: sensor
        type: integer
        class: measurement
        unit: "°C"        
        readonly: true
  - entity: sensor
    name: Compressor Speed
    icon: "mdi:pump"
    dps:
      - id: 126
        name: sensor
        type: integer
        class: measurement
        readonly: true
  - entity: sensor
    name: Water Pump Speed
    icon: "mdi:pump"
    dps:
      - id: 127
        name: sensor
        type: integer
        class: measurement
        readonly: true
  - entity: sensor
    name: Fan Motor Speed
    icon: "mdi:pump"
    dps:
      - id: 128
        name: sensor
        type: integer
        class: measurement
        readonly: true
  - entity: sensor    
    name: Compressor Total Time
    icon: "mdi:chart-line"
    dps:
      - id: 129
        name: sensor
        type: integer
        class: measurement
        unit: "h"        
        readonly: true
  - entity: sensor
    name: Number of Compression Starts
    icon: "mdi:counter"
    dps:
      - id: 130
        name: sensor
        type: integer
        class: measurement
        readonly: true
  - entity: sensor
    class: current    
    name: Input current
    dps:
      - id: 131
        name: sensor
        type: integer
        unit: "A"
        class: measurement
        readonly: true
  - entity: sensor    
    name: Heating Total Time
    icon: "mdi:chart-line"
    dps:
      - id: 132
        name: sensor
        type: integer
        class: measurement
        unit: "h"        
        readonly: true
  - entity: sensor    
    name: Defrosting Total Time
    icon: "mdi:chart-line"
    dps:
      - id: 133
        name: sensor
        type: integer
        class: measurement
        unit: "h"        
        readonly: true
  - entity: sensor    
    name: Freeze Protection Total Time
    icon: "mdi:chart-line"
    dps:
      - id: 134
        name: sensor
        type: integer
        class: measurement
        unit: "h"        
        readonly: true
  - entity: sensor
    name: Electricity Consumption 1
    icon: "mdi:lightning-bolt"
    dps:
      - id: 135
        name: sensor
        type: integer
        unit: "W"
        class: measurement
        readonly: true
  - entity: sensor
    name: Estimated Hot Water
    icon: "mdi:hot-tub"
    dps:
      - id: 156
        name: sensor
        type: integer
        unit: "L"
        class: measurement
        readonly: true
        mapping:
        - scale: 10
  - entity: sensor
    name: Electricity Consumption 2
    icon: "mdi:lightning-bolt"
    dps:
      - id: 157
        name: sensor
        type: integer
        unit: "W"
        class: measurement
        readonly: true
  - entity: sensor
    name: Electricity Consumption 3
    icon: "mdi:lightning-bolt"
    dps:
      - id: 158
        name: sensor
        type: integer
        unit: "W"
        class: measurement
        readonly: true
  - entity: select
    category: config
    name: Product model of HP/TANK
    dps:
      - id: 139
        type: string