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

THR320 doesn't update #1130

Closed
aguswiss opened this issue Mar 5, 2023 · 31 comments
Closed

THR320 doesn't update #1130

aguswiss opened this issue Mar 5, 2023 · 31 comments
Labels
enhancement New feature or request
Milestone

Comments

@aguswiss
Copy link

aguswiss commented Mar 5, 2023

I have serveral THR320 in place and try to use the temperature as a trigger but I can't find any trick to get the actual temperature out of it execpt i run the ewelink dashbord on my PC in parallel.
Is there a possibility to force a update?

Hassio, THR320 are all on the newest release

@FiTekno
Copy link

FiTekno commented Mar 7, 2023

Same problem here. Needs either ewelink website or ewelink android app to be open to get temperature and humidity values to show on HA. They update to cloud just fine but problem is between HA<->cloud. Just doesnt update. There is information break as soon as ewelinks UI is not in use.

the problem does not concern the relay control, it works perfectly normally.

Here is debug log from HA:

2023-03-07 00:18:43 [D] SysInfo: {'installation_type': 'Home Assistant Core', 'version': '2023.2.5', 'dev': False, 'hassio': False, 'virtualenv': True, 'python_version': '3.10.10', 'docker': False, 'arch': 'aarch64', 'timezone': 'Europe/Helsinki', 'os_name': 'Linux', 'os_version': '5.4.60-v8.1.el8', 'user': 'homeass', 'sonoff_version': '3.4.0 (5406fa7)'}
2023-03-07 00:18:45 [D] 1 devices loaded from Cloud
2023-03-07 00:18:45 [D] 100178d085 UIID 0181 | {'version': 8, 'fwVersion': '1.1.0', 'switch': 'off', 'startup': 'stay', 'pulseConfig': {'pulse': 'off', 'switch': 'off', 'pulseWidth': 500}, 'sledOnline': 'on', 'tempUnit': 0, 'sensorType': 'AM2301', 'currentTemperature': '18.4', 'currentHumidity': '30.2', 'rssi': -69, 'autoControl': [{'deviceType': 'temperature', 'targets': [{'high': '20.0', 'reaction': {'switch': 'off'}}, {'low': '19.0', 'reaction': {'switch': 'on'}}], 'effTime': {'spanType': 'any', 'days': [0, 1, 2, 3, 4, 5, 6], 'from': '00:00', 'to': '01:00'}}], 'autoControlEnabled': 0, 'uiActive': 120, 'timeZone': 2, 'only_device': {'ota': 'success', 'ota_fail_reason': 0}, 'tempCorrection': -43, 'humCorrection': 63, 'tempHumiType': 3, 'mainSwitch': 'on', 'deviceType': 'normal'}
2023-03-07 00:18:45 [D] CLOUD mode start
2023-03-07 00:18:46 [D] CLOUD None => True
2023-03-07 00:18:46 [D] Add 6 entities
2023-03-07 00:19:18 [D] 100178d085 <= Cloud3 | {'uiActive': 120} | 1678141158744
2023-03-07 00:19:18 [D] 100178d085 <= Cloud3 | {'sensorType': 'AM2301', 'currentTemperature': '18.4', 'currentHumidity': '30.2', 'tempCorrection': -43, 'humCorrection': 63} | None
2023-03-07 00:20:08 [D] 100178d085 <= Cloud3 | {'uiActive': 120} | 1678141208744
2023-03-07 00:20:08 [D] 100178d085 <= Cloud3 | {'sensorType': 'AM2301', 'currentTemperature': '18.4', 'currentHumidity': '30.2', 'tempCorrection': -43, 'humCorrection': 63} | None
2023-03-07 00:20:58 [D] 100178d085 <= Cloud3 | {'uiActive': 120} | 1678141258755
2023-03-07 00:20:58 [D] 100178d085 <= Cloud3 | {'sensorType': 'AM2301', 'currentTemperature': '18.4', 'currentHumidity': '30.2', 'tempCorrection': -43, 'humCorrection': 63} | None
2023-03-07 00:21:27 [D] CLOUD True => True
2023-03-07 00:21:48 [D] 100178d085 <= Cloud3 | {'uiActive': 120} | 1678141308755
2023-03-07 00:21:48 [D] 100178d085 <= Cloud3 | {'sensorType': 'AM2301', 'currentTemperature': '18.4', 'currentHumidity': '30.2', 'tempCorrection': -43, 'humCorrection': 63} | None
2023-03-07 00:22:38 [D] 100178d085 <= Cloud3 | {'uiActive': 120} | 1678141358749
2023-03-07 00:22:38 [D] 100178d085 <= Cloud3 | {'sensorType': 'AM2301', 'currentTemperature': '18.4', 'currentHumidity': '30.2', 'tempCorrection': -43, 'humCorrection': 63} | None
2023-03-07 00:24:08 [D] CLOUD True => True
2023-03-07 07:24:51 [D] 100178d085 <= Cloud3 | {'uiActive': 120} | 1678166691976
2023-03-07 07:24:51 [D] 100178d085 <= Cloud3 | {'sensorType': 'AM2301', 'currentTemperature': '17.8', 'currentHumidity': '28.7', 'tempCorrection': -43, 'humCorrection': 63} | None
2023-03-07 07:24:54 [D] 100178d085 <= Cloud3 | {'sensorType': 'AM2301', 'currentTemperature': '17.8', 'currentHumidity': '28.7', 'tempCorrection': -43, 'humCorrection': 63} | None

@aguswiss
Copy link
Author

aguswiss commented Mar 7, 2023

Many thanks for your input.
I think it's a problem between the device and the cloud because it also takes to update in the ewe-Link App on the iPhone.
Honestly I think it's a SONOFF issue but I wanted to be sure I'm not the only one with this behavor.

@skaffff
Copy link

skaffff commented Mar 12, 2023

So this is why I see just 10 values over last week.. its that ten times I opened the ewelink app, no other values are getting into HA at any point

@aguswiss
Copy link
Author

So this is why I see just 10 values over last week.. its that ten times I opened the ewelink app, no other values are getting into HA at any point

Yes, it usually updates all THR‘s if you open one in the ewelink app for a while

@j42z
Copy link

j42z commented Mar 13, 2023

Same problem. I'm noticing that even in the eWeLink app I'm only getting updates hourly.
Also when I restart Sonoff integration in HA it gets an updated value.
I'm using THR320D with firmware version 1.1.0.

@aguswiss
Copy link
Author

Same problem. I'm noticing that even in the eWeLink app I'm only getting updates hourly. Also when I restart Sonoff integration in HA it gets an updated value. I'm using THR320D with firmware version 1.1.0.

I wanted to control the fan's on a computer rack and I created a scene in the eweLink app and surprisingly it works perfect. everytime the temperature hits the threshold it updates (also in HA) if it's below the value or over the value it just doesn't update until it hits the threshold again. very special

@j42z
Copy link

j42z commented Mar 13, 2023

This is the history in eWeLink application:
image
and there is no values between hours.

And this is what I'm getting in the HA :
image

I'm only getting updates when I reload integration

@aguswiss
Copy link
Author

aguswiss commented Mar 13, 2023

it only updates if a ewelink scene hits a threshold.
2023-03-13 22_58_57-Verlauf – Home Assistant

here I have the scene not above 30 and not below 29 degrees. I have an external fan for test purposes and you can see clearly when it's running and when it's off. Then the rack fan kicks in at 30 and stops at 29 degrees. the drop is when I trigger the ewelink app

@aguswiss
Copy link
Author

this is the matching switch
2023-03-13 23_13_42-Verlauf – Home Assistant

@j42z
Copy link

j42z commented Mar 14, 2023

I don't know what is wrong with this device, but it seems that even the toggle button is not showing the updated state. When I press to change the state it has effect but HA stays waiting some feedback and then falback to the original state. Meaning that it will be in the opposite state of the reality.
I'm using cloud in this case.

I was expecting to improve my control over the temperature replacing my old TH16 but what I replaced was one problem with another problems.

@FiTekno
Copy link

FiTekno commented Mar 14, 2023

I don't know what is wrong with this device, but it seems that even the toggle button is not showing the updated state. When I press to change the state it has effect but HA stays waiting some feedback and then falback to the original state. Meaning that it will be in the opposite state of the reality. I'm using cloud in this case.

I was expecting to improve my control over the temperature replacing my old TH16 but what I replaced was one problem with another problems.

Strong recommendation for Tasmota, it makes THR316(D)/320(D)work perfectly. Even LCD works too. Although it would be nice to get this SonoffLAN working as well, while waiting for that, it's best to use Tasmota32.bin and MQTT broker in HA..

@j42z
Copy link

j42z commented Mar 14, 2023

Yes, Tasmota seems the way to go. But I have this sensor installed in a very remote place which I need a plan to go there. And this last time I was not prepared for such big disapointment
1- refresh rate hourly
2- bug in HA integration

@FiTekno - based in your experience, can you please share how Tasmota refreshes the temperature value ? Is it hourly or configurable?

@FiTekno
Copy link

FiTekno commented Mar 14, 2023

Yes, Tasmota seems the way to go. But I have this sensor installed in a very remote place which I need a plan to go there. And this last time I was not prepared for such big disapointment 1- refresh rate hourly 2- bug in HA integration

@FiTekno - based in your experience, can you please share how Tasmota refreshes the temperature value ? Is it hourly or configurable?

It refreshes every 5-10 minutes.
image

@j42z
Copy link

j42z commented Mar 15, 2023

This looks to be the same issue reported here: #943

@Bovive
Copy link

Bovive commented Mar 27, 2023

Same problem. New setup and S40 outlet. Tried setting up the automation to force updates but no dice. It doesn't update if I don't open the phone app.

AlexxIT added a commit that referenced this issue Mar 30, 2023
@AlexxIT
Copy link
Owner

AlexxIT commented Mar 30, 2023

I have added uiActive for this device. You can check latest master version.
Attention: this request available only via cloud (auto and cloud modes).

@AlexxIT AlexxIT added the enhancement New feature or request label Mar 30, 2023
@j42z
Copy link

j42z commented Mar 30, 2023

Hi @AlexxIT,

The new version 3.5.0 is availbe here v3.5.0 but in HA I don't have yet the update available to do.
I would like to understand the release cycle?
Where it is being build and then where is being pushed to the packages repository?

@AlexxIT
Copy link
Owner

AlexxIT commented Mar 30, 2023

Master version can be downloaded manually or via HACS (reinstall feature)

@j42z
Copy link

j42z commented Mar 30, 2023

Just for pedagogical purposes:

  • Where it is being built - is there a ci pipeline?
  • Where is being pushed to the packages repository?

or point me to some available documentation if applicable.

@AlexxIT
Copy link
Owner

AlexxIT commented Mar 30, 2023

https://github.com/AlexxIT/SonoffLAN/tree/master

There is no CI because custom_component it's just a folder with python sources

@AlexxIT AlexxIT added this to the 3.5.1 milestone Mar 30, 2023
@Bovive
Copy link

Bovive commented Mar 30, 2023

I have added uiActive for this device. You can check latest master version. Attention: this request available only via cloud (auto and cloud modes).

Does this fix work for the S40 device as well? I have the same problem with that device. Thanks!

@AlexxIT
Copy link
Owner

AlexxIT commented Mar 30, 2023

S40 already has this logic. But it was improved in the v3.5.0

@Bovive
Copy link

Bovive commented Mar 30, 2023

S40 already has this logic. But it was improved in the v3.5.0

Thanks! Looks like upgrading to v3.5.0 did the trick.

@j42z
Copy link

j42z commented Mar 30, 2023

I did the update in HACS and I'm afraid to say it looks the same
this is what I have in eWeLink Smart Home
image

and this is what HA is getting
image

(I'm using THR320D with firmware version 1.1.0.)

@AlexxIT
Copy link
Owner

AlexxIT commented Mar 31, 2023

Show device diagnostics

@j42z
Copy link

j42z commented Mar 31, 2023

"integration_manifest": {
    "domain": "sonoff",
    "name": "Sonoff",
    "config_flow": true,
    "documentation": "https://github.com/AlexxIT/SonoffLAN",
    "issue_tracker": "/api/sonoff/(XXXXXXXXXXXXXX)",
    "codeowners": [
      "@AlexxIT"
    ],
    "dependencies": [
      "http",
      "zeroconf"
    ],
    "requirements": [
      "pycryptodome>=3.6.6"
    ],
    "version": "3.5.0",
    "iot_class": "local_push",
    "is_built_in": false
  },
  "data": {
    "version": "6935784",
    "cloud_auth": true,
    "config": null,
    "options": {
      "mode": "cloud",
      "debug": true
    },
    "errors": [
      {
        "name": "custom_components.sonoff.core.ewelink.cloud",
        "message": [
          "Cloud ERROR: {'error': 504, 'reason': 'Request Timeout', 'deviceid': '1000fe1068', 'apikey': 'YYYYYYYYYYYYYY', 'sequence': '1680202964000'}",
          "Cloud ERROR: {'error': 504, 'reason': 'Request Timeout', 'deviceid': '1000fe1068', 'apikey': 'YYYYYYYYYYYYYY', 'sequence': '1680212236000'}",
          "Cloud ERROR: {'error': 504, 'reason': 'Request Timeout', 'deviceid': '1000fe1068', 'apikey': 'YYYYYYYYYYYYYY', 'sequence': '1680212356000'}",
          "Cloud ERROR: {'error': 504, 'reason': 'Request Timeout', 'deviceid': '1000fe1068', 'apikey': 'YYYYYYYYYYYYYY', 'sequence': '1680215207000'}",
          "Cloud ERROR: {'error': 504, 'reason': 'Request Timeout', 'deviceid': '1000fe1068', 'apikey': 'YYYYYYYYYYYYYY', 'sequence': '1680215327000'}"
        ],
        "level": "WARNING",
        "source": [
          "custom_components/sonoff/core/ewelink/cloud.py",
          342
        ],
        "timestamp": 1680215332.5740118,
        "exception": "",
        "count": 11,
        "first_occurred": 1680178485.7627096
      }
    ],
    "device": {
      "uiid": 181,
      "params": {
        "bindInfos": "***",
        "version": 8,
        "ssid": "***",
        "bssid": "***",
        "fwVersion": "1.1.0",
        "switch": "off",
        "startup": "off",
        "pulseConfig": {
          "pulse": "off",
          "switch": "off",
          "pulseWidth": 500
        },
        "sledOnline": "on",
        "tempUnit": 0,
        "sensorType": "DS18B20",
        "currentTemperature": "86.6",
        "currentHumidity": "unavailable",
        "rssi": -40,
        "staMac": "***",
        "autoControl": [],
        "autoControlEnabled": 0,
        "uiActive": 60,
        "timeZone": 0,
        "only_device": {
          "ota": "success",
          "ota_fail_reason": 0
        },
        "tempCorrection": 0,
        "humCorrection": 0,
        "tempHumiType": 1,
        "mainSwitch": "off",
        "deviceType": "normal"
      },
      "model": "THR320D",
      "online": true,
      "local": null,
      "localtype": null,
      "host": null,
      "deviceid": "10017c1a5e"
    }
  }

I have censored the ApyKey just in case it's mine

"hacs": {
      "version": "1.31.0",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "sonoff": {
      "version": "3.5.0",
      "requirements": [
        "pycryptodome>=3.6.6"
      ]
    },

@AlexxIT
Copy link
Owner

AlexxIT commented Mar 31, 2023

@j42z you not using master version

@AlexxIT
Copy link
Owner

AlexxIT commented Mar 31, 2023

@AlexxIT AlexxIT closed this as completed Mar 31, 2023
@j42z
Copy link

j42z commented Mar 31, 2023

Ya v3.5.1 looks good. Thanks

@j42z
Copy link

j42z commented Mar 31, 2023

Better than expected :) Thank you @AlexxIT

eWeLink is updating hourly and this integration is now always updating the value.

Is it 5 minutes delay @AlexxIT ?

@AlexxIT
Copy link
Owner

AlexxIT commented Mar 31, 2023

All questions to device developer. Integration doesn't make any delay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants