make-all / tuya-local

Local support for Tuya devices in Home Assistant
MIT License
1.22k stars 489 forks source link

[FeatureRequest] Add support for Inkbird ITC-308-WIFI #121

Closed andreq closed 2 years ago

andreq commented 2 years ago

Based on ITC-306A support, would it be possible to add support for ITC-308 without too much hassle?

Here are the DPS and what they should be bound to:

101 | Temperature unit | Cf | Integer | 0=C, 1=F 102 | Calibration | Ca | Integer | Unit is 0.1C 104 | Temperature sensor |   | Integer | Unit is 0.1C 106 | Temperature set point | Ts | Integer | Unit is 0.1C 108 | Compressor delay time | Pt | Integer | Unit is minutes 109 | Alarm high temperature | Ah | Integer | Unit is 0.1C 110 | Alarm low temperature | Al | Integer | Unit is 0.1C, For negative values use -(0xFFFFFFFF - value) 115 | Relay status |   | Integer | 01=cool, 02=off, 03=heating 116 | Temperature sensor |   | Integer | Unit is 0.1F 117 | Heating differential value | Hd | Integer | Unit is 0.1C 118 | Cooling differential value | Cd | Integer | Unit is 0.1C

Both unit are quite similar, but the 308 has cooling support.

Thanks a lot.

Edit : Didn't realize there was more info in the logs if that can help:

Device matches None with quality of 0%. DPS: {'12': 0, '101': 'C', '102': 0, '104': 136, '106': 15, '108': 3, '109': 370, '110': 10, '111': False, '112': False, '113': False, '115': '1', '116': 565, '117': 10, '118': 5, 'updated_at': 1642564828.9707937}

The value does match the above DPS list (Ex: Currently set to 1.5c, DPS 106 = 15 (*0.1C)).

make-all commented 2 years ago

It is quite similar, so easy to support. I have made a first try which you can try if you select "Redownload" from the tuya-local panel menu in HACS and select "main" as the version.

andreq commented 2 years ago

Wow, this was quick and it's working perfectly!

The only issue was during the configuration. There was some unnamed entities in the list where I have to chose which one I want integrated, but they show up fine when I hit configure after it's added, so might just be a UI issue (I'm NOT on latest version HA and Lovelace).

Thanks again and hat off for your support on this project, it's top of the line.

-- I'll leave the issue open in case you want to close it when it's officially in the release version

make-all commented 2 years ago

Newly added strings are often missing from the UI immediately after an upgrade, there seems to be some caching in the UI. A Shift-Refresh in the browser generally fixes it.

I have unit tests that detect actual missing strings, the green tick on the commit shows that the strings are all there, so it must just be the caching.

kramttocs commented 2 years ago

Very excited to see this! I am having some trouble getting it setup though. I chose the newly-available Climate as the platform type and tried to set the values according to those specified in the initial post but I didn't get any entities created.

Questions: What value should I choose for the ID? Which dropdown should I choose for 115 (Relay status)? I am using F but should I choose 104 or 116 for the Temp Sensor dropdown? Didn't know if mixing was a problem. Where do I set the differentials for Heating and Cooling? Not seeing dropdowns for those.

kramttocs commented 2 years ago

My mistake - I was mixing the 'local tuya' integrations. I will pull this one down and try it.

kramttocs commented 2 years ago

Working great!

kramttocs commented 2 years ago

Looks like when it's Heating the slider is still blue instead of orange.

Also, I would need to do some more testing but I changed the set value via the Tuya app and the entities went Unavailable in HA. I am wonder if it caused them to drop off the network for a bit as when I tried to re-submit them in the integration it said it couldn't find the device. I waited a bit and then the submit worked.

make-all commented 2 years ago

Yes, when you use the Tuya app on the local network, it will hog the connection to the device until it is sent to idle in the background of your mobile. Tuya devices in general limit local connections to one at a time.
I am not sure how the HA UI determines the color to use for the thermostat, I guess it might do it from the hvac_mode, which is not supported by this device's configuration.

kramttocs commented 2 years ago

Thanks - that is good to know.

make-all commented 2 years ago

The other issue you might find if you are playing around is that if the device units does not match the Home Assistant UI units, Home Assistant will convert them. This works well for the temperature setting and reading, but is not the correct behaviour for the relative temperature calibration configurations (ie, a calibration of 0C will show up in the UI as 32F, but since it is relative, it should still be 0)