-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
Zigbee_Temp_Hum_Sensor_Sleepy.ino : Temperature and Humidity value not correct reported in Home Assistant #10601
Comments
@P-R-O-C-H-Y both number represent float from 16bit 0xFFFF divided by 100. One signed and one unsigned. |
Hi @phiphi060, those values are default. So it. looks you never send the updated values. Can you please set debug level to "Verbose" and paste log from the device? |
Hey Prochy, My Home Assistant run as Stand-Alone HA OS on a Raspberry Pi5 8GB with SSD How i have say in my precedent message, i have test to set the temperature value at 22°C directly in Sketch but without success The exemple Sketch "Zigbee_Temperature_Sensor" from Library august 2024 run perfectly but this sketch has no humidity Sensor ! |
When i set the battery level to 80 % this is correct reported in Home Assistant :) |
Are you using the UART port or the USB port of the ESP32-H2? Will help you to get the logs. So re are running different gateways, so maybe there will be a change needed in the delay, that's the only thing I can think of. Also if you don't need the sleepy device, you can easily add the humidity sensor to the exemple Sketch "Zigbee_Temperature_Sensor", just copy the related lines to the Humidity sensor from this example to the old one :) |
Hi, First problem - controller may remember about old configuration, if other sketch was loaded before (like RGB lamp etc.) So controller must be restarted after removing the device. Second - something looks not right while join process.
I have seen cases, where the manufacturer and device type were shown, but no values were reported. Have replaced the sleep with delay(10000), but in this case the setup() procedure will not be executed more. So - something maybe wrong.... BTW: the sample "Zigbee_Color_Dimmable_Light" is working (more or less, can switch colors, brightness, on/off, but cannot set the startup value as sample - but this is an other problem) |
@P-R-O-C-H-Y
For me it looks like that a "session" like parameter is lost after power down/reboot - so that gateway cannot recognize the already known device. if it help - this I see in console, while device is rebooting every x seconds now (only after power off/on):
|
Additional debug log:
If you need longer log file or something else tell me.... BTW: tested also with latest RC - same result
|
@phiphi060 I have seen that there maybe a problem with battery powered devices, will open a new issue (#10612). |
@michapr |
I have updated the ESP32 Arduino Library to 3.1.0-RC3 and updated the Home Assistant Core to the latest version but the problem stay the same. |
As many of you are using the Zigbee2MQTT, I will also try that instead of using the HomeAssistant. Maybe I will be able to reproduce it. Give me some time to properly test everything and I will keep you updated :) Thank you all for great reports and testing. |
I have add humidity cluster to the temperature sensor example code, it will work fine (without Battery level and without deepsleep). Reporting is working |
@phiphi060 are you using H2 or C6? |
@phiphi060 Can you try to test with the changes from this PR #10623 ? Thank you |
@P-R-O-C-H-Y I'm using ESP32H2 |
So after first reboot (waking up from deep sleep), the chip is always rebooting? |
@P-R-O-C-H-Y I have tested with the PR#10623 modifications but the problem stay the same : |
@phiphi060 please set debug level to Verbose in the Arduino IDE Tools menu. Flash again, and post the logs then. |
@P-R-O-C-H-Y I have set the debug level to Verbose but i don't see more in serial monitor. // Copyright 2024 Espressif Systems (Shanghai) PTE LTD /**
#ifndef ZIGBEE_MODE_ED #include "Zigbee.h" #define BUTTON_PIN 9 //Boot button for C6/H2 ZigbeeTempSensor zbTempSensor = ZigbeeTempSensor(TEMP_SENSOR_ENDPOINT_NUMBER); /************************ Temp_hum sensor *****************************/ /********************* Arduino functions **************************/ Serial.begin(115200); // Init button switch // Optional: set Zigbee device name and model // Set minimum and maximum temperature measurement value (10-50°C is default range for chip temperature measurement) // Set tolerance for temperature measurement in °C (lowest possible value is 0.01°C) // Add humidity cluster to the temperature sensor device with min, max and tolerance values // Add endpoint to Zigbee Core // When all EPs are registered, start Zigbee in End Device mode // Start Temperature sensor reading task // Set reporting interval for temperature measurement in seconds, must be called after Zigbee.begin() void loop() { |
@phiphi060 are you using UART or USB port on the devkit? |
@P-R-O-C-H-Y I am using USB Port on the devkit. I don't have an USB --> UART interface |
@phiphi060 So can you please also set this option in the Arduino IDE->Tools menu: |
@P-R-O-C-H-Y Now i have installed the driver for the CP210x USB to UART Bridge and connected the ESP32H2 over UART. |
yes, right, it is not working. Can confirm it for ESP32C6, even with last PR #10636 no changes, is rebooting... |
Somehow managed to not see this thread before making #10644. I was able to provide some more detailed logs in that issue that would probably be of help. |
@Nawor3565 Device does not like to reconnect after reboot/restart in most cases. I think if device will stable join again after reboot / restart, then the sleeping device also will work |
@phiphi060 you can give a try with changes from #10651 :) |
@P-R-O-C-H-Y I have tested with #10651 but now i have a compile error : FQBN: esp32:esp32:esp32h2:CDCOnBoot=cdc,PartitionScheme=zigbee,DebugLevel=verbose,EraseFlash=all,ZigbeeMode=ed cmd /c if exist "C:\Users\phili\OneDrive\Bureau\Zigbee_Temp_Hum_Sensor_Sleepy\partitions.csv" COPY /y "C:\Users\phili\OneDrive\Bureau\Zigbee_Temp_Hum_Sensor_Sleepy\partitions.csv" "C:\Users\phili\AppData\Local\Temp\arduino\sketches\70B575C8A47AEF6780D37218E5C6316A\partitions.csv" C:\Users\phili\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.1.0-RC3\libraries\Zigbee\src\ZigbeeCore.cpp:315:23: error: 'class ZigbeeEP' has no member named 'bound'; did you mean 'isBound'?315 | if (!(*it)->bound() || (*it)->epAllowMultipleBinding()) { Using library Zigbee at version 3.0.5 in folder: C:\Users\phili\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.1.0-RC3\libraries\Zigbee Compilation error: exit status 1 I have used the sketch in your branch : // Copyright 2024 Espressif Systems (Shanghai) PTE LTD /**
#ifndef ZIGBEE_MODE_ED #include "Zigbee.h" #define BUTTON_PIN 9 //Boot button for C6/H2 #define uS_TO_S_FACTOR 1000000ULL /* Conversion factor for micro seconds to seconds / ZigbeeTempSensor zbTempSensor = ZigbeeTempSensor(TEMP_SENSOR_ENDPOINT_NUMBER); /************************ Temp sensor *****************************/ // Use temperature value as humidity value to demonstrate both temperature and humidity // Update temperature and humidity values in Temperature sensor EP // Report temperature and humidity values Serial.printf("Reported temperature: %.2f°C, Humidity: %.2f%%\r\n", temperature, humidity); // Put device to deep sleep /********************* Arduino functions **************************/ // Configure the wake up source and set to wake up every 5 seconds // Optional: set Zigbee device name and model // Set minimum and maximum temperature measurement value (10-50°C is default range for chip temperature measurement) // Set tolerance for temperature measurement in °C (lowest possible value is 0.01°C) // Set power source to battery and set battery percentage to measured value (now 100% for demonstration) // Add humidity cluster to the temperature sensor device with min, max and tolerance values // Add endpoint to Zigbee Core // Create a custom Zigbee configuration for End Device with keep alive 10s to avoid interference with reporting data // When all EPs are registered, start Zigbee in End Device mode // Delay 5s (may be adjusted) to allow establishing proper connection with coordinator, needed for sleepy devices void loop() { // Call the function to measure temperature and put the device to sleep |
Hi @phiphi060, can you please use the |
Hi @P-R-O-C-H-Y , how can i install the release/v3.1.x in Arduino ? |
Board
ESP32H2 Dev Module
Device Description
Only the Chip module
Hardware Configuration
No external connections
Version
latest master (checkout manually)
IDE Name
Arduino
Operating System
Windows 11
Flash frequency
921600
PSRAM enabled
yes
Upload speed
115200
Description
The Temperature value is ever reported in Home Assistant with -327.7 °C
The Humidity value is ever reported in Home Assistant with 655.4 %
I have test to give fixed temperature and humidity value but the reported values in Home Assistant stay the sames
Sketch
Original example sketch "Zigbee_Temp_Hum_Sensor_Sleepy.ino" without modification
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: