I don’t seem to get a JSN-SR04T distance sensor to work. I have tried with both a ESP8266 board and a atom lite esp32 and none of them work. I have also bought an extra JSN-SR04T sensor if the first one was faulty but I get the same result.
> [01:06:35][D][ultrasonic.sensor:036]: 'garden_watertank_distance' - Distance measurement timed out!
> [01:06:35][D][sensor:093]: 'garden_watertank_distance': Sending state nan m with 2 decimals of accuracy
If I connect a HC-SR04 sensor it works perfectly
> [00:57:40][D][ultrasonic.sensor:040]: 'garden_watertank_distance' - Got distance: 0.057 m
> [00:57:40][D][sensor:093]: 'garden_watertank_distance': Sending state 0.05677 m with 2 decimals of accuracy
When I ordered my JSN-SR04T sensors from Amazon, I received a very similar looking AJ-SR04M, it said JSN-SR04T on the box but in the box was an AJ-SR04M. Couldn’t get it to work, asked Amazon for a replacement and received the same incorrectly labled boxes again - had to order from a different vendor.
I couldn’t get the code to work just using the pin numbers, it worked fine on my old sensor (forgot what it’s called) but I had to change it to this
I struggled also with this sensor. I discovered that I also purchased a AJ-SR04M sensor and that this device ISN’T the same as the JSN-SR04T which is documented in ESPHOME.
In the ESPHOME documentation they give 2 modes as an option. I succeeded in making mode 1 work with my Home Assistant. But instead using a 47K resistor (ESPHOME documentation), I used 120k resistor at R19 as documented by probots for the automatic mode.
I think the mode 2 option isn’t possible with the AJ-SR04M as the trigger signal will be sent as a 0x05 (ESPHOME documentation) while the sensor would expect a 0x01 signal before returning the distance.
This is a real bummer because this mode would allow reducing power consumption.
Therefore, support for this slightly different sensor would be great!
do you have the possibility to send me the exact yaml you are using for the sensor. I have soldered on a 120k resistor to put it into mode 1 but still can’t get it to work.