iRayanKhan / homebridge-tuya

A Homebridge plugin to control Tuya devices locally.
MIT License
394 stars 164 forks source link

Thermostat Device addition #43

Closed tonysprenk closed 4 years ago

tonysprenk commented 5 years ago

Hi,

I just installed a thermostat for our electric underfloor heating in the bathroom.

It works with the Tuya App.

When I add it to my config.json as a dimmer I am able to turn the thermostat it self (not the heat, just the screen) on/off and with the slider I am able to set the temperature and if the temapratur is set to higher than the room temperature it turns on the heat

Let me know if you need a package capture or anything else.

Terminal gives this output:

[11-2-2019 11:50:53] [TuyaPlatform] Unmapped dps data 3 170 [11-2-2019 11:50:53] [TuyaPlatform] Unmapped dps data 4 Program [11-2-2019 11:50:53] [TuyaPlatform] Unmapped dps data 6 false [11-2-2019 11:50:53] [TuyaPlatform] Unmapped dps data 12 0 [11-2-2019 11:50:53] [TuyaPlatform] Unmapped dps data 101 false [11-2-2019 11:50:53] [TuyaPlatform] Unmapped dps data 102 false [11-2-2019 11:50:53] [TuyaPlatform] Unmapped dps data 103 0 [11-2-2019 11:50:53] [TuyaPlatform] Unmapped dps data 104 1 [11-2-2019 11:50:53] [TuyaPlatform] Unmapped dps data 105 15 [11-2-2019 11:50:53] [TuyaPlatform] Unmapped dps data 106 true [11-2-2019 11:50:53] [TuyaPlatform] Unmapped dps data 107 true [11-2-2019 11:50:53] [TuyaPlatform] Unmapped dps data 108 true [11-2-2019 11:50:53] [TuyaPlatform] Unmapped dps data 109 -10 [11-2-2019 11:50:53] [TuyaPlatform] Unmapped dps data 110 10 [11-2-2019 11:50:53] [TuyaPlatform] Unmapped dps data 111 2 [11-2-2019 11:50:53] [TuyaPlatform] Unmapped dps data 112 45 [11-2-2019 11:50:53] [TuyaPlatform] Unmapped dps data 113 5 [11-2-2019 11:50:53] [TuyaPlatform] Unmapped dps data 114 35 [11-2-2019 11:50:53] [TuyaPlatform] Unmapped dps data 115 5 [11-2-2019 11:50:53] [TuyaPlatform] Unmapped dps data 116 in [11-2-2019 11:50:53] [TuyaPlatform] Unmapped dps data 117 keep [11-2-2019 11:50:53] [TuyaPlatform] Unmapped dps data 118 2days [11-2-2019 11:50:58] [TuyaPlatform] Unmapped dps data 3 170 [11-2-2019 11:50:58] [TuyaPlatform] Unmapped dps data 4 Program [11-2-2019 11:50:58] [TuyaPlatform] Unmapped dps data 6 false [11-2-2019 11:50:58] [TuyaPlatform] Unmapped dps data 12 0 [11-2-2019 11:50:58] [TuyaPlatform] Unmapped dps data 101 false [11-2-2019 11:50:58] [TuyaPlatform] Unmapped dps data 102 false [11-2-2019 11:50:58] [TuyaPlatform] Unmapped dps data 103 0 [11-2-2019 11:50:58] [TuyaPlatform] Unmapped dps data 104 1 [11-2-2019 11:50:58] [TuyaPlatform] Unmapped dps data 105 15 [11-2-2019 11:50:58] [TuyaPlatform] Unmapped dps data 106 true [11-2-2019 11:50:58] [TuyaPlatform] Unmapped dps data 107 true [11-2-2019 11:50:58] [TuyaPlatform] Unmapped dps data 108 true [11-2-2019 11:50:58] [TuyaPlatform] Unmapped dps data 109 -10 [11-2-2019 11:50:58] [TuyaPlatform] Unmapped dps data 110 10 [11-2-2019 11:50:58] [TuyaPlatform] Unmapped dps data 111 2 [11-2-2019 11:50:58] [TuyaPlatform] Unmapped dps data 112 45 [11-2-2019 11:50:58] [TuyaPlatform] Unmapped dps data 113 5 [11-2-2019 11:50:58] [TuyaPlatform] Unmapped dps data 114 35 [11-2-2019 11:50:58] [TuyaPlatform] Unmapped dps data 115 5 [11-2-2019 11:50:58] [TuyaPlatform] Unmapped dps data 116 in [11-2-2019 11:50:58] [TuyaPlatform] Unmapped dps data 117 keep [11-2-2019 11:50:58] [TuyaPlatform] Unmapped dps data 118 2days

codetheweb commented 5 years ago

I just added a new feature to tuya-cli that shows all properties; try updating it with npm i @tuyapi/cli -g.

Then, please post the output of tuya-cli get --id "<id>" --ip "<ip>" --key "<key>" -all.

tonysprenk commented 5 years ago

dps: { '1': true, '2': 350, '3': 200, '4': 'Manual', '6': true, '12': 4, '101': false, '102': false, '103': 0, '104': 1, '105': 15, '106': true, '107': true, '108': true, '109': 0, '110': 10, '111': 2, '112': 45, '113': 5, '114': 35, '115': 5, '116': 'all', '117': 'keep', '118': '2days' } }

codetheweb commented 5 years ago

Looks good, can you also provide a screenshot of the app and/or the current room temperature, the set temperature, etc.? Need to figure out what each property maps to.

tonysprenk commented 5 years ago

https://m.imgur.com/a/znIA3E8

codetheweb commented 5 years ago

Ok, I'm guessing that

{
  '2': targetTempC * 10,
  '3': currentTempC * 10,
  '4': mode
}

Would you want to be able to control / see anything else, or is that good?

tonysprenk commented 5 years ago

I have a few eve thermo’s. Which are automated radiator valves. In the home app they display current temp and you can set the temp using a slider or you can turn the heat off using a “switch” (https://imgur.com/a/BpDQxnZ). This would be all I need. I’m thinking that ‘4’ : mode refers to a manual and a scheduled mode. The scheduled mode being an option you configure in the Tuya app. Seeing as the home app allows you to schedule and automate this would be redundant. Long story short; heating/not heating and temperature set and current temp is all that’s needed. Everything else can be achieved through the home app’s automation. Let me know if there is anything else I can do! Appreciate all the hard work!

codetheweb commented 5 years ago

Ok, sounds good.

Can you please try to pin down the DPS index for turning the system on and off by controlling it through the app and taking note of the boolean values returned by the tuya-cli get command?

tonysprenk commented 5 years ago

There is no option for turning the heat off in the Tuya app other than setting the desired temperature lower than the room temperature.

So your implementation in your previous comment is perfect!

Thanks again!

codetheweb commented 5 years ago

Ok, hopefully will get to this tomorrow.

codetheweb commented 5 years ago

(I'm copy/pasting this into every open issue and PR.)

This plugin is now deprecated, as I don't have enough time to maintain it along with other TuyAPI related projects. Please use AMoo-Miki's homebridge-tuya-lan plugin instead. (Or, you can continue to use this plugin, but I will not be giving support or adding any new devices.)

I'm sorry about this, but this plugin is taking a disproportionate amount of my time that I believe is better spent making TuyAPI more stable and adding more tools to the ecosystem.

iRayanKhan commented 4 years ago

Closing; inactive thread. If you need support please re-open this issue.