make-all / tuya-local

Local support for Tuya devices in Home Assistant
MIT License
1.41k stars 543 forks source link

Request support for Inkbird IBBQ-4BW probe thermometer #548

Closed dhuddle closed 1 year ago

dhuddle commented 1 year ago

Log Message

This error originated from a custom integration.

Logger: custom_components.tuya_local.config_flow
Source: custom_components/tuya_local/config_flow.py:45
Integration: Tuya Local (documentation, issues)
First occurred: 10:15:48 AM (4 occurrences)
Last logged: 5:13:09 PM

Device matches None with quality of 0%. DPS: {"updated_at": 1679073347.0366364, "20": false, "21": "colour", "24": "010b03e803e8"}
Report this to https://github.com/make-all/tuya-local/issues/
Device matches ir_remote_sensors with quality of 12%. DPS: {"updated_at": 1679098388.606734, "1": true, "13": 303300608, "19": "F", "101": 100, "102": 15, "104": true, "107": 7281, "108": 7250, "109": 7251, "110": 7280, "111": false, "112": 23, "116": 0, "117": 0, "118": 0, "119": 0}

Information about DPS mappings

{
  "result": {
    "category": "wk",
    "functions": [
      {
        "code": "switch",
        "dp_id": 1,
        "type": "Boolean",
        "values": "{}"
      }
    ],
    "status": [
      {
        "code": "switch",
        "dp_id": 1,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "fault",
        "dp_id": 13,
        "type": "Bitmap",
        "values": "{\"label\":[\"e1\",\"e2\",\"e3\"]}"
      }
    ]
  },
  "success": true,
  "t": 1679071647124,
  "tid": "66400812c4e311edbae0c235483784fc"
}

DP IDs retrieved from Request Payloads as requested: (Corrected)


Switch: 1
Fault: 13
Temperature scale: 19
Battery capacity: 101
屏幕超时: 102
警报的模式和间隔时间: 103
是否响铃: 104
暂停警报 : 105
BLE MAC Address: 106
探头温度1: 107
探头温度2: 108
探头温度3: 109
探头温度4: 110
熄灭/唤醒背光: 111
设备内部温度: 112
探头颜色: 113
测试接口: 114
探头1补偿值: 116
探头2补偿值: 117
探头3补偿值: 118
探头4补偿值: 119
探头1预设值: 120
探头2预设值: 121
探头3预设值: 122
探头4预设值: 123
探头1定时器警报状态: 124
探头2定时器警报状态: 125
探头3定时器警报状态: 126
探头4定时器警报状态: 127

Product ID

{
  "result": {
    "active_time": 1668384251,
    "category": "wk",
    "category_name": "Thermostat",
    "create_time": 1668384251,
    "gateway_id": "",
    "icon": "smart/icon/ay15157410971057cPZi/0ffddad438f4e86f32f703013031826b.png",
    "id": "32030380c45bbe696ccf",
    "ip": <redacted>,
    "lat": <redacted>,
    "local_key": <redacted>,
    "lon": "-122.4687",
    "model": "IBBQ-4BW",
    "name": "IBBQ-4BW",
    "online": true,
    "owner_id": <redacted>,
    "product_id": "coa4tu1646wdybzy",
    "product_name": "IBBQ-4BW",
    "sub": false,
    "time_zone": "-08:00",
    "update_time": 1668384260,
    "uuid": "32030380c45bbe696ccf"
  },
  "success": true,
  "t": 1679072289300,
  "tid": "e500fa88c4e411edacf08ac5d669b858"
}

Information about how the device functions

Inkbird IBBQ-4BW (Amazon)

Manual

This is a 4 probe "BBQ" thermometer with high and low alarms. When attempting to currently integrate it gets detected as a simple switch or as a IR Universal remote control.

make-all commented 1 year ago

The DP IDs do not seem to match up with the log.

DP 104 is listed as current temperature, but the value is a Boolean not an integer.

Also, both 13 (fault according to the limited info returned by API explorer) and 107 (fault according to dps I'd info) have non zero values, which is not generally expected for a non faulty device.

dhuddle commented 1 year ago

Ahh; my apologies. I re-ran the Device Debugging step and realized I had selected the wrong item to debug. The ammended information is included above.

Thank you so much!

make-all commented 1 year ago

It would be useful to know what the temperature was when that log was captured. Would 72.5F seem about right (ie the probes were basically around room temperature)? 725F seems a little too high for a BBQ, but the scale factor could be more complex than just 10 or 100.

dhuddle commented 1 year ago

Yes the temps were at room temperature, about 72.5 as you assumed.

dhuddle commented 1 year ago

image

Thanks again! It's still being detected as this.

make-all commented 1 year ago

An error in one of the types. Please try the latest version again.

dhuddle commented 1 year ago

image

Looking pretty good!

image

A few notes:

Again tremendous work. Thank you so much. We're almost there!

make-all commented 1 year ago

I'm not sure what is going on with the units, in the log it looked correct: units were F and temperatures were in the 70's which I assumed was room temperature. Maybe it takes some time for the device to change? Or it needs a power cycle after changing the units?

Internal temperature was documented in being C, so from the docs it doesn't appear to be affected by the C/F setting. This shouldn't matter, because in the HA UI you can set the units for display separately. But if it is in fact affected by the C/F setting, the it too will need the units applied from the C/F dp.

The Fault is a binary sensor, it will report "Problem" if dp 13 is non-zero. There may be some codes that are not actual faults, so if you can get any more info those can be filtered out. The full fault code is available as an attribute on Temperature probe 1, which you will be able to see in Developer Tools / States if it is not showing up in the More Info dialog for Temperature probe 1. The values can probably be correlated with some information in the Tuya app. In the log above, the value is 303300608, which in hex is 12140000. With 4 bits set, it is likely that one bit is being indicated for each probe.

dhuddle commented 1 year ago

image

here's what's happening:

image

So, the sensors value displayed is the opposite of the configuration dropdown. the configuration dropdown seems to be correct, because it changes the device correctly. the " °C" annotation in the Sensors UI doesn't change, but not sure if that's the integration or a HA bug.

make-all commented 1 year ago

It seems like the device is always reporting Fahrenheit for the probe temperatures, and Celsius for the internal temperature, regardless of how the unit is set. The unit is only affecting the device's own display. Perhaps when switched to Celsius, it is reporting the probe temperature in Celsius on a different DP. If you capture the device diagnostics (Settings / Devices & Services / Integrations - Tuya Local - inkbird device / 1 device / Download Diagnostics) when it is switched to Celsius, the data should be visible. I think HA is always showing Celsius, because that is what your HA Settings are set to. When the device is set to Fahrenheit, it is doing a conversion, and showing you the correct temperature, but when it is set to Celsius, it will not do any conversion but since the device is still reporting Fahrenheit, it is incorrect.

dhuddle commented 1 year ago

Ok, I switched it to Celsius in the drop down and did the "download diagnostics". This is the output, minus the HA stuff at the top:

{
    "tuya_local": {
      "version": "2022.3.1",
      "requirements": [
        "pycryptodome~=3.17",
        "tinytuya==1.12.0"
      ]
    },
  "integration_manifest": {
    "domain": "tuya_local",
    "name": "Tuya Local",
    "codeowners": [
      "@make-all"
    ],
    "config_flow": true,
    "dependencies": [],
    "documentation": "https://github.com/make-all/tuya-local",
    "integration_type": "device",
    "iot_class": "local_push",
    "issue_tracker": "https://github.com/make-all/tuya-local/issues",
    "requirements": [
      "pycryptodome~=3.17",
      "tinytuya==1.12.0"
    ],
    "version": "2022.3.1",
    "is_built_in": false
  },
  "data": {
    "name": "Inkbird BBQ thermometer",
    "type": "inkbird_ibbq4bw_thermometer",
    "device_id": "**REDACTED**",
    "local_key": "**REDACTED**",
    "host": "**REDACTED**",
    "protocol_version": "auto",
    "api_version_set": 3.3,
    "api_version_used": 3.3,
    "api_working": true,
    "status": {},
    "cached_state": {
      "updated_at": 1679542480.956992,
      "1": true,
      "13": 303300608,
      "19": "C",
      "101": 100,
      "102": 60,
      "104": true,
      "107": 6821,
      "108": 6931,
      "109": 6801,
      "110": 6891,
      "111": false,
      "112": 19,
      "116": 0,
      "117": 0,
      "118": 0,
      "119": 0
    },
    "pending_state": {
      "19": {
        "value": "C",
        "updated_at": 1679542480.6561465,
        "sent": true
      }
    },
    "connected": true,
    "force_dps": [],
    "home_assistant": {
      "name": "Inkbird BBQ thermometer",
      "name_by_user": null,
      "disabled": false,
      "disabled_by": null,
      "entities": [
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": "problem",
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "binary_sensor.inkbird_bbq_thermometer_fault",
            "state": "on",
            "attributes": {
              "device_class": "problem",
              "friendly_name": "Inkbird BBQ thermometer Fault"
            },
            "last_changed": "2023-03-22T21:37:14.649693+00:00",
            "last_updated": "2023-03-22T21:37:14.649693+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": null,
          "device_class": null,
          "original_device_class": "temperature",
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "sensor.inkbird_bbq_thermometer_temperature_probe_1",
            "state": "68.21",
            "attributes": {
              "state_class": "measurement",
              "fault_code": 303300608,
              "unit_of_measurement": "\u00b0C",
              "device_class": "temperature",
              "friendly_name": "Inkbird BBQ thermometer Temperature probe 1"
            },
            "last_changed": "2023-03-23T03:34:40.834403+00:00",
            "last_updated": "2023-03-23T03:34:40.834403+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": null,
          "device_class": null,
          "original_device_class": "temperature",
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "sensor.inkbird_bbq_thermometer_temperature_probe_2",
            "state": "69.31",
            "attributes": {
              "state_class": "measurement",
              "unit_of_measurement": "\u00b0C",
              "device_class": "temperature",
              "friendly_name": "Inkbird BBQ thermometer Temperature probe 2"
            },
            "last_changed": "2023-03-23T03:34:40.835243+00:00",
            "last_updated": "2023-03-23T03:34:40.835243+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": null,
          "device_class": null,
          "original_device_class": "temperature",
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "sensor.inkbird_bbq_thermometer_temperature_probe_3",
            "state": "68.01",
            "attributes": {
              "state_class": "measurement",
              "unit_of_measurement": "\u00b0C",
              "device_class": "temperature",
              "friendly_name": "Inkbird BBQ thermometer Temperature probe 3"
            },
            "last_changed": "2023-03-23T03:34:40.835865+00:00",
            "last_updated": "2023-03-23T03:34:40.835865+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": null,
          "device_class": null,
          "original_device_class": "temperature",
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "sensor.inkbird_bbq_thermometer_temperature_probe_4",
            "state": "68.91",
            "attributes": {
              "state_class": "measurement",
              "unit_of_measurement": "\u00b0C",
              "device_class": "temperature",
              "friendly_name": "Inkbird BBQ thermometer Temperature probe 4"
            },
            "last_changed": "2023-03-23T03:34:40.836458+00:00",
            "last_updated": "2023-03-23T03:34:40.836458+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": "battery",
          "icon": null,
          "unit_of_measurement": "%",
          "state": {
            "entity_id": "sensor.inkbird_bbq_thermometer_battery",
            "state": "100",
            "attributes": {
              "unit_of_measurement": "%",
              "device_class": "battery",
              "friendly_name": "Inkbird BBQ thermometer Battery"
            },
            "last_changed": "2023-03-22T21:37:14.648938+00:00",
            "last_updated": "2023-03-22T21:37:14.648938+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": "temperature",
          "icon": null,
          "unit_of_measurement": "\u00b0C",
          "state": {
            "entity_id": "sensor.inkbird_bbq_thermometer_internal_temperature",
            "state": "19",
            "attributes": {
              "state_class": "measurement",
              "unit_of_measurement": "\u00b0C",
              "device_class": "temperature",
              "friendly_name": "Inkbird BBQ thermometer Internal temperature"
            },
            "last_changed": "2023-03-22T21:37:14.649385+00:00",
            "last_updated": "2023-03-22T21:37:14.649385+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "select.inkbird_bbq_thermometer_temperature_unit",
            "state": "Celsius",
            "attributes": {
              "options": [
                "Celsius",
                "Fahrenheit"
              ],
              "icon": "mdi:temperature-celsius",
              "friendly_name": "Inkbird BBQ thermometer Temperature unit"
            },
            "last_changed": "2023-03-23T03:34:40.843486+00:00",
            "last_updated": "2023-03-23T03:34:40.843486+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": "s",
          "state": {
            "entity_id": "number.inkbird_bbq_thermometer_screen_timeout",
            "state": "60",
            "attributes": {
              "min": 0,
              "max": 3600,
              "step": 1.0,
              "mode": "auto",
              "unit_of_measurement": "s",
              "icon": "mdi:camera-timer",
              "friendly_name": "Inkbird BBQ thermometer Screen timeout"
            },
            "last_changed": "2023-03-22T21:37:14.650036+00:00",
            "last_updated": "2023-03-22T21:37:14.650036+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "number.inkbird_bbq_thermometer_calibration_probe_1",
            "state": "0.0",
            "attributes": {
              "min": -7.0,
              "max": 7.0,
              "step": 0.1,
              "mode": "auto",
              "temp_unit": "C",
              "icon": "mdi:format-vertical-align-center",
              "friendly_name": "Inkbird BBQ thermometer Calibration probe 1"
            },
            "last_changed": "2023-03-22T21:37:14.650551+00:00",
            "last_updated": "2023-03-23T03:34:40.838057+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "number.inkbird_bbq_thermometer_calibration_probe_2",
            "state": "0.0",
            "attributes": {
              "min": -7.0,
              "max": 7.0,
              "step": 0.1,
              "mode": "auto",
              "temp_unit": "C",
              "icon": "mdi:format-vertical-align-center",
              "friendly_name": "Inkbird BBQ thermometer Calibration probe 2"
            },
            "last_changed": "2023-03-22T21:37:14.651107+00:00",
            "last_updated": "2023-03-23T03:34:40.838719+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "number.inkbird_bbq_thermometer_calibration_probe_3",
            "state": "0.0",
            "attributes": {
              "min": -7.0,
              "max": 7.0,
              "step": 0.1,
              "mode": "auto",
              "temp_unit": "C",
              "icon": "mdi:format-vertical-align-center",
              "friendly_name": "Inkbird BBQ thermometer Calibration probe 3"
            },
            "last_changed": "2023-03-22T21:37:14.651621+00:00",
            "last_updated": "2023-03-23T03:34:40.839323+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "number.inkbird_bbq_thermometer_calibration_probe_4",
            "state": "0.0",
            "attributes": {
              "min": -7.0,
              "max": 7.0,
              "step": 0.1,
              "mode": "auto",
              "temp_unit": "C",
              "icon": "mdi:format-vertical-align-center",
              "friendly_name": "Inkbird BBQ thermometer Calibration probe 4"
            },
            "last_changed": "2023-03-22T21:37:14.652123+00:00",
            "last_updated": "2023-03-23T03:34:40.842302+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": null,
          "device_class": null,
          "original_device_class": "switch",
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "switch.inkbird_bbq_thermometer",
            "state": "on",
            "attributes": {
              "device_class": "switch",
              "friendly_name": "Inkbird BBQ thermometer"
            },
            "last_changed": "2023-03-22T21:37:14.654384+00:00",
            "last_updated": "2023-03-22T21:37:14.654384+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": "switch",
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "switch.inkbird_bbq_thermometer_alarm",
            "state": "on",
            "attributes": {
              "device_class": "switch",
              "friendly_name": "Inkbird BBQ thermometer Alarm"
            },
            "last_changed": "2023-03-22T21:37:14.654910+00:00",
            "last_updated": "2023-03-22T21:37:14.654910+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "light.inkbird_bbq_thermometer_backlight",
            "state": "off",
            "attributes": {
              "supported_color_modes": [
                "onoff"
              ],
              "friendly_name": "Inkbird BBQ thermometer Backlight",
              "supported_features": 0
            },
            "last_changed": "2023-03-22T21:37:14.652454+00:00",
            "last_updated": "2023-03-22T21:37:14.652454+00:00"
          }
        }
      ]
    }
  }
}