AlexxIT / SonoffLAN

Control Sonoff Devices with eWeLink (original) firmware over LAN and/or Cloud from Home Assistant
https://github.com/AlexxIT/Blog
MIT License
2.66k stars 414 forks source link

THR316D: Add support climate entity #1074

Open npanait opened 1 year ago

npanait commented 1 year ago

Hi, I'm quite new to HA so bear with me... The integration for THR316 (mode cloud or auto - no difference) is not able to display the high and low targets (see Developer Tools - States), as set in the eWeLink portal/app as Auto-->Set-->Add:

hvac_modes: off, heat, cool, dry
min_temp: 1
max_temp: 99
target_temp_step: 1
current_temperature: 19.2
***target_temp_high: null
target_temp_low: null***
friendly_name: Climate-Parter-THR316D
supported_features: 2

The downloaded Diagnostics, however, shows them as:

"devices": {
      "10017bf36e": {
        "uiid": 181,
        "params": {
          "bindInfos": "something",
          "version": 8,
          "ssid": "something",
          "bssid": "something",
          "fwVersion": "1.1.0",
          "sensorType": "DS18B20",
          "currentTemperature": "19.2",
          "currentHumidity": "unavailable",
          "switch": "off",
          "startup": "off",
          "pulseConfig": {
            "pulse": "off",
            "switch": "off",
            "pulseWidth": 500
          },
          "sledOnline": "on",
          "tempUnit": 0,
          "rssi": -38,
          "staMac": "something",
          "autoControl": [
            {
              "deviceType": "temperature",
              "targets": [
                {
                  "high": "33.0",
                  "reaction": {
                    "switch": "on"
                  }
                },
                {
                  "low": "25.0",
                  "reaction": {
                    "switch": "off"
                  }
                }
              ],
              "effTime": {
                "spanType": "any",
                "days": [
                  0,
                  1,
                  2,
                  3,
                  4,
                  5,
                  6
                ],
                "from": "00:00",
                "to": "01:00"
              }
            }
          ],
          "autoControlEnabled": 1,
          "uiActive": 60,
          "timeZone": 2,
          "only_device": {
            "ota": "success",
            "ota_fail_reason": 0
          },
          "tempCorrection": 0,
          "humCorrection": 0,
          "tempHumiType": 1
        },
        "model": "THR316D",
        "online": true,
        "localtype": null
      }

As a result, the Climate card is not able to set them either, with error: "'XClimateTH' object has no attribute '_attr_is_aux_heat'"

Is there anything I can do to be able to display and set them?

PS: Not sure if this is related but, when changing mode to "cloud", the following error is logged too "Cloud ERROR: {'error': 400, 'deviceid': '10017bf5b6', 'apikey': 'something', 'sequence': 'something', 'uid': 'something'}"

AlexxIT commented 1 year ago

Looks like they totally rewrite API in new devices. This has to be rewritten from scratch

AlexxIT commented 1 year ago

I think I can't add support without access to devices. A lot of changes with old TH model. Someone with device should do it.

polisoid commented 1 year ago

Hello, could you please restore climate entity for THR316D? Until version 3.5.0 it was ok

AlexxIT commented 1 year ago

@polisoid show device diagnostics

polisoid commented 1 year ago

hello, from version 3.5.0. If you need 3.5.1, let me know that I install it

sonoff-c0cb3b20c43814e640cc6306d24c4829-Luino-84e14289af78f9ca3fb139226b38b108.json.txt

AlexxIT commented 1 year ago

@polisoid climate entity shouldn't work for you for this device model. Why you need it?

polisoid commented 1 year ago

Hello, surely I do not have full control (power off/on and temp setup does not works), burt at least actual temp is shown, and for me that is enough to keep track. Then in case I have to cheange setup on climate, I can use cell phone

Problem is that with 3.5.1 entity disappears, so I cannot keep track, either

Thanks, bye

AlexxIT commented 1 year ago

The current temperature and humidity are displayed in separate sensors. This has always been that way

npanait commented 1 year ago

I think I can't add support without access to devices. A lot of changes with old TH model. Someone with device should do it.

Hi @AlexxIT , I"m willing to give it a try but need assistance on how to do it. :) My python skills are limited. How should we progress? Cheers, Nicolae