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

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

Open
pvvx opened this issue Dec 10, 2023 · 18 comments
Labels
documentation Improvements or additions to documentation

Comments

@pvvx
Copy link
Owner

pvvx commented Dec 10, 2023

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.

  • Not on all HW variants, turning off the display leads to a significant reduction in consumption. Better results are obtained by increasing the measurement interval.

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

@pvvx pvvx added the documentation Improvements or additions to documentation label Dec 10, 2023
@pvvx pvvx changed the title ZHA - Setting offsets for temperature and humidity ZHA: Setting offsets for temperature and humidity Dec 10, 2023
@thkrmr
Copy link

thkrmr commented Dec 22, 2023

@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
Copy link
Owner Author

pvvx commented Dec 22, 2023

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
Copy link

thkrmr commented Dec 22, 2023

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
Copy link

gacopl commented Jan 11, 2024

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
Copy link

krzysztof-kwitt commented Jan 22, 2024

@gacopl Can you try this PR that add temp/humidifty calibration and others attributes to UI?
Koenkk/zigbee-herdsman-converters#6939

@gacopl
Copy link

gacopl commented Jan 26, 2024

@gacopl Can you try this PR that add temp/humidifty calibration and others attributes to UI?
Koenkk/zigbee-herdsman-converters#6939

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

@krzysztof-kwitt
Copy link

@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
Copy link

@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
Copy link

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.

@pvvx pvvx changed the title ZHA: Setting offsets for temperature and humidity ZHA: Setting offsets for temperature and humidity, turn off the display, measurement interval Apr 18, 2024
@f-sh1372
Copy link

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
Copy link
Owner Author

pvvx commented May 15, 2024

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
Copy link
Owner Author

pvvx commented May 15, 2024

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
Copy link

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
Copy link
Owner Author

pvvx commented May 16, 2024

  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
Copy link

Meisam-kh commented May 16, 2024

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
Copy link
Owner Author

pvvx commented May 17, 2024

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
Copy link

Danstiv commented Oct 18, 2024

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:

  • SONOFF_Zigbee_3.0_USB_Dongle.
  • LYWSD03MMC (B 1.5)

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

@pvvx
Copy link
Owner Author

pvvx commented Oct 18, 2024

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

install ZHA Toolkit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

8 participants