What is the difference between the HC-SR04 and the JSN-SR04T?
The HC-SR04 offers readings closer in. The JSN-SR04T offers a longer range and a waterproof head for tanks and outdoors.
Which has the longer range, the HC-SR04 or the JSN-SR04T?
Range: 2 cm to 4 m for the HC-SR04, 25 cm to 4.5 m for the JSN-SR04T. Accuracy: down to 3 mm (maker figure) and resolution about 0.5 cm. The target’s colour and material, and sunlight, change both.
Can I replace the HC-SR04 with the JSN-SR04T?
Often yes: both use trigger and echo pulses. Change the driver or, in ESPHome, the component (ultrasonic → jsn_sr04t).