athombv / com.tuya

Tuya app for Homey
https://homey.app/a/com.tuya
17 stars 12 forks source link

T&H sensor - readings not updating #230

Closed hrabbach closed 1 month ago

hrabbach commented 1 month ago

Homey version

2019 Homey Pro 12.0.1

Tuya app version

1.3.3

App diagnostics report ID

0867d3c3-ea48-455b-805e-d517be0fed92

Description

Sensor readings of the Temperature & Humidity sensor don't get updated. They do update in the SmartLife app, but on Homey they only change when the app is restarted. Version 1.3.3 did not fix this.

Data points in the device spec keep showing as "not available" even after adding as other/unknown

Device specification

{
  "device": {
    "active_time": 1725467019,
    "biz_type": 18,
    "category": "wsdcg",
    "create_time": 1725467019,
    "icon": "smart/icon/ay1562583874631k02Aw/a4723e20b84980766269881ce96d773b.png",
    "id": "bfb2a85398f663a53ajams",
    "ip": "",
    "lat": "",
    "local_key": "",
    "lon": "",
    "model": "AS90",
    "name": "Wandthermostat Keller",
    "online": true,
    "owner_id": "",
    "product_id": "rocfghml4gy1vvr8",
    "product_name": "Temperature and humidity alarm",
    "status": [
      {
        "code": "va_temperature",
        "value": 195
      },
      {
        "code": "va_humidity",
        "value": 669
      },
      {
        "code": "battery_percentage",
        "value": 100
      },
      {
        "code": "charge_state",
        "value": false
      },
      {
        "code": "temp_unit_convert",
        "value": "c"
      },
      {
        "code": "maxtemp_set",
        "value": 1500
      },
      {
        "code": "minitemp_set",
        "value": -190
      },
      {
        "code": "maxhum_set",
        "value": 1000
      },
      {
        "code": "minihum_set",
        "value": 0
      },
      {
        "code": "temp_alarm",
        "value": "cancel"
      },
      {
        "code": "hum_alarm",
        "value": "cancel"
      },
      {
        "code": "bright_value",
        "value": 8
      },
      {
        "code": "temp_periodic_report",
        "value": 10
      },
      {
        "code": "hum_periodic_report",
        "value": 10
      },
      {
        "code": "switch",
        "value": true
      }
    ],
    "sub": false,
    "time_zone": "+02:00",
    "uid": "",
    "update_time": 1726054447,
    "uuid": ""
  },
  "specifications": {
    "category": "wsdcg",
    "functions": [
      {
        "code": "temp_unit_convert",
        "type": "Enum",
        "values": "{\"range\":[\"c\",\"f\"]}"
      },
      {
        "code": "maxtemp_set",
        "type": "Integer",
        "values": "{\"unit\":\"℃\",\"min\":-190,\"max\":1500,\"scale\":1,\"step\":1}"
      },
      {
        "code": "minitemp_set",
        "type": "Integer",
        "values": "{\"unit\":\"℃\",\"min\":-190,\"max\":1500,\"scale\":1,\"step\":1}"
      },
      {
        "code": "maxhum_set",
        "type": "Integer",
        "values": "{\"unit\":\"%\",\"min\":0,\"max\":1000,\"scale\":1,\"step\":1}"
      },
      {
        "code": "minihum_set",
        "type": "Integer",
        "values": "{\"unit\":\"%\",\"min\":0,\"max\":1000,\"scale\":1,\"step\":1}"
      },
      {
        "code": "temp_periodic_report",
        "type": "Integer",
        "values": "{\"unit\":\"秒\",\"min\":1,\"max\":3600,\"scale\":0,\"step\":1}"
      },
      {
        "code": "hum_periodic_report",
        "type": "Integer",
        "values": "{\"unit\":\"秒\",\"min\":1,\"max\":3600,\"scale\":0,\"step\":1}"
      },
      {
        "code": "switch",
        "type": "Boolean",
        "values": "{}"
      }
    ],
    "status": [
      {
        "code": "va_temperature",
        "type": "Integer",
        "values": "{\"unit\":\"℃\",\"min\":-190,\"max\":1500,\"scale\":1,\"step\":1}"
      },
      {
        "code": "va_humidity",
        "type": "Integer",
        "values": "{\"unit\":\"%\",\"min\":0,\"max\":1000,\"scale\":1,\"step\":1}"
      },
      {
        "code": "battery_percentage",
        "type": "Integer",
        "values": "{\"unit\":\"%\",\"min\":0,\"max\":100,\"scale\":0,\"step\":1}"
      },
      {
        "code": "charge_state",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "temp_unit_convert",
        "type": "Enum",
        "values": "{\"range\":[\"c\",\"f\"]}"
      },
      {
        "code": "maxtemp_set",
        "type": "Integer",
        "values": "{\"unit\":\"℃\",\"min\":-190,\"max\":1500,\"scale\":1,\"step\":1}"
      },
      {
        "code": "minitemp_set",
        "type": "Integer",
        "values": "{\"unit\":\"℃\",\"min\":-190,\"max\":1500,\"scale\":1,\"step\":1}"
      },
      {
        "code": "maxhum_set",
        "type": "Integer",
        "values": "{\"unit\":\"%\",\"min\":0,\"max\":1000,\"scale\":1,\"step\":1}"
      },
      {
        "code": "minihum_set",
        "type": "Integer",
        "values": "{\"unit\":\"%\",\"min\":0,\"max\":1000,\"scale\":1,\"step\":1}"
      },
      {
        "code": "temp_alarm",
        "type": "Enum",
        "values": "{\"range\":[\"loweralarm\",\"upperalarm\",\"cancel\"]}"
      },
      {
        "code": "hum_alarm",
        "type": "Enum",
        "values": "{\"range\":[\"loweralarm\",\"upperalarm\",\"cancel\"]}"
      },
      {
        "code": "bright_value",
        "type": "Integer",
        "values": "{\"unit\":\"%\",\"min\":0,\"max\":100,\"scale\":0,\"step\":1}"
      },
      {
        "code": "temp_periodic_report",
        "type": "Integer",
        "values": "{\"unit\":\"秒\",\"min\":1,\"max\":3600,\"scale\":0,\"step\":1}"
      },
      {
        "code": "hum_periodic_report",
        "type": "Integer",
        "values": "{\"unit\":\"秒\",\"min\":1,\"max\":3600,\"scale\":0,\"step\":1}"
      },
      {
        "code": "switch",
        "type": "Boolean",
        "values": "{}"
      }
    ]
  },
  "data_points": ""
}
bobvandevijver commented 1 month ago

Looks like you have 8 Tuya devices: the updates for the other devices do work as expected? Looks like no update has been recorded since app start and when you generated the report, so I cannot validate it from the report in the current state.

hrabbach commented 1 month ago

Correct, 8 devices and the others, which are all sockets/switches, work as expected, but there's also not a lot of reporting /state changes happening on them. The app has now been running for a while (and readings have updated in SmartLife since), so I've generated a new report: eb590ec4-f00b-40bf-90d7-9724d843f928

bobvandevijver commented 1 month ago

Still not seeing any webhooks coming in. Can you try to trigger a status update for one of your other devices?

I'm also seeing a permission error in your logs, but it is unclear where it originates from. Did you use this same account/device with another app on Homey or another platform?

hrabbach commented 1 month ago

I'm assuming I can only trigger a useful status update by pressing a button on one of the devices, not by switching its state via Homey? In that case it will have to wait until I get home later.

The device is brand new and hasn't been used with any other app yet - the account has previously been used with the TuyaCloud app, which I uninstalled when my developer API key stopped working and I discovered that there's now an official Tuya app.

bobvandevijver commented 1 month ago

Controlling it with the Tuya Smart of SmartLife app on your phone should also trigger an update. Turning it on/off with that app should also be reflected in Homey.

My current suspicion is that it is indeed related to the old Tuya Cloud app, but I am absolutely not sure. That would be the next step: using a completely fresh Tuya account to see whether that solves anything.

hrabbach commented 1 month ago

Ok, I switched one of the sockets off and on again a few times: eb590ec4-f00b-40bf-90d7-9724d843f928

Certainly happy to try with a new Tuya account once I have a chance to connect my device to it... will report back whether that makes any difference.

bobvandevijver commented 1 month ago

That's the wrong id, but I found it anyways. Literally nothing happened (so you should also not have seen it update in the Homey app), so I am indeed going to ask you to create a completely new account to see whether that helps. If it doesn't work with a new Tuya account please make sure to have installed version 1.3.4 (which has some additional webhook logging) before generating a new report.

hrabbach commented 1 month ago

Added the device in question to a brand new Tuya account. Readings are still not updating, switching device state in the Tuya app doesn't change it in Homey. This is with 1.33.4, so new diagnostic log created here: 5868aa6e-f0c9-49bb-a656-74bd3cb52dab

bobvandevijver commented 1 month ago

You migrated the device to the new account by using "remove", and not "remove and clear data". Can you remove the device again using the latter option, and re-add afterwards?

hrabbach commented 1 month ago

I have no idea where the "remove and clear data" option would be. I am only offered a "delete" option in both the Tuya Smart and SmartLife apps, and there's also never an additional dialogue that would offer to also clear data.

bobvandevijver commented 1 month ago

You will need to remove it using the device settings. For example:

Step 1 Step 2 Step 3
2024-09-17 12 25 50 2024-09-17 12 25 58 2024-09-17 12 26 02
hrabbach commented 1 month ago

Thanks bit of a UI fail there in the Tuya app... anyway, that's not the main subject here. Did that, re-added the device, which was now also no longer recognized under its old name. Still no readings coming through, though: 8c144b1c-17fb-4551-b966-07326435cccc

bobvandevijver commented 1 month ago

Alright, I see that it received a new identifier, but I am at a loss as to why it doesn't generate updates. Would you be open to share this particular device with me (which allows me to control it)? If so, you can send the invite to homey-tuya[at]drenso.nl.

hrabbach commented 1 month ago

Happy to - invite just sent your way. There's no harm in you knowing the temperature in my office ;)

bobvandevijver commented 1 month ago

Quick update: the issue seems to be on the Tuya cloud side but it is currently unknown why. I have forwarded it to one of our contacts to look into, but unfortunately I do not have any ETA on an answer and/or solution at this time.

bobvandevijver commented 1 month ago

The source of this issue has been found on the Tuya cloud side: they are working on a solution and hopefully this issue should fix itself somewhere next week for existing users.

It might be the case that a device repair solves the issue already, so you can try that. Otherwise you will have to wait until it is fixed on the cloud side.

bobvandevijver commented 1 month ago

The incorrect state has now been resolved on the Tuya cloud side, so I am closing this as I assume it now just works as it should.