Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add heater of Large Home Appliances #152

Merged
merged 22 commits into from
Aug 19, 2024

Conversation

bogguard
Copy link
Contributor

@bogguard bogguard commented Aug 15, 2024

Adds support to include small and large heater instance.

Device and Specification :

 {
  "device": {
    "active_time": 1688287178,
    "biz_type": 18,
    "category": "rs",
    "create_time": 1688285375,
    "icon": "smart/icon/ay1513418289516FAXSV/df2cf842ab71c359308c3814492d5ee9.png",
    "id": "bfff3ce552aa537acbjj39",
    "ip": "<redacted>",
    "lat": "<redacted>",
    "local_key": "<redacted>",
    "lon": "<redacted>",
    "model": "RCDF211344",
    "name": "Weau pool heat pump",
    "online": true,
    "owner_id": "<redacted>",
    "product_id": "zqwet1zcvj2wcxzw",
    "product_name": "Weau pool heat pump",
    "status": [
      {
        "code": "switch",
        "value": true
      },
      {
        "code": "mode",
        "value": "eheat"
      },
      {
        "code": "temp_set",
        "value": 28
      },
      {
        "code": "temp_current",
        "value": 253
      },
      {
        "code": "fault",
        "value": 4
      }
    ],
    "sub": false,
    "time_zone": "+02:00",
    "uid": "<redacted>",
    "update_time": 1723574253,
    "uuid": "<redacted>"
  },
  "specifications": {
    "category": "rs",
    "functions": [
      {
        "code": "switch",
        "desc": "{}",
        "name": "开关",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "mode",
        "desc": "{\"range\":[\"auto\"]}",
        "name": "模式",
        "type": "Enum",
        "values": "{\"range\":[\"auto\"]}"
      },
      {
        "code": "temp_set",
        "desc": "{\"unit\":\"\",\"min\":-500,\"max\":1000,\"scale\":0,\"step\":1}",
        "name": "温度设置",
        "type": "Integer",
        "values": "{\"unit\":\"\",\"min\":-500,\"max\":1000,\"scale\":0,\"step\":1}"
      }
    ],
    "status": [
      {
        "code": "switch",
        "name": "开关",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "mode",
        "name": "模式",
        "type": "Enum",
        "values": "{\"range\":[\"auto\"]}"
      },
      {
        "code": "temp_set",
        "name": "温度设置",
        "type": "Integer",
        "values": "{\"unit\":\"\",\"min\":-500,\"max\":1000,\"scale\":0,\"step\":1}"
      },
      {
        "code": "temp_current",
        "name": "当前温度",
        "type": "Integer",
        "values": "{\"unit\":\"\",\"min\":-1000,\"max\":1000,\"scale\":1,\"step\":1}"
      },
      {
        "code": "fault",
        "name": "故障告警",
        "type": "bitmap",
        "values": "{\"label\":[\"sys_high_fault\",\"sys_low_fault\",\"flow_fault\",\"power_fault\",\"cooling_fault\",\"heating_fault\",\"temp_dif_fault\",\"in_temp_fault\",\"eff_temp_fault\",\"coil_temp_fault\",\"ret_temp_fault\",\"news_fault\",\"amb_temp_fault\",\"lack_water\",\"serious_fault\",\"sensor_fault\",\"motor_fault\"],\"maxlen\":16}"
      }
    ]
  }
}

@bogguard
Copy link
Contributor Author

fyi, I tweaked the divide by 10 for the current temperature based on the max of the target_temperature. If it's above 100, I expect the value to be dived by 10.
This does expect that a heater value isn't going above 100 degrees, which should be fine based on the Tuya docs.

drivers/heater/device.ts Outdated Show resolved Hide resolved
drivers/heater/device.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@bobvandevijver bobvandevijver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, just the bitmap one left! I do also like to remove the mode completely for now.

app.json Outdated Show resolved Hide resolved
drivers/heater/TuyaHeaterConstants.ts Outdated Show resolved Hide resolved
drivers/heater/device.ts Outdated Show resolved Hide resolved
drivers/heater/device.ts Outdated Show resolved Hide resolved
drivers/heater/driver.ts Outdated Show resolved Hide resolved
drivers/heater/device.ts Outdated Show resolved Hide resolved
.homeycompose/capabilities/mode.json Outdated Show resolved Hide resolved
.homeycompose/capabilities/fault.json Show resolved Hide resolved
app.json Show resolved Hide resolved
bogguard and others added 8 commits August 16, 2024 09:58
Co-authored-by: Bob van de Vijver <[email protected]>
Co-authored-by: Bob van de Vijver <[email protected]>
Co-authored-by: Bob van de Vijver <[email protected]>
Co-authored-by: Bob van de Vijver <[email protected]>
Co-authored-by: Bob van de Vijver <[email protected]>
Co-authored-by: Bob van de Vijver <[email protected]>
@bobvandevijver
Copy link
Collaborator

@bogguard Looks you made a mistake with the rebase, can you solve that?

@bogguard bogguard marked this pull request as draft August 16, 2024 09:27
@bogguard bogguard marked this pull request as ready for review August 16, 2024 10:15
@bogguard
Copy link
Contributor Author

@bobvandevijver , cleaned up the current PR.
Takes into account your remarks and fixed the bitmap.

Copy link
Collaborator

@JELoohuis JELoohuis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall! Just some feedback on storing the fault labels.

drivers/heater/device.ts Outdated Show resolved Hide resolved
drivers/heater/driver.ts Outdated Show resolved Hide resolved
@JELoohuis JELoohuis mentioned this pull request Aug 16, 2024
@bogguard
Copy link
Contributor Author

@JELoohuis , tweaked the fault labels so they are now within the store and have a default fallback value when no specification is available

Copy link
Collaborator

@bobvandevijver bobvandevijver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bogguard Great work and thank you for making all requested updates each time! I do hope our comments on the PR weren't frustrating you too much (I know I might have become frustrated), but I do know that you can now say you have made a great contribution to this app 👍🏻

@bobvandevijver bobvandevijver merged commit 11f8c97 into athombv:master Aug 19, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants