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

New Driver - Kogan Smart Heater #476

Closed
rodgrech opened this issue Sep 17, 2021 · 38 comments
Closed

New Driver - Kogan Smart Heater #476

rodgrech opened this issue Sep 17, 2021 · 38 comments
Labels
enhancement Request new features help wanted Extra attention is needed

Comments

@rodgrech
Copy link

rodgrech commented Sep 17, 2021

while this shows up in HA now, i have no control over its state

Device normal info

  • Kogan

  • Kogan Panel Heater - KAWFHTP15BA / KAHTP15WALA

    {
    "active_time": 1627895893,
    "biz_type": 0,
    "category": "qn",
    "create_time": 1627895893,
    "icon": "smart/icon/1470624702_0.jpeg",
    "id": “xxxx ",
    "ip": "",
    "lat": "
    ",
    "local_key": "",
    "lon": "
    ",
    "name": "Bedroom heater",
    "online": true,
    "owner_id": "23484236",
    "product_id": "ynjanlglr4qa6dxf",
    "product_name": "Panel heater",
    "status": [
    {
    "code": "switch",
    "value": false
    },
    {
    "code": "temp_set",
    "value": 25
    },
    {
    "code": "temp_current",
    "value": 19
    }
    ],
    "sub": false,
    "time_zone": "+10:00",
    "uid": "***",
    "update_time": 1631720829,
    "uuid": "0014083010521c49f20a"
    },

    "sub": false,
    "time_zone": "+10:00",
    "uid": "***",
    "update_time": 1631720829,
    "uuid": "0014083010521c49f20a"
    

    },

Device specifications
2021-09-18 08:26:33 DEBUG (SyncWorker_6) [tuya iot] Request: method = GET, url = https://openapi.tuyaeu.com/v1.0/devices/xxxxx/specifications, params = None, body = None, t = 1631917593164
2021-09-18 08:26:33 DEBUG (Thread-25) [tuya iot] _on_log: Received PUBLISH (d0, q0, r0, m0), 'cloud/token/in/ebc1d658bf210987387c9f4d12782ce2', ... (284 bytes)
2021-09-18 08:26:33 DEBUG (Thread-25) [tuya iot] payload-> b'{"data":"JFYot1AkACi8/Ur2AvTCi3qltBYwgPLSJE1YUp2CUYLVDfkFVEIu0HrN+DDEC/uA30I2NnsvKp0PqavUK5p6+2QiO6QlCEtkkzxqFzKYNWxMrTh7bOcdtlB60wzimmmtVhPwPLhtAwgQaCu5WeOT9m6lumAfCbOsThm8glBZvTgjlDYEccpKuYPzJEOBdMLP","protocol":4,"pv":"2.0","sign":"60e1f36e5c5c57e0246d96ace8e56e37","t":1631917592}'
2021-09-18 08:26:33 DEBUG (Thread-25) [tuya iot] on_message: {'data': {'dataId': 'c8013806-594e-4521-ba79-685fc9d3270a', 'devId': '7312002040f5201c02cc', 'productKey': 'GXoLAzy1gQUbckKe', 'status': [{'5': 53}]}, 'protocol': 4, 'pv': '2.0', 'sign': '60e1f36e5c5c57e0246d96ace8e56e37', 't': 1631917592}
2021-09-18 08:26:33 DEBUG (Thread-25) [tuya iot] mq receive-> {'data': {'dataId': 'c8013806-594e-4521-ba79-685fc9d3270a', 'devId': '7312002040f5201c02cc', 'productKey': 'GXoLAzy1gQUbckKe', 'status': [{'5': 53}]}, 'protocol': 4, 'pv': '2.0', 'sign': '60e1f36e5c5c57e0246d96ace8e56e37', 't': 1631917592}
2021-09-18 08:26:33 DEBUG (Thread-25) [tuya iot] mq _on_device_report-> [{'5': 53}]
2021-09-18 08:26:33 DEBUG (SyncWorker_6) [tuya iot] Response: {
"result": {
"category": "qn",
"functions": [
{
"code": "switch",
"type": "Boolean",
"values": "{}"
},
{
"code": "temp_set",
"type": "Integer",
"values": "{"unit":"℃","min":5,"max":40,"scale":0,"step":1}"
}
],
"status": [
{
"code": "switch",
"type": "Boolean",
"values": "{}"
},
{
"code": "temp_set",
"type": "Integer",
"values": "{"unit":"℃","min":5,"max":40,"scale":0,"step":1}"
},
{
"code": "temp_current",
"type": "Integer",
"values": "{"unit":"℃","min":0,"max":100,"scale":0,"step":1}"
}
]
},
"success": true,
"t": 163191759334

@rodgrech rodgrech added enhancement Request new features help wanted Extra attention is needed labels Sep 17, 2021
@some-guy-in-oz
Copy link

As per the other thread, remove the id from the samples you gave above. This one looks like it should already be supported and allow you to turn it on/off and set the temperature, as well as report if its on/off, what the temperature is and what it is set to be.
According to this page
https://github.com/tuya/tuya-home-assistant/wiki/Supported-Device-Category?_source=f5f782752be3c4a9157ec47514d6091b support for that category of device was added in version 1.1 of the integration.

@rodgrech
Copy link
Author

rodgrech commented Sep 18, 2021 via email

@some-guy-in-oz
Copy link

some-guy-in-oz commented Sep 18, 2021

I dont see that screenshot... Have you customised your lovelace interface at all? I usually have a "default" one that I let HA manage and it puts everything on it... The heater should be under a "Switch" section if you haven't assigned it to a room like this example that shows a holman WX8 irrigation system

image

@rodgrech
Copy link
Author

Firstly thank you for your help with this

the image must of not come through via the email reply
no custom lovelace and just in my default test enviroment and nothing comes up under operation
image

@some-guy-in-oz
Copy link

What shows under configuration > entities? There should be a switch for it. If you click the up/down arrows does the value next to the "Off" up the top change?
image

@rodgrech
Copy link
Author

rodgrech commented Sep 18, 2021

@some-guy-in-oz the value changes no issue
under config > entitites all i get is a climate entity and not a switch entity
image
edited remove of deviceID

@some-guy-in-oz
Copy link

Does anything show when you try to pick a device via Developer Tools > Services for "Climate: Turn off"?
image

@rodgrech
Copy link
Author

So I have the following services
D53E9475-7872-443E-A892-F3B393478B7B
Calling these services does nothing

interestingly enough haven’t ng it set as below will turn it on
97A1FA40-3B4E-4DE7-9B0B-F739996CAACA

@some-guy-in-oz
Copy link

Hmm it should be the turn on/turn off commands - when you choose them are you able to select any devices or entities?
Is the heater already running in some sort of "auto" mode? If so then just adjusting the temperature should turn it on/off.

@rodgrech
Copy link
Author

rodgrech commented Sep 19, 2021 via email

@some-guy-in-oz
Copy link

some-guy-in-oz commented Sep 19, 2021

OK looking at the code I see it's expecting to find some "modes" that the heater supports and the API isn't sending any modes. I imagine that if there are no modes supported but the "switch" is supported it should just offer an "off" and "auto" option. I can patch the file for you test, but how are you running Home Assistant and are you comfortable replacing files to test it out?

@rodgrech
Copy link
Author

rodgrech commented Sep 19, 2021 via email

@some-guy-in-oz
Copy link

OK.. unzip and replace this file in your install. If you installed tuya v2 via hacs it'll be in the hacs subfolder somewhere, otherwise it'll be in the home assistant components subfolder.
climate.zip
It'll just give you two options, "auto" and "off" with appropriate icons. In my test it looks like a "calendar" icon for the auto and a "power" icon for off. It would be nice to just have a single button for on/off but it appears that's not how home assistants default climate widget works so if you just want a single button you'll probably need to code up the yaml yourself.
I used my watering irrigator to test it out, and this is what it looks like (obviously it doesn't provide a temperature)
image

@some-guy-in-oz
Copy link

You might also like to try using the "HEAT" icon instead... If the above works, edit lines 364 & 372 replacing HVAC_MODE_AUTO with HVAC_MODE_HEAT

@rodgrech
Copy link
Author

rodgrech commented Sep 19, 2021 via email

@rodgrech
Copy link
Author

climate.zip
modfied file with heat button instead of auto.

ive rebooted HA a few times to make sure theres no oddities and it seems solid @some-guy-in-oz

@some-guy-in-oz
Copy link

OK. The tuya devs won't accept it hard coded to heat as the climate entity also controls humidity and a/cs. I'm just trying out some changes that sets it to heat only if its a heater. Once I've finished testing I'll post here for you to try it out and if that works I'll submit the patch to the tuya devs so it can make its way to mainstream.

@rodgrech
Copy link
Author

you're a legend mate.

shoot it through and ill test for ya

@some-guy-in-oz
Copy link

Can you try out the enclosed file, make sure it allows turning on and off and temperature adjustment.
climate.zip

@some-guy-in-oz
Copy link

This will probably fix #78, #149, #197, #208, #249 & #357

@rodgrech
Copy link
Author

so close

image
so when you turn the heater on via HA, the device turns on, tuya app reports its on but home assistant state doesnt change and it still thinks its off

@some-guy-in-oz
Copy link

Did it show on using the first file I posted or has it never shown as on (the icon should change colour to show when it's on too). What happens if you turn the device on and then restart home assistant? Does it show on then?

@rodgrech
Copy link
Author

rodgrech commented Sep 20, 2021 via email

@some-guy-in-oz
Copy link

Do the "target temperature" reading change if you adjust them via the tuya app or on the device itself?

@rodgrech
Copy link
Author

rodgrech commented Sep 20, 2021 via email

@some-guy-in-oz
Copy link

They change in home assistant too? Does the first set of files I uploaded work with switching it on/off?

@rodgrech
Copy link
Author

rodgrech commented Sep 20, 2021 via email

@some-guy-in-oz
Copy link

OK so everything appears to be working now with that latest set of files too?

@rodgrech
Copy link
Author

rodgrech commented Sep 20, 2021 via email

@some-guy-in-oz
Copy link

Cool. I'll submit the patch. Thanks for testing

@SgtBatten
Copy link

@some-guy-in-oz i have not had time to digest this thread fully but seems you may be able to assist us with a similar issue in #28

@rodgrech rodgrech reopened this Oct 15, 2021
@rodgrech
Copy link
Author

reopening issue as this nolonger works under the new version of Tuya V2

@malosaa
Copy link

malosaa commented Oct 17, 2021

@some-guy-in-oz

could you take a look here, we all can't seem to fix this heater issue.
also missing LEVEL to set the fan level to 1-2-3.

#482

regards

@malosaa
Copy link

malosaa commented Oct 17, 2021

@rodgrech check my repo i think its fixed for you aswell.

can u test ?

link in this topic
#482

@some-guy-in-oz
Copy link

I still haven't had time to look any further at this, and since they've refactored 1.6 which probably changed a lot of stuff I can't comment until I've looked at the code.

@malosaa
Copy link

malosaa commented Oct 20, 2021

@some-guy-in-oz

ok, i did make a fix, but apperantly it breaks other heaters from other people...
just take your time, and if u find a fix let me know.

regards

@darth3pio
Copy link

Seems like a Kogan thing, my panel heater has the some problem.

@frenck
Copy link
Collaborator

frenck commented Oct 23, 2021

This has been fixed in Home Assistant Core integration and is released with the upcoming Home Assistant Core 2021.11.

@frenck frenck closed this as completed Oct 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Request new features help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants