An LED tube lamp includes a tube, two end caps, a power supply, and an LED light strip. The tube includes two rear end regions, two transition regions, and a main body region. The end caps are respectively connected to the rear end regions. The power supply is in one or both of the end caps. The LED light strip including one or more LED light sources is in the tube. The LED light sources are electrically connected to the power supply via the LED light strip. The end cap includes a lateral wall, an end wall, and at least one opening for heat dissipation and/or pressure releasing. The at least one opening penetrates through the end cap with a light sensor inside the end cap collimating with the opening.