pvvx / ZigbeeTLc

Custom firmware for Zigbee 3.0 IoT devices on the TLSR825x chip
Other
409 stars 23 forks source link

ZHA: Setting offsets for temperature and humidity, turn off the display, measurement interval #30

Open pvvx opened 11 months ago

pvvx commented 11 months ago

For firmware version 0.1.2.1+

ClusterID: 0x0204 (Thermostat User Interface Configuration) Attr: 0x0100, INT16 (id:0x29), Temperature offset, in 0.01° steps, range: -32767 (-327.67°)..32767(+327.67°). Default 0. Attr: 0x0101, INT16 (id:0x29), Humidity offset, in 0.01% steps, range: -32767 (-327.67%)..32767(+327.67%). Default 0.

Attr: 0x0106, ENUM8 (id:0x30), Turn off the display. 1 - Display Off. Default 0 - Display On. Attr: 0x0107, UINT8 (id:0x20), Measurement interval, step 1 second, range: 3..255 seconds. Default 10 seconds.

LYWSD03MMC uses 4 display controller options. Not all types of display controllers have a shutdown command. Only for the controller in HW B1.9 there is documentation and a complete shutdown works for it. The version is determined by the addresses of the display and sensor on I2C

HW LCD I2C addr SHTxxx I2C addr Note
B1.4 0x3C (IST3055NA0) 0x70 (SHTC3)  
B1.5 UART! (Special MCU?) 0x70 (SHTC3)  
B1.6 UART! (Special MCU?) 0x44 (SHT4x)  
B1.7 0x3C 0x44 (SHT4x) Test original string HW
B1.9 0x3E (analogue BU9792FUV) 0x44 (SHT4x)  
B2.0 0x3C 0x44 (SHT4x) Test original string HW

Version 1.7 or 2.0 is determined at first run by reading the HW line written in Flash. Display matrices or controllers are different for all versions, except B1.7 = B2.0.

For firmware version 0.1.1.7 - 0.1.2.0

ClusterID: 0x0204 (Thermostat User Interface Configuration) Attr: 0x0100, INT8 (id:0x28), Temperature offset, in 0.01° steps, range: -127 (-12.7°)..127 (+12.7°). Default 0. Attr: 0x0101, INT8 (id:0x28), Humidity offset, in 0.01% steps, range: -127 (-12.7 %)..(+12.7 %). Default 0.

Offset for temperature.

image


Offset for humidity.

image

thkrmr commented 11 months ago

@pvvx sw_build_id = 3001-0117

ZHA Write Attribute throws an error, logs say Exception: InCluster 0x0204 not found for '...', endpoint 1 What could be the issue, do you know? Thank you.

pvvx commented 11 months ago

If a version update via OTA was used, then the thermometer must be registered again.

image

The "UserInterface" cluster should appear in "Manage Zigbee device".

image

thkrmr commented 11 months ago

If a version update via OTA was used, then the thermometer must be registered again.

@pvvx indeed I pushed the update via OTA. Thank you, will try.

gacopl commented 10 months ago

hi in Zigbee2MQTT I get cluster 516 has no command 256, when trying to set offset i flashed 03MMC with Telink over bluetooth, re registered couple times I am sure i have correct firmware 1118

"softwareBuildID": "3001-0118",

Am i doing something wrong ?

krzysztof-kwitt commented 10 months ago

@gacopl Can you try this PR that add temp/humidifty calibration and others attributes to UI? https://github.com/Koenkk/zigbee-herdsman-converters/pull/6939

gacopl commented 10 months ago

@gacopl Can you try this PR that add temp/humidifty calibration and others attributes to UI? https://github.com/Koenkk/zigbee-herdsman-converters/pull/6939

Don't know how to test tbh using official releases only

krzysztof-kwitt commented 10 months ago

@gacopl You need to paste code from PR description to new file and add refernece to this file in customization.yaml. For details, see: https://www.zigbee2mqtt.io/how_tos/how_to_support_new_devices.html

i4mr000t commented 9 months ago

@gacopl You need to paste code from PR description to new file and add refernece to this file in customization.yaml. For details, see: https://www.zigbee2mqtt.io/how_tos/how_to_support_new_devices.html

Would be very nice to set these values in the UI. Everytime I forgot the value "516" and have to look at it here.

I also think that a lot of users dont know that this is possible with zha.

i4mr000t commented 9 months ago

Using pvvx firmware because i switched from zha to z2m. If i now calibrate temp offset it’s showing in z2m but not on the display.

f-sh1372 commented 6 months ago

Hi Thanks for your projects. it is so useull. I flashed the Zigbee fw using your method. everything works fine but one of my sensors, shows humidity incorrect. I imported sensor in ZHA using your method. I have both "skyconnect" and "sonoff zigbee 3.0 USB dongle". I used zha toolkit and after "Read/Write Attribute" it shows this log and has error. does it relevant to device's sleep mode? I changed Tries to 100 but not success. I am grateful for your support and guidanc. zha toolkit01

pvvx commented 6 months ago

ZHA has been updated with Zigpy features. ZHA Toolkit has not been updated for the new version of Zigpy -> Some ZHA Toolkit functions do not work.

Home Assistant Core logs:

WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration zha_toolkit which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
pvvx commented 6 months ago

After updating via Zigbee OTA to version 0.1.2.1, it is advisable to delete the device in the ZHA and re-pair the device.

image

zha_toolkit_version: v1.1.10
zigpy_version: 0.63.5
zigpy_rf_version: 0.38.1
ieee_org: update.xiaomi_lywsd03mmc_z_firmware
ieee: a4:c1:38:0b:5e:ed:85:b7
command: attr_read
command_data: null
start_time: "2024-05-15T07:52:59.020252+00:00"
errors: []
params:
  endpoint_id: 1
  cluster_id: 516
  attr_id: 257
  dir: 0
  tries: 1
  expect_reply: true
  args: []
  read_before_write: true
  read_after_write: true
attr_type: "0x29"
write_is_equal: false
result_read:
  - "257": 0
  - {}
success: true
Meisam-kh commented 6 months ago

Thanks for your support. I deleted the device in the ZHA and re-pair the device. After that, Calibration was successful. but there is a problem. is there any solution to decrease time of update interval for Home assistant reading sensor data? It upadate sensor datas after 10 to 20 minutes (of course after data change). I would replace the battery with an adapter and I don't care about power consumption. in the below picture it is shows that last update is about 9 min and 21 min IMG_2804

pvvx commented 6 months ago
  1. Set the measurement interval to 3 seconds.
  2. Set the minInterval of the report to 0.

(!) If several such "fast" devices are used - the Zigbee network (RF channel) will be overloaded. The maximum number of devices will be limited... Some devices will fall out of the network.

Without the patch, ZHA sets the device to long reporting intervals.

(!) In some cases, when the data is rounded, the update in HA does not occur for the same values.

image

Meisam-kh commented 6 months ago

Forgive me, but I'm a complete beginner in this field and linux. Please help me with more details. 1- can I just set the measurement interval & min Interval without doing the patch? 2- According to the below picture, are the fields filled in a correct way? Screenshot 2024-05-17 01 15 37

3- for setting "min interval of the report" . would you please help me more? (show me which fields and how they should fill?)

pvvx commented 6 months ago

1- can I just set the measurement interval & min Interval without doing the patch? 3- for setting "min interval of the report" . would you please help me more? (show me which fields and how they should fill?)

When connecting a device or pressing the “RECONFIGURE” button, the ZHA sets the reporting intervals and delta changes specified in the internal code. Single adjustment of measure intervals will not help.


For short intervals of temperature and humidity reporting, the best solution is the BLE option. The BLE firmware by default transmits new measurements every 10 seconds. image image

You can reduce it to 5 seconds without changing the battery to a more powerful one. Using an external power source, you can install measurement and transmission intervals for 0.5 seconds.

Danstiv commented 1 month ago

Hello @pvvx! I see cluster 516 in ZHA UI, but it only has 3 attributes:

  1. keypad_lockout (id: 0x0001).
  2. schedule_programming_visibility (id: 0x0002).
  3. temperature_display_mode (id: 0x0000).

Is this some kind of configuration issue? Or do I need to install ZHA Toolkit?

Hardware:

So how to change offsets and measurement interval, now, at the end of 2024, can you give instructions? Thanks.

pvvx commented 1 month ago

Is this some kind of configuration issue? Or do I need to install ZHA Toolkit?

install ZHA Toolkit.