core icon indicating copy to clipboard operation
core copied to clipboard

Tuya smart water timer

Open athanasio opened this issue 3 years ago • 15 comments

Proposed change

Add support for Moes Smart Water Timer (BLE). Device has been tested while connected to a Moes BLE Mesh Gateway. Supported functions:

  • Switch on/off
  • Status reporting (idle, manual, auto)
  • One-off countdown timer
  • Set/Disable weather delay
  • Battery percentage
  • Total runtime reporting
  • Current weather conditions for selected location

Type of change

  • [ ] Dependency upgrade
  • [ ] Bugfix (non-breaking change which fixes an issue)
  • [ ] New integration (thank you!)
  • [x] New feature (which adds functionality to an existing integration)
  • [ ] Deprecation (breaking change to happen in the future)
  • [ ] Breaking change (fix/feature causing existing functionality to break)
  • [ ] Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #72029
  • This PR is related to issue: #75955 which was closed because noone reviewed it and closed due to inactivity
  • Link to documentation pull request:

PR contains very little code, if any. It is using the existing tuya integration and adds the device sensor, switches etc based on the tuya cloud API implementation. No new calls have been implemented, no additional dependencies, everything is achieved with the existing codebase.

Checklist

  • [x] The code change is tested and works locally.
  • [x] Local tests pass. Your PR cannot be merged unless tests pass
  • [x] There is no commented out code in this PR.
  • [x] I have followed the development checklist
  • [x] The code has been formatted using Black (black --fast homeassistant tests)
  • [x] Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • [ ] The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • [ ] New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • [ ] For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • [ ] Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • [ ] No score or internal
  • [ ] 🥈 Silver
  • [ ] 🥇 Gold
  • [ ] 🏆 Platinum

To help with the load of incoming pull requests:

athanasio avatar Sep 25 '22 10:09 athanasio

Hello @frenck , what is required from me in order for you (or someone else) to review this change?

athanasio avatar Sep 25 '22 10:09 athanasio

Patience

frenck avatar Sep 25 '22 10:09 frenck

Patience

I have plenty! Thanks for looking at the PR.

athanasio avatar Sep 25 '22 10:09 athanasio

Any chance this can be reviewed before it goes into inactivity for the second time? Also, how can I get a maintainer to approve running workflows since this is my first time I contribute?

athanasio avatar Oct 15 '22 19:10 athanasio

I can confirm this PR works fine with Smart Water timer branded Johgee

fcrozat avatar Oct 27 '22 13:10 fcrozat

Hello @frenck , any chance we could get this reviewed and approved, this side of Xmas?

athanasio avatar Dec 15 '22 00:12 athanasio

Roping in @Tuya @zlinoliver , please help.

athanasio avatar Dec 15 '22 12:12 athanasio

Checking to see if there is any progress update here? I am eager to get this working...

millercentral avatar Apr 10 '23 23:04 millercentral

I am also interested to get this working.. I have a similar device (WiFi/Bt Water Timer HCT-611 from Ningbo) currently not supported by any Tuya HA integration..

spanzetta avatar May 02 '23 19:05 spanzetta

Hoping this will also work with the RainPoint/Tuya TTV103WRF Smart Hose Watering Timer with Wi-Fi hub (configured with Tuya app)

millercentral avatar May 02 '23 19:05 millercentral

These are the PD_ID details of my product (WiFi/Bt Water Timer HCT-611 from Ningbo)

WiFi/BT Water Timer model HCT-611

Request URL curl --request GET "https://openapi.tuyaeu.com/v1.1/devices/bf6daentucppaufp/specifications" --header "sign_method: HMAC-SHA256" --header "client_id: jwk9e4nr5v37vtgf3qqv" --header "t: 1682258055227" --header "mode: cors" --header "Content-Type: application/json" --header "sign: 1476E412813E653CDE4183B75F9959ACDA019D9D26DD5BA1AF2ADCE8DC0C39B3" --header "access_token: 7d5141300a8c6c922f2979a507cfe54e" Response { "result": { "category": "sfkzq", "functions": [ { "code": "switch", "dp_id": 1, "type": "Boolean", "values": "{}" }, { "code": "weather_delay", "dp_id": 10, "type": "Enum", "values": "{"range":["cancel","24h","48h","72h"]}" }, { "code": "countdown", "dp_id": 11, "type": "Integer", "values": "{"unit":"s","min":0,"max":86400,"scale":0,"step":1}" }, { "code": "smart_weather", "dp_id": 13, "type": "Enum", "values": "{"range":["sunny","clear","cloud","cloudy","rainy","snow","fog"]}" } ], "status": [ { "code": "switch", "dp_id": 1, "type": "Boolean", "values": "{}" }, { "code": "battery_percentage", "dp_id": 7, "type": "Integer", "values": "{"unit":"%","min":0,"max":5,"scale":0,"step":1}" }, { "code": "battery_state", "dp_id": 8, "type": "Enum", "values": "{"range":["low","middle","high"]}" }, { "code": "weather_delay", "dp_id": 10, "type": "Enum", "values": "{"range":["cancel","24h","48h","72h"]}" }, { "code": "countdown", "dp_id": 11, "type": "Integer", "values": "{"unit":"s","min":0,"max":86400,"scale":0,"step":1}" }, { "code": "work_state", "dp_id": 12, "type": "Enum", "values": "{"range":["auto","manual","idle"]}" }, { "code": "smart_weather", "dp_id": 13, "type": "Enum", "values": "{"range":["sunny","clear","cloud","cloudy","rainy","snow","fog"]}" } ] }, "success": true, "t": 1682196920684, "tid": "fe7693cae14f11ed847f92e270c72120" }

Bluetooth Gateway model HCG-001-C

Request URL curl --request GET "https://openapi.tuyaeu.com/v1.1/devices/bfc857c6b09c82e72a2aeg /specifications" --header "sign_method: HMAC-SHA256" --header "client_id: jwk9e4nr5v37vtgf3qqv" --header "t: 1682258137187" --header "mode: cors" --header "Content-Type: application/json" --header "sign: 9B8234192C7909F0B3164F12A1BB12F90E6E511B984F891003C6A1C28CF5D771" --header "access_token: 7d5141300a8c6c922f2979a507cfe54e" Response { "code": 1106, "msg": "permission deny", "success": false, "t": 1682258110751, "tid": "7697f08ce1de11ed847f92e270c72120" }

spanzetta avatar May 03 '23 08:05 spanzetta

I have same problem with Moes Smart Water Timer (BLE), it was shown as unsupported device, but after instaling tuya custom from HACS, I saw device and its entities as supported... but all stay unavialable :)

josetta avatar May 03 '23 19:05 josetta

I'll make an attempt to rebase this change on the latest version and resubmit it with the required changes.

athanasio avatar May 03 '23 21:05 athanasio

@athanasio Any news on this? Thanks

spanzetta avatar Jun 05 '23 15:06 spanzetta

I past here also the screenshot of the Standard Instruction Set / Standard Status set of my device (HCT-611 Wifi Water timer).. Its gateway doesn't show (of course) and Standard Instruction Set. Again.. any chance to get it working? Thanks

image

image

spanzetta avatar Jun 05 '23 15:06 spanzetta

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. Thank you for your contributions.

github-actions[bot] avatar Sep 05 '23 07:09 github-actions[bot]

FYI, the "Tuya Local" custom integration in HACS (not to be confused with localtuya) now supports these water timers and hubs with fully local control. Setup can be tricky, but I've been using it for about a month and it works great.

millercentral avatar Sep 05 '23 15:09 millercentral

(Close + open to retrigger CI)

emontnemery avatar Nov 22 '23 15:11 emontnemery

@athanasio I'm setting this to draft since there are merge conflicts and unaddressed comment from January 2023. Please mark it as "ready for review" when the merge conflicts are fixed and review comments have been addressed 👍

Note: If you don't agree with a review comment, please reply to it and explain why

emontnemery avatar Nov 22 '23 15:11 emontnemery

Just FYI, the "Tuya Local" custom integration in HACS (not to be confused with "Local Tuya" now supports these wifi hose irrigation timers. I used this integration all summer for status and control of two tuya-sources RainPoint hose timers connected to a Wifi hub (this: https://www.rainpointonline.com/collections/wi-fi-hose-timers/products/ttv103wrf-twg004wrf-3-smart-watering-timer-with-wi-fi-hub) and it has worked great. It was a little tricky to get all the needed device-id, and "sub device ids", but once sorted it has been rock solid.

millercentral avatar Nov 22 '23 19:11 millercentral

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. If you are the author of this PR, please leave a comment if you want to keep it open. Also, please rebase your PR onto the latest dev branch to ensure that it's up to date with the latest changes. Thank you for your contribution!

github-actions[bot] avatar Jan 21 '24 21:01 github-actions[bot]