Closed IhorSyerkov closed 3 years ago
Could you share you configuration logs, something like:
[15:47:40][C][idasen_desk_controller:106]: Idasen Desk Controller:
[15:47:40][C][idasen_desk_controller:107]: Mac address: 00:00:00:00:00
[15:47:40][C][idasen_desk_controller:108]: Desk height 'Desk Height'
[15:47:40][C][idasen_desk_controller:108]: Unit of Measurement: 'cm'
[15:47:40][C][idasen_desk_controller:108]: Accuracy Decimals: 0
[15:47:40][C][idasen_desk_controller:108]: Icon: 'mdi:arrow-up-down'
[15:47:40][C][idasen_desk_controller:109]: Desk moving 'Desk Moving'
[15:47:40][C][idasen_desk_controller:109]: Device Class: 'moving'
[15:47:40][C][idasen_desk_controller:110]: Desk connection 'Desk Connection'
[15:47:40][C][idasen_desk_controller:110]: Device Class: 'connectivity'
[15:47:40][C][idasen_desk_controller:111]: Desk 'Desk'
[10:43:13][C][idasen_desk_controller:106]: Idasen Desk Controller:
[10:43:13][C][idasen_desk_controller:107]: Mac address: 00:00:00:00:00:00
[10:43:13][C][idasen_desk_controller:108]: Desk height 'Desk Height'
[10:43:13][C][idasen_desk_controller:108]: Unit of Measurement: 'cm'
[10:43:13][C][idasen_desk_controller:108]: Accuracy Decimals: 0
[10:43:13][C][idasen_desk_controller:108]: Icon: 'mdi:arrow-up-down'
[10:43:13][C][idasen_desk_controller:109]: Desk moving 'Desk Moving'
[10:43:13][C][idasen_desk_controller:109]: Device Class: 'moving'
[10:43:13][C][idasen_desk_controller:110]: Desk connection 'Desk Connection'
[10:43:13][C][idasen_desk_controller:110]: Device Class: 'connectivity'
[10:43:13][C][idasen_desk_controller:111]: Desk 'Desk'
So the sensor.desk_height
is always 0
even after a restart ?
A notification callback is supposed to be called when the desk is moving but it didn't seem to work in your case. When the desk is moving, is there a led flashing continuously on your ESP32 ?
sensor.desk_height
have some value. I guest it sets right after connect. When desk is moving led on esp not flashing, it allays on.
will try to add logs to deskHeightUpdateNotificationCallback
function
I added debug log in deskHeightUpdateNotificationCallback
func and looks like it never called
Add second parameter to registerForNotify
fixed issue for me. Now notifications works (height and moving)
this->m_output_char_->registerForNotify(deskHeightUpdateNotificationCallback, true);
As I found, second parameter changes a value for descriptor
uint8_t val[] = {0x01, 0x00};
if(!notifications) val[0] = 0x02;
BLERemoteDescriptor* desc = getDescriptor(BLEUUID((uint16_t)0x2902));
desc->writeValue(val, 2);
Not sure is only issue for my case. As I understand for you @j5lien everything works without this parameter?!
I thought this argument was set to true by default but it can be forced to this value.
I hope #5 will prevent this issue
In Home Assistant
sensor.desk_height
andbinary_sensor.desk_moving
never being updated after connection.for moving I use
cover.open_cover
,cover.close_cover
,cover.stop_cover
andcover.set_cover_position
servicesMy config
there is logs when use
cover.open_cover
when use
cover.set_cover_position