The reason I ask is because I have tried using (digital) multiplexers in the past (for different sensors), and some sensors were not compatible with them. The sensors themselves worked, the multiplexers worked, but ESPHome wouldn’t let me use the multiplexer pins to access said sensors.
I’d order the multiplexers and some more Soil Moisture Sensors right away if I knew they were compatible. But I don’t want to prepare a large project just to realize it won’t work when assembling / flashing it. (I need one ESP32 with 7 of those sensors, and two ESP32 with 5 each).
Can any of you confirm from experience that the multiplexers will be compatible with those sensors in ESPHome?
Yeah but ESPHome would not let me declare more than one of them as analog sensors. I thought multiple should work. But as soon as I declared a second one, the code block would get red underlining and the project would not be compiled.
I could even change the PINs. Idk which ones I just, but for the sake of example, let’s say 18 and 20 were adc-compatible PINs. If I made one sensor with 18, the next one would not accept 20. If I deleted the second one and changed 18 TO 20, it would work. But yeah, always just one single PIN seemed to have been allowed… unless I missed some configuration step?
Sorry, forgot to paste it. Here is the relevant part
sensor:
- platform: adc
pin: 17
id: moisture_sensor_00
name: "Soil Moisture 00"
unit_of_measurement: "%"
update_interval: 300s
filters:
# Sensor dry around 0.825 Volt, sensor wet around 0.425 Volt. Volts are were flickering
- calibrate_linear:
- 0.0 -> 0.0
- 1.0 -> 100.0
- platform: adc
pin: 18
id: moisture_sensor_01
name: "Soil Moisture 01"
unit_of_measurement: "%"
update_interval: 300s
filters:
# Sensor dry around 0.825 Volt, sensor wet around 0.425 Volt. Volts are were flickering
- calibrate_linear:
- 0.0 -> 0.0
- 1.0 -> 100.0
When I read your reply, I thought the issue was resolved and that I forgot id… but just checked and realized, both do have this. So I don’t see what could cause this error.
@Karosm I am currently using the esp32-s2-saola-1; but then I tested different other esp32 boards in my configuration, just to see whether the same error would still be there, and it is… for example, I used nodemcu-32s (the usual board I use for ESPHome), and the error is identical to the screenshot above.
I tried another ESP32 board now, and it seems like pin 36 and 39 work. I cannot test it atm but it looks promising that ESPHome does not throw an error.