The automatic light system wont work on 2005 Toyota Tacoma

In the past I would keep lights on in position 2 this would turn the lights on automatically when truck was started and automatically turn off when car was off and I opened the driver's door Now they just stay on when I turn the truck off and open the door I have to turn them off manually I just had to replace the battery because it died probably because I didn't notice the problem and left the lights on The alternator is fine just had that checked What do you think the problem is Fuse or wiring?

Asked by for the 2005 Toyota Tacoma
There is a light sensor located on the dash board that might not be working .
Qualified Local Toyota Shops
Qualified Toyota Shops For This Repair
2465 N Military Trl
West Palm Beach
(561) 571-8452