A son became aggressive and belligerent towards nursing home staff because he was concerned about the care his mother was receiving.
Richard Brennan (37) was asked to leave the nursing home and warned not to return, but he came back the next day.
A court heard staff were concerned as he was encouraging his mother, who suffers from Alzheimer's, to smoke in her room, near to oxygen canisters.
Judge Anne Watkin ordered Brennan to enter into a probation bond for 12 months.
The defendant, from the Mespil Estate, Dublin 18, admitted before Dun Laoghaire District Court to trespass at Glebe House Nursing Home.
Garda Orla Darcy said Brennan's mother is a patient in the home and he had visited her the previous day. She said Brennan was asked to leave because he was encouraging his mother to smoke in her room and was aggressive towards staff.
Gda Darcy said Brennan returned on November 9, 2015. He entered without permission, argued with staff and refused to leave. She said the defendant had access to the door entry code.
Gda Darcy said Brennan had been warned not to come back, and she had to arrest him to get him out of the building.
The court heard the defendant has 74 previous convictions, mostly for public order matters.
Defence solicitor Ronnie Lynam said Brennan regrets what happened and the defendant apologised to the court.
Mr Lynam said Brennan had "some difficulties with his mother's care at the nursing home and didn't handle it very well".
The court heard that part of Brennan's bail conditions was to stay away from the nursing home, however, Gda Darcy had arranged for him to visit his mother at Christmas and on Mother's Day.
Mr Lynam said Brennan was very grateful to the garda for facilitating the visits.
The solicitor said Brennan suffers from bipolar disorder and he wasn't great "at accepting the illness".
Mr Lynam said Brennan was homeless for periods of time and was getting into trouble.
A sergeant told the court Brennan is "looking better than he has for a long time".
Gda Darcy said Brennan was now welcome to visit his mother "as long as he behaves himself".