tuya-local
tuya-local copied to clipboard
Bresser Smart 7-in-1 weather station not correctly identified (Tuya local 2024.5.3)
Describe the bug
I recognized a lot of the weatherstation sensors that was already installed where suddenly in status "Unknown" and I thought I would go the easy way, remove Tuya local and reinstall. Unfortunately it didn't went well, since it is regonized as expected first but then things go wrong. See screenshots:
(No screenshot of the ID/IP/Local Key part)
To Reproduce I do have Home Assistant Core 2024.5.5 and Tuya local 2024.5.3 and can redo this every time. I can't remember when I first installed the setup.
Expected behavior Above steps with auto detection of the weather station
Additional context
Without the log messages, it is impossible to know why a device is not being detected.
I found this in the logs:
2024-06-06 12:58:34.203 DEBUG (MainThread) [custom_components.tuya_local.config_flow] Scanning network to get IP address for bf0e9381486580eb56pntj.
2024-06-06 12:58:36.495 DEBUG (MainThread) [custom_components.tuya_local.config_flow] Found: {'ip': '192.168.178.25', 'version': '3.3', 'id': 'bf0e9381486580e
b56pntj', 'product_id': '8qk6p78udvbjwlof', 'data': {'ip': '192.168.178.25', 'gwId': 'bf0e9381486580eb56pntj', 'active': 2, 'ablilty': 0, 'encrypt': True, 'pr
oductKey': '8qk6p78udvbjwlof', 'version': '3.3'}}
2024-06-06 12:58:43.533 DEBUG (MainThread) [custom_components.tuya_local.device] Refreshing device state for Test
2024-06-06 12:58:43.533 INFO (MainThread) [custom_components.tuya_local.device] Setting protocol version for Test to 3.3
2024-06-06 12:58:43.636 DEBUG (SyncWorker_30) [custom_components.tuya_local.device] Test refreshed device state: {"dps": {"1": 234, "2": 66, "3": "high", "9":
"c", "10": "m_s", "11": "hpa", "12": "mm", "13": "lux", "54": 10073, "55": 0, "58": "none", "60": 1000000, "68": "none", "101": 361}}
2024-06-06 12:58:43.636 DEBUG (SyncWorker_30) [custom_components.tuya_local.device] new state (incl pending): {"updated_at": 1717671523.63636, "1": 234, "2": 66, "3": "high", "9": "c", "10": "m_s", "11": "hpa", "12": "mm", "13": "lux", "54": 10073, "55": 0, "58": "none", "60": 1000000, "68": "none", "101": 361}
...
2024-06-06 12:58:45.831 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Loaded device config bresser_weather_station.yaml
2024-06-06 12:58:45.832 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Not match for Weather station, missing required DPs: [{'30': '
str'}, {'38': 'int'}, {'39': 'int'}, {'56': 'int'}, {'57': 'int'}, {'61': 'int'}, {'62': 'int'}, {'63': 'int'}, {'64': 'int'}, {'65': 'int'}, {'67': 'int'}]
I switched DP mode on/off in IOT Tuya without any difference in behaviour.
The reported DP list from IOT Tuya from this device:
DP list JSON
{
"result": {
"properties": [
{
"code": "temp_current",
"custom_name": "",
"dp_id": 1,
"time": 1717666261145,
"value": 234
},
{
"code": "humidity_value",
"custom_name": "",
"dp_id": 2,
"time": 1717658821207,
"value": 66
},
{
"code": "battery_state",
"custom_name": "",
"dp_id": 3,
"time": 1717089601651,
"value": "high"
},
{
"code": "temp_unit_convert",
"custom_name": "",
"dp_id": 9,
"time": 1717089602943,
"value": "c"
},
{
"code": "windspeed_unit_convert",
"custom_name": "",
"dp_id": 10,
"time": 1717089603062,
"value": "m_s"
},
{
"code": "pressure_unit_convert",
"custom_name": "",
"dp_id": 11,
"time": 1717089602955,
"value": "hpa"
},
{
"code": "rain_unit_convert",
"custom_name": "",
"dp_id": 12,
"time": 1717089603073,
"value": "mm"
},
{
"code": "bright_unit_convert",
"custom_name": "",
"dp_id": 13,
"time": 1717089603166,
"value": "lux"
},
{
"code": "fault_type",
"custom_name": "",
"dp_id": 22,
"time": 1714752675446,
"value": "offline"
},
{
"code": "battery_status",
"custom_name": "",
"dp_id": 30,
"time": 1714682189415,
"value": "low"
},
{
"code": "battery_state_1",
"custom_name": "",
"dp_id": 31,
"time": 1707143567554,
"value": "low"
},
{
"code": "battery_state_2",
"custom_name": "",
"dp_id": 32,
"time": 1707143567554,
"value": "low"
},
{
"code": "battery_state_3",
"custom_name": "",
"dp_id": 33,
"time": 1707143567554,
"value": "low"
},
{
"code": "temp_current_external",
"custom_name": "",
"dp_id": 38,
"time": 1714751663607,
"value": 136
},
{
"code": "humidity_outdoor",
"custom_name": "",
"dp_id": 39,
"time": 1714751751169,
"value": 63
},
{
"code": "temp_current_external_1",
"custom_name": "",
"dp_id": 40,
"time": 1707143567554,
"value": -400
},
{
"code": "humidity_outdoor_1",
"custom_name": "",
"dp_id": 41,
"time": 1707143567554,
"value": 0
},
{
"code": "temp_current_external_2",
"custom_name": "",
"dp_id": 42,
"time": 1707143567554,
"value": -400
},
{
"code": "humidity_outdoor_2",
"custom_name": "",
"dp_id": 43,
"time": 1707143567554,
"value": 0
},
{
"code": "temp_current_external_3",
"custom_name": "",
"dp_id": 44,
"time": 1707143567554,
"value": -400
},
{
"code": "humidity_outdoor_3",
"custom_name": "",
"dp_id": 45,
"time": 1707143567554,
"value": 0
},
{
"code": "atmospheric_pressture",
"custom_name": "",
"dp_id": 54,
"time": 1717671661250,
"value": 10072
},
{
"code": "pressure_drop",
"custom_name": "",
"dp_id": 55,
"time": 1717089601679,
"value": 0
},
{
"code": "windspeed_avg",
"custom_name": "",
"dp_id": 56,
"time": 1714751777030,
"value": 0
},
{
"code": "windspeed_gust",
"custom_name": "",
"dp_id": 57,
"time": 1714751702327,
"value": 0
},
{
"code": "wind_direct",
"custom_name": "",
"dp_id": 58,
"time": 1717089602643,
"value": "none"
},
{
"code": "rain_24h",
"custom_name": "",
"dp_id": 60,
"time": 1717089602532,
"value": 1000000
},
{
"code": "rain_rate",
"custom_name": "",
"dp_id": 61,
"time": 1714751776750,
"value": 0
},
{
"code": "uv_index",
"custom_name": "",
"dp_id": 62,
"time": 1714751776650,
"value": 0
},
{
"code": "bright_value",
"custom_name": "",
"dp_id": 63,
"time": 1714751776553,
"value": 6233
},
{
"code": "dew_point_temp",
"custom_name": "",
"dp_id": 64,
"time": 1714751751481,
"value": 66
},
{
"code": "feellike_temp",
"custom_name": "",
"dp_id": 65,
"time": 1714751663945,
"value": 136
},
{
"code": "heat_index",
"custom_name": "",
"dp_id": 66,
"time": 1714571041889,
"value": 260
},
{
"code": "windchill_index",
"custom_name": "",
"dp_id": 67,
"time": 1714751663814,
"value": 136
},
{
"code": "com_index",
"custom_name": "",
"dp_id": 68,
"time": 1717089601860,
"value": "none"
},
{
"code": "wind_dir360",
"custom_name": "",
"dp_id": 101,
"time": 1717089602624,
"value": 361
},
{
"code": "all_max_min",
"custom_name": "",
"dp_id": 102,
"time": 1717671901005,
"value": "EQAA6UAA6kMnVCdeBAJZZQJZZQK9AA9CQAC1AAST4QH1AfUB9QH1AlkCWQMhAyE="
},
{
"code": "CH_type",
"custom_name": "",
"dp_id": 103,
"time": 1717089601102,
"value": "AgIC"
}
]
},
"success": true,
"t": 1717671913294,
"tid": "a5b4343323f411ef8e16c2a4c602d591"
}
So for some reason, Tuya local hasn't all the DPs from the device?
The mystery is solved. My external sensors had no battery and thus did not report any values. I knew about this but didn't think it would affect the correct detection in Tuya-local. After having the sensors back alive the device is identified correct since the DPs now match the expected:
2024-06-13 07:47:17.366 DEBUG (MainThread) [custom_components.tuya_local.device] Refreshing device state for Test
2024-06-13 07:47:17.367 INFO (MainThread) [custom_components.tuya_local.device] Setting protocol version for Test to 3.3
2024-06-13 07:47:17.637 DEBUG (SyncWorker_25) [custom_components.tuya_local.device] Test refreshed device state: {"dps": {"1": 209, "2": 51, "3": "high", "9":
"c", "10": "m_s", "11": "hpa", "12": "mm", "13": "lux", "30": "high", "38": 107, "39": 77, "54": 10090, "55": 0, "56": 0, "57": 0, "58": "west_north_west", "
60": 0, "61": 0, "62": 31, "63": 25663, "64": 68, "65": 107, "67": 107, "68": "moist", "101": 288}}
2024-06-13 07:47:17.637 DEBUG (SyncWorker_25) [custom_components.tuya_local.device] new state (incl pending): {"updated_at": 1718257637.636981, "1": 209, "2":
51, "3": "high", "9": "c", "10": "m_s", "11": "hpa", "12": "mm", "13": "lux", "30": "high", "38": 107, "39": 77, "54": 10090, "55": 0, "56": 0, "57": 0, "58"
: "west_north_west", "60": 0, "61": 0, "62": 31, "63": 25663, "64": 68, "65": 107, "67": 107, "68": "moist", "101": 288}
I don't know why the device is called "Test" but it works now so this bug can be closed. I wonder why it only had the alive DPs vs the one which could be available as I saw it in the IOT portal.
The device "Test" is a temporary device that is created for testing the connection and matching to an actual device config.
Closing issue since it's not a bug per se but an unexpected state of the device.
A fix was made, but not yet released, so it should remain open until the release. The fix will make the external sensors optional so the device can still be detected when they are not connected. This was already the case for the additional sensors that the device supports, but previously external sensor number 1 was required.