If it is in the contract yes.
Which you say it is
If its an emergency yes
If the landlord does not, it is not illegal - but it would be breach of contract
That means its a civil matter, not a criminal matter
Does that clarify?
If the Landlord keeps doing it, possibly it is harassment under the Protection From Harassment Act
But this can be civil as well as criminal, but the Police are likely to treat this as a civil matter
Does that help?