This driver should fix the connection issues:
https://bestow-regional.api.smartthings.com/invite/d4299eAR0D2o
PR:
SmartThingsCommunity:main
← hdlee27:fp2_241119
opened 12:43PM - 19 Nov 24 UTC
Check all that apply
# Type of Change
- [ ] WWST Certification Request
… - If this is your first time contributing code:
- [ ] I have reviewed the README.md file
- [ ] I have reviewed the CODE_OF_CONDUCT.md file
- [ ] I have signed the CLA
- [ ] I plan on entering a WWST Certification Request or have entered a request through the WWST Certification console at developer.smartthings.com
- [x] Bug fix
- [ ] New feature
- [ ] Refactor
# Checklist
- [x] I have performed a self-review of my code
- [x] I have commented my code in hard-to-understand areas
- [x] I have verified my changes by testing with a device or have communicated a plan for testing
- [ ] I am adding new behavior, such as adding a sub-driver, and have added and run new unit tests to cover the new behavior
# Description of Change
**fp2: add get_credential failure handling**
When 403 error occurs after get_credential during device registration, the driver is waiting for socket timeout to occur while calling fill_body().
In the event of a 403 error, there is no need to fill the body, so in this case, the fill_body() is not called and treated as an error so that a quick return can be made.
This will help users with multiple devices quickly register their devices.
In addition, the log was changed more clearly when get_creditial failed.
**fp2: add nil check in eventsource**
add nil check for sock.
As shown below, there was a driver restart due to sock nil, so there was a request for modification.
2024-11-14_05:01:00.094 | E | edi | <Aqara Presence Sensor (01976eca)> runtime error: [string "cosock.lua"]:313: [string "lunchbox/sse/eventsource.lua"]:346: attempt to index a nil value (field '_sock')
**fp2: Label change for easy distinction**
if a user with two or more FP2 registers the device, it is registered only under the name 'Aqara FP2', making it difficult to distinguish devices.
I would like to make it easier to distinguish by adding the last four letters of mac to the device name when adding fp2 in the Aqara app.
**Offline event after reconnection attempt to prevent fake offline**
If the socket connection is lost due to the router settings, etc., an offline event has been raised.
This causes confusion by posting a fake offline event in a situation where reconnection is possible.
Therefore, after checking if reconnection is possible, it modifies offline to be raised only when reconnection is not possible.
**fp2: remove socket connection for fp2 resource**
the socket connection for the rest call was maintained, but it was removed to reduce the resource of fp2
**fp2: update status when sse reconnect**
modified to update to the current value because status mismatch may occur after sse reconnect and before sse event occurs.
# Summary of Completed Tests
complete fp2 registration test on V3
4 Likes
epukane
(Toni)
November 25, 2024, 7:18am
282
Your patience and tenacity are impressive, Andreas.
2 Likes
https://bestow-regional.api.smartthings.com/invite/d4299eAR0D2o
I enroll in the channel but it takes too long and it doesn’t work. can you help me?
Alwas
November 30, 2024, 7:18am
284
@Mircea_Cosmin_Ionica That link doesn’t work anymore, it’s over 2 weeks old, and there have already been changes to the test driver since then anyway…
SmartThingsCommunity:main
← hdlee27:fp2_241119
opened 12:43PM - 19 Nov 24 UTC
Check all that apply
# Type of Change
- [ ] WWST Certification Request
… - If this is your first time contributing code:
- [ ] I have reviewed the README.md file
- [ ] I have reviewed the CODE_OF_CONDUCT.md file
- [ ] I have signed the CLA
- [ ] I plan on entering a WWST Certification Request or have entered a request through the WWST Certification console at developer.smartthings.com
- [x] Bug fix
- [ ] New feature
- [ ] Refactor
# Checklist
- [x] I have performed a self-review of my code
- [x] I have commented my code in hard-to-understand areas
- [x] I have verified my changes by testing with a device or have communicated a plan for testing
- [ ] I am adding new behavior, such as adding a sub-driver, and have added and run new unit tests to cover the new behavior
# Description of Change
**fp2: add get_credential failure handling**
When 403 error occurs after get_credential during device registration, the driver is waiting for socket timeout to occur while calling fill_body().
In the event of a 403 error, there is no need to fill the body, so in this case, the fill_body() is not called and treated as an error so that a quick return can be made.
This will help users with multiple devices quickly register their devices.
In addition, the log was changed more clearly when get_creditial failed.
**fp2: add nil check in eventsource**
add nil check for sock.
As shown below, there was a driver restart due to sock nil, so there was a request for modification.
2024-11-14_05:01:00.094 | E | edi | <Aqara Presence Sensor (01976eca)> runtime error: [string "cosock.lua"]:313: [string "lunchbox/sse/eventsource.lua"]:346: attempt to index a nil value (field '_sock')
**fp2: Label change for easy distinction**
if a user with two or more FP2 registers the device, it is registered only under the name 'Aqara FP2', making it difficult to distinguish devices.
I would like to make it easier to distinguish by adding the last four letters of mac to the device name when adding fp2 in the Aqara app.
**Offline event after reconnection attempt to prevent fake offline**
If the socket connection is lost due to the router settings, etc., an offline event has been raised.
This causes confusion by posting a fake offline event in a situation where reconnection is possible.
Therefore, after checking if reconnection is possible, it modifies offline to be raised only when reconnection is not possible.
**fp2: remove socket connection for fp2 resource**
the socket connection for the rest call was maintained, but it was removed to reduce the resource of fp2
**fp2: update status when sse reconnect**
modified to update to the current value because status mismatch may occur after sse reconnect and before sse event occurs.
# Summary of Completed Tests
complete fp2 registration test on V3
Having the same issue with the latest PR. Enrolling the hub it spins for over a minute then returns to saying enroll hub
Alwas
December 2, 2024, 12:39pm
287
I’d hate to think you guys are marching through the trenches of the dreaded Aqara FP2 offline issue. ST seem very slow to fix it. Since I blitzkrieg-ed the driver code last month I haven’t had a single offline issue, and as I have other users using my driver who all report the offline issue is fixed, I’ll make it public…
https://bestow-regional.api.smartthings.com/invite/Q1jPrpD87y2L
3 Likes
It doesn’t work for me. Whatever I do, the fp2 sensors are offline. Disappointing
Alwas
December 4, 2024, 4:21pm
289
You haven’t given much information; did you just swap from one driver to another in the app? “Not working” can mean many things—kind of like asking a German for directions and ending up with a 15-minute lecture on traffic laws. Here’s my procedure when testing a new driver: I have eight of these in deployment now, so you can imagine how intimate I am with this process.
Install the test FP2 driver onto the hub. Delete the official FP2 driver from the hub ( it will come back in 24 hours anyway). Screenshot your FP2 automations, delete the device from ST, delete (but not factory reset ) the device from Aqara, re-include it to Aqara (your zones will return). Then, re-include it into ST, where it will join with the test driver. Lastly, redo your ST automations.
1 Like
Hi,
I deleted the sensors from SmartThings. Press the reset of the sensor for 10 seconds. I include it in the aqara app and then in SmartThings. Where am I wrong? Thank you
Alwas
December 4, 2024, 4:40pm
291
Sounds like you have a faulty device I’m afraid if you can’t get it to work in ST.
After a hard reset and changing the plug adapter, the sensors stayed online. Thank you for your time and help.