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

Thermostat updates current_temperature only then Smart Life app is opened #971

Open
mistrello96 opened this issue Jan 11, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@mistrello96
Copy link

Describe the bug

Thermostat current_temperature is updated only when smart life app is opened on the phone

Expected behavior

The thermostat current_temperature should be updatet regurarly, without the smart life opened on the phone

Diagnostics for integrations and devices

config_entry-tuya-f2e10bb6901610d9d311082b6b9011bd.json.txt

Screenshots

The problem is that the thermostat reports the current temperature only when smart life app is opened. As soon as the app is opened, this call is made to tuya servers
Screenshot 2024-01-11 093249
that triggers a new data report from the thermostat.
The same call should be done regurarly from the integration to "ask" the updated data from the thermostat

Home Assistant Version

  • e.g. 2024.1.2
@mistrello96 mistrello96 added the bug Something isn't working label Jan 11, 2024
@mistrello96
Copy link
Author

I have found a workaround that works for me.

Using the IOT TUYA API, I have discovered all the device properties and found out that 唤醒通知 is a property called "week_up_btn" (probably misspelled wake).

If you set that property to true, it triggers the device to report the status and then reset to default.

The workaround is setting this property to true every x seconds, making the device report regularly.

I'm not sure if this applies to other devices, but for my thermostat works.

@carlossg
Copy link

carlossg commented Mar 4, 2024

@mistrello96 which API have you used to see and set the property?
I've tried multiple ones and only see the same properties as in android app / HASS

  • /v1.0/iot-03/devices/{{device_id}}/functions
  • /v1.2/iot-03/devices/{{device_id}}/specification
  • /v1.2/iot-03/devices/{{device_id}}/properties
  • /v1.0/iot-03/devices/{{device_id}}/properties
  • /v2.0/cloud/thing/{device_id}/shadow/properties

@mistrello96
Copy link
Author

I used the "query things data model" to extract the correct property, should be

  • /v2.0/cloud/thing/{{device_id}}/model

Once you identify the property you want to edit, i used the "send property" api to set it/trigger it

  • v2.0/cloud/thing/{{device_id}}/shadow/properties/issue

@carlossg
Copy link

carlossg commented Mar 5, 2024

I've tried that but the model for my temperature sensor don't have that property

{
    "modelId": "e8edx0",
    "services": [
        {
            "actions": [],
            "code": "",
            "description": "",
            "events": [],
            "name": "默认服务",
            "properties": [
                {
                    "abilityId": 1,
                    "accessMode": "ro",
                    "code": "temp_current",
                    "description": "",
                    "extensions": {
                        "iconName": "icon-dp_temp",
                        "attribute": "1664",
                        "trigger": "direct"
                    },
                    "name": "温度",
                    "typeSpec": {
                        "max": 600,
                        "min": -99,
                        "scale": 1,
                        "step": 1,
                        "type": "value",
                        "typeDefaultValue": -99,
                        "unit": ""
                    }
                },
                {
                    "abilityId": 2,
                    "accessMode": "ro",
                    "code": "humidity_value",
                    "description": "",
                    "extensions": {
                        "iconName": "icon-shidu",
                        "attribute": "1664",
                        "trigger": "direct"
                    },
                    "name": "湿度",
                    "typeSpec": {
                        "max": 99,
                        "min": 0,
                        "scale": 0,
                        "step": 1,
                        "type": "value",
                        "typeDefaultValue": 0,
                        "unit": "%"
                    }
                },
                {
                    "abilityId": 4,
                    "accessMode": "ro",
                    "code": "battery_percentage",
                    "description": "",
                    "extensions": {
                        "iconName": "icon-dp_battery",
                        "attribute": "1152",
                        "trigger": "direct"
                    },
                    "name": "电池电量",
                    "typeSpec": {
                        "max": 100,
                        "min": 0,
                        "scale": 0,
                        "step": 1,
                        "type": "value",
                        "typeDefaultValue": 0,
                        "unit": "%"
                    }
                },
                {
                    "abilityId": 9,
                    "accessMode": "rw",
                    "code": "temp_unit_convert",
                    "description": "",
                    "extensions": {
                        "iconName": "icon-dp_mode",
                        "attribute": "1152"
                    },
                    "name": "温标",
                    "typeSpec": {
                        "range": [
                            "c",
                            "f"
                        ],
                        "type": "enum",
                        "typeDefaultValue": "c"
                    }
                },
                {
                    "abilityId": 23,
                    "accessMode": "rw",
                    "code": "temp_calibration",
                    "description": "",
                    "extensions": {
                        "iconName": "icon-dp_loop"
                    },
                    "name": "温度校准",
                    "typeSpec": {
                        "max": 20,
                        "min": -20,
                        "scale": 1,
                        "step": 1,
                        "type": "value",
                        "typeDefaultValue": -20,
                        "unit": ""
                    }
                },
                {
                    "abilityId": 24,
                    "accessMode": "rw",
                    "code": "hum_calibration",
                    "description": "",
                    "extensions": {
                        "iconName": "icon-icon-percent"
                    },
                    "name": "湿度校准",
                    "typeSpec": {
                        "max": 10,
                        "min": -10,
                        "scale": 0,
                        "step": 1,
                        "type": "value",
                        "typeDefaultValue": -10,
                        "unit": "%"
                    }
                }
            ]
        }
    ]
}

Tried POST to v2.0/cloud/thing/{{device_id}}/shadow/properties/issue but no luck, got a 501 request fail with unkown error

{
  "properties": {
    "week_up_btn": true
  }
}

@mistrello96 where did you get the low level logs to know what messages are sent when the smart life app is open?

@mistrello96
Copy link
Author

I got them in the device log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants