Skyhawk 172/Cutlass 172
Flight Crew Commercial; Flight Crew Flight Instructor; Flight Crew Instrument; Flight Crew Multiengine
Flight Crew Last 90 Days 85.7; Flight Crew Total 1510; Flight Crew Type 800
Communication Breakdown; Distraction; Troubleshooting
Conflict NMAC
Flight Crew Took Evasive Action
Environment - Non Weather Related; Human Factors
Upon entering the traffic pattern at ZZZ during a flight lesson; my student and I experienced a near miss with Aircraft Y. Due to hazy conditions and sunset; there was some difficulty with seeing traffic. My student and I made all of the required and appropriate calls stating our position and intentions of entering on the right downwind RWY XX; starting 8 nm from the field. As we got closer to the airport at approximately 2 nm; Aircraft Y announced its position on right crosswind RWY XX; and stated that it saw us. We notified them we were still looking and had not turned on downwind yet. Aircraft Y appeared to fly a longer crosswind than anticipated at 1;100 feet. I stopped the descent at 1;400 feet and Aircraft Y flew below us at 1;100 feet; and then turned right to fly a wide right downwind for RWY XX. We followed and landed after them; without any additional traffic conflicts or safety concerns. I believe this near miss to be due to both the hazy conditions and uncertainty of the other aircraft's position. In the future to prevent this type of situation; especially with faster moving aircraft; I will fly a wider pattern and delay any entry until I am certain of the aircraft's position regardless of if they have me in sight or not.
Pilot reported a NMAC while entering the traffic pattern.