[RELEASE] Dywarmic Smart Towel Warmer - Local Control

Integrate your Dywarmic Smart Towel Warmer connected to your local WiFi network to the Hubitat environment.

Features

Feature Description
Hubitat local direct device API access Local WiFi connectivity which eliminates cloud dependency
Switch * Turn On
* Turn Off
Set/Change Countdown Duration Timer * Set/Cancel warming duration in intervals of 20-minute increments
Set Countdown Duration Timer Default * Set countdown duration timer default value when towel warmer is switched on
Reduce hub events * Reduce frequent 'current temperature' events by only creating an event to the hub every ± delta N° units.
* Ignore nonessential towel warmer events.
Device API Debugging * Custom Data To Device
* Send Custom JSON Object
Set Features * Child Lock
* Eco
* Light
Refresh Updates device states
  • *The Dywarmic Towel Warmer device driver controls Powered by tuya (PBT) devices. It's based on tuya's Open API

Prerequisites

Installation

Install Dywarmic Towel Warmer Application on your Hubitat Hub

  • Add Dywarmic Towel Warmer application using Hubitat Package Manager by selecting 'Install', and searching for 'Dywarmic Towel Warmer' or by tags 'Bathroom' or 'Temperature' or 'Pools & Spas'.

  • Allow HPM to automatically launch the Dywarmic Towel Warmer app which will create a virtual child device (Dywarmic Towel Warmer device driver) which you can name, ie 'Towel Warmer'.

  • Verify this new device has been created in your devices view

Preparation

  1. Read tuya IoT Platform Configuration documentation
  2. Driver username and password: The username and password of the tuya Smart or Smart Life app that you used to link devices on the tuya IoT Platform.
  3. Driver accessId and accessKey are your cloud project's Access ID and Access Secret, respectively. Go to the tuya IoT Platform and select your cloud project. Click Project Overview and find the Access ID and Access Secret.
  4. Determine your towel warmers' local_key.

tuya Wifi Hubitat device Drivers

  • This integration utilizes the API tuya protocol, which connects to the device on the local network, i.e., not via the tuya servers, to control and read the status of devices. This Hubitat device driver supports versions 3.1 - 3.4 of the tuya API protocol.

    • The Dywarmic Towel Warmer uses tuya API protocol 3.4
  • All tuya devices are communicating over the network using AES ECB encryption. The key for encrypting and decrypting is created to pair the device with the SmartLife mobile app. One needs to obtain this key to use this Hubitat device driver.

How to get the Hubitat tuya integration working?

  1. You need to get the Dywarmic Towel Warmer device ID, device key, device local ip-address, and device endpoints by following this tuya Guide and the 'Install steps' listed below.

Be aware that a new local key may be generated when a new device is added to or paired with the SmartLife app; hence, it must be updated when/if you get another device and add it to Smart Life!

Install Steps

  1. Install the latest version of Python on a computer, if needed.
  2. Install the Tinytuya module on this same computer.
  3. Install the Smart Life app (Apple or Google) and pair all devices you want to use in Hubitat. Refer to the device user guide on how to pair the device.
  4. Scan your network for the paired tuya devices by writing the following in the Unix/Dos command line python -m tinytuya scan
  5. Create a iot.tuya.com developer account and log on. Connect your SmartLife app to this developer account using these instructions.
  6. Run the tinytuya wizard
  7. Now you should have a full overview of everything you need to get the Hubitat device driver working
  8. In Hubitat, open "Devices", then click "Add Device", and click "Virtual".
  9. Give the device a Device Name" and select the Type: "Hubitat SmartLife Integration", and click "Save Device."
  10. Now, add the "Device IP", "Device ID", "Device local Key" and select the tuya protocol version that you got from point 6.
  11. Lastly, set the Endpoint you want to control. During step 6, you should see something called "Status" together with each device, something like this: Status: {'1': False, '2': False, '3': False, '5': 0}, the endpoints are the numbers in front of the False. This status block is for a "Dywarmic Towel Warmer", where each number corresponds to a status of the device.
  12. Click "Save Preferences"
  13. You should now be able to control your Towel Warmer device via Hubitat on the local network only.
  • It is highly recommended that you lock a static IP on your (wifi)router to the towel warmer device so it does not change its IP address. If it gets a new ip address, then this Hubitat integration won't be able to find the device, and you will need to change the ip address in the device driver preferences.

Special Credit

  • I thank and credit both @holand.ivar and @kkossev for their valued work on the Tuya API protocols and encryption in their various Tuya device drivers. I am fortunate to learn from their diverse examples, which allowed me to create this local device integration.

FAQ

Q: Will I be billed after the 1-year free trial of the API product expires?

A: After expiration, you can renew the subscription for free. The Trial Edition allows you to use all free API products but limits the quota of API calls. For more information about the quota, see Pricing.

Q: Issues / Limitations

  • Updates to a towel warmer firmware or API may render this custom device driver's connectivity in the future. Please report to Habitat's open forum support thread.

GitHub: Hubitat-Dywarmic-Integration

Filename Type Version
SanderSoft-Library.groovy Library Version 0.0.4
Dywarmic Towel Warmer Integration.groovy App Version 0.0.1
Dywarmic Towel Warmer.groovy Driver 0.0.1

Version 0.0.1 (1/6/2024)

  • Added to HPM
  • User specified control of frequent reported temperature events by ± temperature delta.
  • Set Countdown Duration Timer Default (when switched on)
3 Likes