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
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
After a hard reset and changing the plug adapter, the sensors stayed online. Thank you for your time and help.
peeps
December 9, 2024, 2:34am
293
Anyone had issues with their FP2 yesterday and today? Mine stopped reporting status yesterday morning. Shows online, but doesn’t report presence changes or luminance changes. Sensor is reporting presence changes and luminance changes in the Aqara app…
Tried unplugging/replugging, rebooting ST hub, rebooting wifi router multiple times to no avail.
What’s your firmware version?
There’s currently a firmware update being rolled out.
Alwas
December 9, 2024, 11:02am
295
There’s an updated Aqara FP2 driver on the SmartThings beta channel if you want to try it.
Aqara Presence Sensor │ 2024-12-02T21:30:11.217562821
https://api.smartthings.com/invitation-web/accept?id=450930c1-02a6-43d8-adaa-4cbc51027956
Or just wait for the new official FP2 driver set to be released in 24-48 hours.
fp2: add get_credential failure handling
fp2: add nil check in eventsource
fp2: Label change for easy distinction
Offline event after reconnection attempt to prevent fake offline
fp2: remove socket connection for fp2 resource
`
fp2: update status when sse reconnect
1 Like
peeps
December 9, 2024, 12:08pm
296
FP2 FW is 1.2.8_0006.0086
ST FW is 54.14.
Device had worked without a hitch in ST since integration.
1 Like
Alwas
December 10, 2024, 6:14am
297
Right on cue, ST has released the latest official FP2 driver to our hubs.
Aqara Presence Sensor │ 2024-12-09T21:15:18.419597941
Curious to hear any reports about it’s function now…
peeps
December 10, 2024, 10:39am
298
It has been offline since despite multiple attempts at unplugging and replugging it back in and hub reboots.
peeps
December 10, 2024, 11:54pm
299
This morning I reset it, re-added it to Aqara app (it retained my zone settings) and then was able to re-add to ST. I have to re-setup some rules I had in Sharptools for the “new” ST device and do some testing to make sure its all working properly again, but seems to be back online at least all day today.
Alwas
December 19, 2024, 3:22pm
300
Theres new Aqara FP2 firmware avalable now…
Released 04.12 depending on country.
It took half an hour for the device to return to normal. Didn’t recognize me, ghosts everywhere.