tuya / tuya-home-assistant

Home Assistant integration for controlling Powered by Tuya (PBT) devices using Tuya Open API, maintained by the Home Assistant Community and Tuya Developer Team.
MIT License
869 stars 206 forks source link

Kogan SmarterHome™ 1.7L Smart Glass Kettle #56

Open rodgrech opened 3 years ago

rodgrech commented 3 years ago

Any chance of getting any of the kogan smarterhome range into tuya2 intergration. its the only reason i am staying with the V1

https://www.kogan.com/au/buy/kogan-smarterhome-17l-smart-glass-kettle/ model: "KASMCDSKTLA", name: "Kogan smart kettle",

2021-07-04 15:43:59 DEBUG (Thread-8) [tuya iot] connecting ssl://m1.tuyaeu.com:8883 2021-07-04 15:44:00 DEBUG (SyncWorker_6) [tuya iot] Response: { "result": [ { "active_time": 1621928820, "biz_type": 0, "category": "bh", "create_time": 1621928820, "icon": "smart/icon/1556262669dq8dq3rifuv_0.png", "id": "7312002040f5201c02cc", "ip": "XXXXXXXXXX", "lat": "XXXXXX", "local_key": "XXXXXX", "lon": "XXXXXXX", "model": "KASMCDSKTLA", "name": "Kogan smart kettle", "online": true, "owner_id": "23484236", "product_id": "GXoLAzy1gQUbckKe", "product_name": "Kogan smart kettle", "status": [ { "code": "start", "value": false } ], "sub": false, "time_zone": "+10:00", "uid": "eu1609970476224VfVbf", "update_time": 1625377371, "uuid": "7312002040f5201c02cc" },

Device Info 2021-07-04 15:44:00 DEBUG (SyncWorker_6) [tuya iot] Request: method = GET, url = https://openapi.tuyaeu.com/v1.0/devices/7312002040f5201c02cc/specifications, params = None, body = None, headers = {'client_id': 'xxxxxxx', 'sign': 'xxxxxx', 'sign_method': 'HMAC-SHA256', 'access_token': 'xxxx', 't': '1625377440649', 'lang': 'en'} 2021-07-04 15:44:00 DEBUG (Thread-8) [tuya iot] _on_log: Sending CONNECT (u1, p1, wr0, wq0, wf0, c1, k60) client_id=b'cloud_xxxxx' 2021-07-04 15:44:01 DEBUG (Thread-9) [tuya iot] _on_log: Received CONNACK (0, 0) 2021-07-04 15:44:01 DEBUG (Thread-9) [tuya iot] connect flags->{'session present': 0}, rc->0 2021-07-04 15:44:01 DEBUG (Thread-9) [tuya iot] _on_log: Sending SUBSCRIBE (d0, m1) [(b'cloud/token/in/ebc1d658bf210987387c9f4d12782ce2', 0)] 2021-07-04 15:44:01 DEBUG (SyncWorker_6) [tuya iot] Response: { "result": { "category": "bh", "functions": [ { "code": "start", "type": "Boolean", "values": "{}" } ], "status": [ { "code": "start", "type": "Boolean", "values": "{}" } ] }, "success": true, "t": 1625377440886 }

sambarlick commented 3 years ago

Yes please! I came on here to ask the same thing! I would also like to add the ability in V2 to be able select the "keep warm" temperatures as you can in the app.

frankosborne commented 3 years ago

Hey guys.

I have created a pull request to add support for the kettle (I own one of these kogan ones too and I love it! ). :)

frankosborne commented 3 years ago

@tsutsuku. Seeking your advice on how the status set for product id: GXoLAzy1gQUbckKe works. In the app we have greater control of the device. Setting keep warm temps as well as current temp. When I look at the instruction set and status set for the device, none of it is there. Just the status "start" item. Is there something I am missing? Thought you may be able to see more in the back end on how the product is working.

rodgrech commented 3 years ago

@tsutsuku, as @frankosborne stated above, within the kogan and tuya apps there is greater control of the kettle such as keep warm and current temp. is this something that would be able to be road mapped in future updates of the component.

i have just manually loaded the files that were changed 2 hrs ago and the kettle is now detected and working with on/off in HA

xbmcnut commented 3 years ago

I've got the same issue however my Tuya V2 version already has the modified code but the Kettle is not discovered. In my backend cloud account, I can see my two devices; my Kogan Panel Heater and the Kogan Kettle but both Tuya V2 and Google Home, only see the panel heater. Oddly, when adding Smart Life to Alexa, it can see both.

\config\custom_components\tuya_v2\switch.py

TUYA_SUPPORT_TYPE = {
    "kg",     # Switch
    "cz",     # Socket
    "pc",     # Power Strip
    "bh",     # Smart Kettle
    "dlq",    # Breaker
    "cwysj",  # Pet Water Feeder
    "kj",     # Air Purifier
    "xxj"     # Diffuser
}

# Switch(kg), Socket(cz), Power Strip(pc)
# https://developer.tuya.com/en/docs/iot/categorykgczpc?id=Kaiuz08zj1l4y
DPCODE_SWITCH = "switch"

# Air Purifier
# https://developer.tuya.com/en/docs/iot/categorykj?id=Kaiuz1atqo5l7
# Pet Water Feeder
# https://developer.tuya.com/en/docs/iot/f?id=K9gf46aewxem5
DPCODE_ANION = "anion"        # Air Purifier - Ionizer unit
# Air Purifier - Filter cartridge resetting; Pet Water Feeder - Filter cartridge resetting
DPCODE_FRESET = "filter_reset"
DPCODE_LIGHT = "light"        # Air Purifier - Light
DPCODE_LOCK = "lock"         # Air Purifier - Child lock
# Air Purifier - UV sterilization; Pet Water Feeder - UV sterilization
DPCODE_UV = "uv"
DPCODE_WET = "wet"          # Air Purifier - Humidification unit
DPCODE_PRESET = "pump_reset"   # Pet Water Feeder - Water pump resetting
DPCODE_WRESET = "water_reset"  # Pet Water Feeder - Resetting of water usage days

DPCODE_START = "start"