Do you have a script you could share?
Basically a function slope with a value from 150 to 60 that calls "blinks" over an hour, when at the end it turns off LED.
You can make it smoother, add the heartbeat sensor, make it pulse instead of blink, that stuff will be particular to whatever you have at hand.
GPT for such simple code after explaining the device and pointing to documentation should be a 3-4 shot process.
My one is horribly inefficient and shameful to share : )
[1] https://paste.sr.ht/~tsegers/53adaecd734e7159352f152ac1dcc85...