-
Notifications
You must be signed in to change notification settings - Fork 37
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
HA_temperature_sensor example not updating HomeAssistant (TZ-1427) #515
Comments
small update, add the following: ` esp_zb_zcl_status_t status; `
} with the following response. ` ` |
@ear9mrn ,
Suggestion
Could you please share the actual log for the message |
made the changes you suggest above including setting the delta value to 0. Still no success, I am not seeing anything show up in the zigbee2mqtt logs when the message appears to be sent from the esp32-h2 When I hit the refresh button (get command) within zigbee2mqtt it does respond (correctly) and the temperature is updated.
|
Hi, Could you please refer to the example README without making any changes in application to confirm that the reporting mechanism works? This will help in addressing the issue. By the way, if you have made application changes or are experiencing failures when joining other platforms, I suggest providing a |
I can confirm using the setup described in the README.md that the temperature is reported to the thermostat device correctly via zigbee. |
now using wireshark to sniff the packets. The first image below is from an Aqara Temp/Press/Humidity sensor. and here is a packet from ESP32-H2 with the temperature example installed. Although it is encrypted. I am wondering, maybe it is using the wrong key to encrypt the message that is sent to zigbee2mqtt? Where can I find the network key? |
found this key in the docs but does not seem enable wireshark to decrypt the messages. |
Has the Let's first confirm whether the temperature value is being sent by the device. |
Yes. my ESP-h2 (temperature) and ESP-C6 are talking to each other, no problems. Still cannot decrypt the message though using wireshark. I also noticed changing the network mask (to a single channel eg. 16) appears to have no effect, they always appear to connect on channel 14. |
I believe you only need to modify the following code in the
|
Many thanks, the temperature initially updated, the first time I ran it but then refused after a reboot. Another issue, when swapping from connecting to my esp32-c6 (as coordinator on channel 14) to zigbee2mqtt (in home assistant on channel 11) my ESP32-H2 would not join, error below.
I had to erase the flash and re-flash. I assume it was trying to rejoin the old network and could not find it. Is there a more elegant solution in order to swap from one network to another other than "erase_flash".
Thanks for all your help. Pete. |
Question
I have installed esp-idf and compiled the HA_Temperature_sensor example and in general is works fine connecting to home assistant using zigbee2mqtt. The only issue is that the temperature is not automatically updating. The temperature is exposed but I have to hit the "refresh" button to get the latest temperature so show up. Not much use if you want to track temperature over time.
As I am using this to get proof of concept and to try and understand a little better how zigbee works using esp32-h2 and esp32-c6 I do not have a temperature sensor so I have it generate a random number inside the temp_sensor_driver_value_update function with the following.
tsens_value = rand()%10+20;
I do not think this would have any impact on the main code to update the home assistant.
with the esp_app_temp_sensor_handler function I place a log output as follows:
ESP_EARLY_LOGI(TAG, "Send 'Temp change (%d)...' command", measured_value/100);
Which show the value "sent" every 10 seconds.
On the zigbee2mqtt I am not seeing anything in the logs showing any messages arriving. I do see log output when I hit the refresh button.
`
[2024-12-29 19:21:00] debug: zh:ember: ~~~> [ZCL to=0x4831b7fffec03a92:33424 apsFrame={"profileId":260,"clusterId":1026,"sourceEndpoint":1,"destinationEndpoint":10,"options":4416,"groupId":0,"sequence":0} header={"frameControl":{"reservedBits":0,"frameType":0,"direction":0,"disableDefaultResponse":true,"manufacturerSpecific":false},"transactionSequenceNumber":61,"commandIdentifier":0}]
[2024-12-29 19:21:00] debug: zh:ember:ezsp: ezspMessageSentHandler(): callback called with: [status=OK], [type=DIRECT], [indexOrDestination=33424], [apsFrame={"profileId":260,"clusterId":1026,"sourceEndpoint":1,"destinationEndpoint":10,"options":4416,"groupId":0,"sequence":250}], [messageTag=59]
[2024-12-29 19:21:00] debug: zh:ember:ezsp: ezspIncomingMessageHandler(): callback called with: [type=UNICAST], [apsFrame={"profileId":260,"clusterId":1026,"sourceEndpoint":10,"destinationEndpoint":1,"options":3392,"groupId":0,"sequence":205}], [packetInfo:{"senderShortId":33424,"senderLongId":"0xFFFFFFFFFFFFFFFF","bindingIndex":255,"addressIndex":255,"lastHopLqi":172,"lastHopRssi":-68,"lastHopTimestamp":0}], [messageContents=183d01000000298c0a]
[2024-12-29 19:21:00] debug: zh:controller: Received payload: clusterID=1026, address=33424, groupID=0, endpoint=10, destinationEndpoint=1, wasBroadcast=false, linkQuality=172, frame={"header":{"frameControl":{"frameType":0,"manufacturerSpecific":false,"direction":1,"disableDefaultResponse":true,"reservedBits":0},"transactionSequenceNumber":61,"commandIdentifier":1},"payload":[{"attrId":0,"status":0,"dataType":41,"attrData":2700}],"command":{"ID":1,"name":"readRsp","parameters":[{"name":"attrId","type":33},{"name":"status","type":32},{"name":"dataType","type":32,"conditions":[{"type":"statusEquals","value":0}]},{"name":"attrData","type":1000,"conditions":[{"type":"statusEquals","value":0}]}]}}
`
So to me it looks like the "message" that should be sent from this function is not being sent for some reason.
`
static void esp_app_temp_sensor_handler(float temperature)
{
int16_t measured_value = zb_temperature_to_s16(temperature);
/* Update temperature sensor measured value */
esp_zb_lock_acquire(portMAX_DELAY);
esp_zb_zcl_set_attribute_val(HA_ESP_SENSOR_ENDPOINT,
ESP_ZB_ZCL_CLUSTER_ID_TEMP_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE,
ESP_ZB_ZCL_ATTR_TEMP_MEASUREMENT_VALUE_ID, &measured_value, false);
esp_zb_lock_release();
ESP_EARLY_LOGI(TAG, "Send 'Temp change (%d)...' command", measured_value/100);
}
`
Apologies as I am relatively new to this API and looking for some help to try and figure out what is happening. It does feel like it is an issue on the esp32-h2 side and not on the zigbee2mqtt side.
Thanks.
Additional context.
No response
The text was updated successfully, but these errors were encountered: