It did "know" there was a plan. They just didn't do anything about it, for whatever reasons.
When the attack happened they were nowhere near Gaza it seems. Why not I wonder isn't Hamas the single worst sworn enemy of Israel? Where were they instead and why? Accountability will follow, I hope.