make-all / tuya-local

Local support for Tuya devices in Home Assistant
MIT License
1.07k stars 432 forks source link

Request support for Pool Heater (智能热泵) #1580

Closed TroLoos closed 1 month ago

TroLoos commented 5 months ago

Log Message

2024-01-30 21:19:27.960 DEBUG (MainThread) [custom_components.tuya_local.device] Refreshing device state for Test
2024-01-30 21:19:27.960 INFO (MainThread) [custom_components.tuya_local.device] Setting protocol version for Test to 3.3
2024-01-30 21:19:27.976 DEBUG (SyncWorker_20) [custom_components.tuya_local.device] Test refreshed device state: {"dps": {"1": false, "2": "eco_heat", "3": true, "4": 28, "25": 4, "26": 3, "104": "7"}}
2024-01-30 21:19:27.977 DEBUG (SyncWorker_20) [custom_components.tuya_local.device] new state (incl pending): {"updated_at": 1706645967.9768229, "1": false, "2": "eco_heat", "3": true, "4": 28, "25": 4, "26": 3, "104": "7"}

2024-01-30 21:19:27.986 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Loaded device ...
2024-01-30 21:19:27.986 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Not match for ....

2024-01-30 21:19:29.525 WARNING (MainThread) [custom_components.tuya_local.config_flow] Device matches mellerware_citymove_vacuum with quality of 29%. DPS: {"updated_at": 1706645967.9768229, "1": false, "2": "eco_heat", "3": true, "4": 28, "25": 4, "26": 3, "104": "7"}

Information about DPS mappings


Code | Type | Values
id 1 - heating on/off - switch | Boolean | "{true,false}"
id 2 - mode - mode | Enum | {   "range": [     "cold",     "heating",     "auto"   ] }
id 3 - child lock - child_lock | Boolean | "{true,false}"
id 4 - pool heater set temp - temp_set | Integer | {   "unit": "℃",   "min": 5,   "max": 80,   "scale": 0,   "step": 1 }
(don't know the id, I suppose it is 104) timer | Raw | {}
id 25 - temperature (in) - temp_effluent | Integer | {   "unit": "℃",   "min": 0,   "max": 150,   "scale": 0,   "step": 1 }
id 26 - temperature (out) - temp_around | Integer | {   "unit": "℃",   "min": 0,   "max": 150,   "scale": 0,   "step": 1 }

Product ID

not sure where to get it from (no access to Tuya Dev account)

Information about how the device functions

It's a standard pool heat pump, with set temperature. It reports two kinds of temperatures, one on intake and one that leaves the heat pump. Steering is very simple - you can set heating mode (heating;eco_heat;cold), turn heating on/off.

I don't have access to Tuya Developer account so I gathered as much information as possible. If there's anything else I could provide please let me know.

TroLoos commented 5 months ago

Actually, I learned something new and created supported configuration for this heat pump. Great integration by the way, have been using the other one with no templates and this is so much better, really appreciated!

name: Pool Heater       
products:
  - id: xxxxxxxxxxxxxxxxx
    name: Pool Heater
primary_entity:
  entity: climate
  translation_key: pool_heatpump
  dps:
    - id: 1
      name: hvac_mode
      type: boolean
      mapping:
        - dps_val: false
          value: "off"
          icon: "mdi:hvac-off"
          icon_priority: 1
        - dps_val: true
          value: "heat"
          icon: "mdi:hot-tub"
          icon_priority: 3
    - id: 2
      name: preset_mode
      type: string
      mapping:
        - dps_val: eco_heat
          value: eco_heat
        - dps_val: cold
          value: cold
        - dps_val: heating
          value: heating
    - id: 4
      name: temperature
      type: integer
      range:
        min: 5
        max: 40
    - id: 26
      name: current_temperature
      type: integer
secondary_entities:
  - entity: sensor
    class: temperature
    name: Water Intake Temperature
    dps:
      - id: 25
        name: sensor
        type: integer
        unit: "°C"
        class: measurement
  - entity: sensor
    class: temperature
    name: Water Output Temperature
    dps:            
      - id: 26      
        name: sensor
        type: integer
        unit: "°C"    
        class: measurement
  - entity: switch
    category: config
    name: Child Lock
    icon: "mdi:lock"
    dps:
      - id: 3
        name: switch
        type: boolean
make-all commented 4 months ago

Product id is also broadcast as part of the Tuya discovery protocol, which is supported by tinytuya, so you can find it by using tinytuya to scan for Tuya devices on your local network. Although this integration does not currently support discovery, possible future use is the reason why I try to add the info to the configs now, as it should be a mor reliable way of recognising devices than matching the dps as is done now.

Some info about the manufacturer, brand and/or model number would also help, as this is certainly not a generic product, and needs to be differentiated from all the other supported pool heatpumps somehow.

TroLoos commented 2 months ago

Hi, is this a proper device id?

ebef86cfbc77a3f8e5fazq

If not - do you have any instruction on how to obtain it the easiest way :-)?

make-all commented 1 month ago

That looks like a device id to me, product id is usually a bit shorter. If you do not have access to the iot.tuya.com portal, you can also get it from the tinytuya scan output I think.

TroLoos commented 1 month ago

That looks like a device id to me, product id is usually a bit shorter. If you do not have access to the iot.tuya.com portal, you can also get it from the tinytuya scan output I think.

Yes, you are right. It wasn't easy but I think I got it. I installed tinytuya via docker container and my device id:

kirzfzcxypdjo2ay

I think you got all to include it, thanks a lot for your help and support!

make-all commented 1 month ago

The information about manufacturer and/or model number is still missing. This sort of device is not really generic, so it doesn't make sense to list it as just Pool heater. There must be something identifying about it, in the manual, or on the setplate.

TroLoos commented 1 month ago

Yes, you are right - here it is:

Manufacturer: Pro-Energy Model: PE08

I didn't provide these information as I think that this sort of controller is a generic one and might be used more commonly than only for this product. The manufacturer is a local polish company so these products are produced for them and dedicated to polish market.

You can see the manual that shows wifi/app configuration steps: https://www.pro-energy.com.pl/instalacja-pompy-basenowe.pdf

make-all commented 1 month ago

Probably there are other brands for the same device, but it helps to have one to start with to differentiate it.