digaus / esphome-components-eqiva

Other
18 stars 9 forks source link

Problem: lock.unlock service not work #18

Open tergontor opened 1 month ago

tergontor commented 1 month ago

Hello, making a flow in Node Red so that depending on the time of day the lock takes 1 or 4 turns, I have discovered that the lock.unlock service does not work for me, the lock or the open work perfectly. From HA in developer tools - services like clicking from the webserver on the icon like from Node Red, it does nothing. An example of the log when I click from webserver:

[22:56:49][W][web_server_idf:070]: Only application/x-www-form-urlencoded supported for POST request [22:56:49][D][eqiva_key_ble:392]: Check send frag: not-empty, not-sending [22:56:49][D][text_sensor:064]: 'Mac Address': Sending state '00:1A:22:18:45:F0' [22:56:49][D][esp32_ble_client:110]: [0] [00:1A:22:18:45:F0] ESP_GATTC_WRITE_CHAR_EVT [22:56:49][D][text_sensor:064]: 'Lock BLE State': Sending state 'ESTABLISHED'

[22:56:49][I][eqiva_key_ble:069]: Send successfull: 1335716920 | 1335716920 | 0 [22:56:49][D][eqiva_key_ble:392]: Check send frag: empty, not-sending [22:56:49][D][text_sensor:064]: 'Mac Address': Sending state '00:1A:22:18:45:F0' [22:56:49][D][esp32_ble_client:110]: [0] [00:1A:22:18:45:F0] ESP_GATTC_NOTIFY_EVT [22:56:49][D][text_sensor:064]: 'Lock BLE State': Sending state 'ESTABLISHED'

[22:56:49][D][eqiva_key_ble:107]: # Auth value:

[22:56:49][D][eqiva_key_ble:111]: # Crypted data:

[22:56:49][D][eqiva_key_ble:125]: # Decrypted:

[22:56:49][D][eqiva_key_ble:185]: Case 0x83 [22:56:49][D][text_sensor:064]: 'Lock Status': Sending state 'LOCKED' [22:56:49][D][text_sensor:064]: 'Low Battery': Sending state 'true' [22:56:49][D][eqiva_key_ble:215]: # Lock state: 3 [22:56:49][D][eqiva_key_ble:216]: # Battery low: true [22:56:49][D][eqiva_key_ble:392]: Check send frag: empty, not-sending [22:56:49][W][component:237]: Component esp32_ble took a long time for an operation (110 ms). [22:56:49][W][component:238]: Components should block for at most 30 ms.

Do you know what this error could be due to? Greetings and thanks

digaus commented 1 month ago

I think after changing settings you need to call lock/open once.

You can test this with original app. This seems to be a restriction of the lock because after changing the turns it doesn't know how often it has to turn to just unlock the device and not open it.

tergontor commented 1 month ago

Thank you very much for your response and your help. Regarding what was written, comment that I have two flows in Node Red:

FLOW1: works fine 1- Check if lock.lock_1 is locked for 5 minutes. 2-if it is met and is within the period 9:30 to 21:55, call the service to adjust the turns to 1.. 3- call the service to save the change with button.lock_settings_apply 4- call to lock.lock service to lock the door with 1 turn. There is a 5 second delay between nodes

FLOW2 1- at 10 p.m. see if the entity lock.lock_1 is locked 2-if it is met, it goes to the next node that makes a call to the lock.unlock service to unlock it. This call to service does nothing. 3- the flow continues with a call to the service to adjust the turns to 4 4- call the service to save the change with button.lock_settings_apply 5- call to lock.lock service to lock the door with the 4 turns, There is a 5 second delay between nodes

Partial solution: If instead of making the call to the lock.unlock service I make it to lock.open, the flow works fine but I was afraid that the door would be left open and then could not be closed. I have verified that the door stays open but if it does not open too much, the latch closes again and the door locks with 4 turns.

I deleted the Eqiva app because it conflicted with esphome. “You can test this with original app. This seems to be a restriction of the lock because after changing the turns it doesn't know how often it has to turn to just unlock the device and not open it.” What you say makes a lot of sense. Greetings and thank you very much.

pvtex commented 3 weeks ago

i have the same problem.

lock.lock is working and lock.open is working but lock.unlock does not work.

pvtex commented 3 weeks ago

paired again and now i t works it is a miracle