According to the San Luis Obispo County Sheriff's Department, the suspect sent text messages from inside the home.
"The woman had received text messages from the suspect who described the inside conditions of the living area, only someone who had been inside the residence would know," according to a news release from deputies.
Hernandez was discovered in a cardboard box hidden in a closet inside the home, according to the sheriff's department.
"The reporting party believed it was the ex-husband of a woman living at the address," according to a news release.
Hernandez, 36, was booked into county jail for violation of four criminal protective orders (restraining orders), burglary and possession of burglary tools, according to deputies.