make-all / tuya-local

Local support for Tuya devices in Home Assistant
MIT License
1.09k stars 440 forks source link

Inverter Pool Heater not fully compatible #11

Closed Xeovar closed 3 years ago

Xeovar commented 3 years ago

Hi :) First thanks for great job on this integration :)

I have a pool heat inverter thermal pump which is compatible with Tuya, and mostly compatible with this integration. By mostly I mean it does somewhat work with any heater config selected - you see on/off status and you are able to turn on/off the device. However none of the heater config works for setting the target temperature and also none of them correctly reads the current set target temp or the current temp from sensor.

Would it be possible to extend this library to support this type of heater? If yes, what kind of data I need to provide?

make-all commented 3 years ago

The DPS IDs and their functionality is what is required. If you have root access to your phone, or one of the older insecure Tuya apps, then you can copy the schema file for the device from your phone. This has information (probably in Chinese, but it can be translated) about the purpose of each DPS id. Otherwise you can use tuya-cli or debug log messages in Home Assistant to observe the DPS messages and how they change when you change various settings on the device. This will let you figure out the most important DPS ids, probably there will be one or two left over that don't relate to any user control (error codes etc) which without the schema will just have to be ignored.

Xeovar commented 3 years ago

Thanks for the info, dont have rooted phone, so will go cli way. The heater is pretty straightforward, it has only one mode of operation (off/heat), two presets (smart/silent), target temperature and a current temperature sensor.

Xeovar commented 3 years ago

I have managed to read and reverse engineer DPS for the heater. The details below:

dps: { '1': true, ----- on/off '102': 28, --- current temp '103': true, -- unknown/unused '104': 100, --- current power % '105': 'warm', -- unknown/unused, probably default operation mode, cannot be changed '106': 30, ----- target temperature '107': 18, -- unknown/unused '108': 40, -- unknown/unused '115': 0, -- unknown/unused '116': 0, -- unknown/unused '117': true -- preset: silent = false, smart = true }

For the documentation: The heater brand is: GardenPac InverTech, by the manual it should be used with app named SmarterPool, but it is just a rebranded tuya app, and the heater can be connected to tuya app without issues.

Will that be sufficient to add this heater to the library?

make-all commented 3 years ago

This should be enough. The unknown '18' and '40' look likely to be a range, maybe there is some alarm generated if the temperature goes outside this range, or they could be read-only and declaring the limits of the target temperature for the UI, Actually the range of target temperature is needed - is it 18-40, or something else?

make-all commented 3 years ago

Also, is current power something you can set, or just a reading for monitoring purposes? If you can set it, what steps does it allow, and can it go down to 0, or is the lower limit something else?

Xeovar commented 3 years ago

Hi, thanks for reply, I did some more reverse engineering and added read-only / read/write tags to each dps.

dps: { '1': true, ----- r/w: on/off '102': 28, --- r/o: current temp '103': true, -- r/w: temp C/F false = F, true = C '104': 100, --- r/o: current power % '105': 'warm', -- r/o: unknown/unused, probably default operation mode, cannot be changed '106': 30, ----- r/w: target temperature (cannot be set below 18) '107': 18, -- r/o: unknown/unused probably minimum allowed for dps 106 '108': 40, -- r/o: unknown/unused no idea, 106 can be set above 40 '115': 0, -- r/o: unknown/unused '116': 0, -- r/o: unknown/unused '117': true -- r/w: preset: silent = false, smart = true }

For sake of documentation completeness, this is the link to the product: https://www.iot-pool.com/en/products/bomba-de-calor-garden-pac-full-inverter

Xeovar commented 3 years ago

I have also two bathroom wall/under ceiling heaters branded Pur Line Hoti M100 heaters (https://www.purline.es/hoti-m100--ean-8436545097380.htm), they work a bit better with existing heater configs than the pool heater, but far from working well. I have also reverse engineered their dps:

dps: { '1': false, r/w: on/off '2': 23, r/w: target temp '3': 23, r/o: current temp '5': 'off', r/w: heater mode: 'off', 'auto','1', '2' (1 true 5 off means just air blow no heating); '10': true, r/w: heater panel visible: true = panel off, false = panel on '11': '0', r/?: shutdown timer: '0' off, '1' 1h, '2' 2h, '3' 3h, '4' 4h '12': 0, r/w: shutdown timer: minutes untill shutdown. Set to 0 to turn off timer. Cant figure out how to turn on the timer '101': false, r/w: open window detection: true = on, false = off '102': false, r/w: swing: true on, false = off }

Not really sure hot to enable timer, it works from tuya app, but cant make tuya-cli trigger it. Probably it needs to set dps 11 and 12 in a single command or one by one and I am unable to simulate that without changes to tuya-cli.

I'd appreciate if you could add this one as well :) Thanks in advance

make-all commented 3 years ago

Please test the latest release to see if these two devices are now detected and working correctly.

The pool heater will work as a climate device only. The Purline heater should work as a climate device, light (for controlling display) and switch (for toggling the Open Window Detection).

Xeovar commented 3 years ago

Thank you so much, I'll test it as soon as I figure out how to get this integration updated inside my docker HA env, or new release comes out :)

make-all commented 3 years ago

If you are using HACS, you can click on the ... menu for the integration and select "Update Information" to find the new version before HACS next scheduled check. If you installed manually, then probably a git pull followed by a restart will do it.

Xeovar commented 3 years ago

Thanks for the pointers, after unfking my HACS install it all went smoothly. Tested everything today, both Garden Pac and Pur Line work without issues.

Thanks again for the great integration :)

make-all commented 3 years ago

If you go into Developer Tools, you should see a raw view of the entities with attributes listed. Does it appear in there? Not all display cards allow you to show attributes, you may need to use a different card, and edit the config for it manually to show the attribute in the UI.

On Thu, 11 Mar 2021 at 01:03, Xeovar notifications@github.com wrote:

Well, one question though, I'm trying to access reading on the Garden Pac current power % and cant seem to find the related attribute.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/make-all/tuya-local/issues/11#issuecomment-795318641, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACJNY66UYFQNNNDV33TQJJLTC5NZHANCNFSM4YM5XIAQ .

mikkaat commented 3 years ago

I have managed to read and reverse engineer DPS for the heater. The details below:

dps: { '1': true, ----- on/off '102': 28, --- current temp '103': true, -- unknown/unused ...

@Xeovar If at all possible, could you please help me with the command you entered (into the cli) to extract the dps dataset. As context, I have a heatpump which uses the InverGo app. I have extracted the ID and Local Key to the device, and am able to add it using the tuya-cli wizard command, but whenever i try to extract the dps data from the device, nothing is produced, and no error is produced either. I am entering as follows where the ######## are the actual numbers provided in the wizard: tuya-cli get --id ########## --key ########## --ip 10.0.20.170.

As further context, When i use the Tuya Local integration, i can either select Auto or gardenpac_heatpump in the configuration and i am presented status, current temp and set temp results, however i do not get a switch so that i can turn the heatpump on and off.

thanks in advance for your help.

make-all commented 3 years ago

This is what works for me:

tuya-cli get --id ##### --key ##### -a 

tuya-cli is generally able to automatically find the IP address, but if it doesn't you can add the --ip 10.0.20.170 back. I think your command is just missing the -a (fetch all), without which you need to specify a dps id to fetch.

Climate devices do not present a separate switch entity, there is a mode, which is set to HEAT when on, and OFF when off, and which shows up in lovelace in the bottom middle of the temperature dial.

mikkaat commented 3 years ago

Thank you again, I can confirm it is working perfectly, and it was in fact my stupidity of not trying to add the device to lovelace that was the cause.

thanks again.

peterforeman commented 2 years ago

Hi, thanks for reply, I did some more reverse engineering and added read-only / read/write tags to each dps.

dps: { '1': true, ----- r/w: on/off '102': 28, --- r/o: current temp '103': true, -- r/w: temp C/F false = F, true = C '104': 100, --- r/o: current power % '105': 'warm', -- r/o: unknown/unused, probably default operation mode, cannot be changed '106': 30, ----- r/w: target temperature (cannot be set below 18) '107': 18, -- r/o: unknown/unused probably minimum allowed for dps 106 '108': 40, -- r/o: unknown/unused no idea, 106 can be set above 40 '115': 0, -- r/o: unknown/unused '116': 0, -- r/o: unknown/unused '117': true -- r/w: preset: silent = false, smart = true }

For sake of documentation completeness, this is the link to the product: https://www.iot-pool.com/en/products/bomba-de-calor-garden-pac-full-inverter

I also have a Tuya (Fairland) heat pump for the pool and reverse engineered this: 103: bool, temperature unit fahrenheit (false) or celcius (true) 102: r/o int, temperature incoming water 104: r/o int, compressor power % 105: r/o int, operating mode (1=heat?) 106: int, setpoint 107: r/o int, minimum setpoint 108: r/o int, maximum setpoint 115: r/o int/bitmask, error codes (4 = no water flow) 116: r/o int/bitmask, unknown 117: bool, silent mode (false) or normal/boost (true) 120: r/o int, unknown (around 16, when pump on lowers, even saw this at -3, so maybe temperature something?) 122: r/o int, unknown 124: r/o int, unknown 125: r/o int, fan speed % 126: r/o int, unknown 127: r/o int, water temperature out? (unsure)

make-all commented 2 years ago

Fairland Inver-X is reportedly supported by the Madimack config, which has most of these already (I think the only new information is the details for 115).

But are you saying the model doesn't currently match anything and needs a new config? If so, is it a different Fairland model, or have later changes broken the compatibility between Fairland and the Madimack config (I haven't checked, but we may have added more dps based on further info for the Madimack model).

Thohacat commented 1 year ago

Hi,

I have a problem to integrate my heat pump. Please have a look on my picture:

image

My heat pump is fully connected to my network. Water flow is always reporting so I get an error if no water flow is detected. see following picture:

image

If I click on "Heizleistung" there are not values saved. It seems no values are saved:

image

But why I don't receive any values of setpoint, target temperature, current temperature etc. But if I look in Smartlife App on my mobile I can see all values. Who can help me? What is the reason? Thanks!

Some technical details: Made: Fairyland heat pump AI10 Integration: Tuya local integration set as climate