Ah, yes, solenoid is the word for "electric magnet", thank you.
Look at that video, it shows a damaged brewgroup,
but you can see the action of the valve:
https://www.youtube.com/watch?v=Pxad75B2...
At 0,18 the solenoid gets current and opens the valve by pushing the metal axle. For that duration a humming noise is hearable, listen good.
At 0,23 the noise ends in the moment the valve snaps back.
If you hear fot those 5 seconds a knocking sound it is very shure that there is a problem with that solenoid, the valve or electronics.
I hope you understand me, sorry. :)