ESP32 PH & TDS

Home Assistant automation projects, questions, etc. go here.
Post Reply
Freemaniac
LED-Curious
LED-Curious
Reactions:
Posts: 3
Joined: Tue Nov 10, 2020 1:37 am

I am trying to get a Dfrobot PH sensor and EC sensor into HA. Since there are no direct esphome integrations for these what is the best way to bring the values in? Is MQTT the only simple option?
User avatar
LEDG
Site Admin
Reactions:
Posts: 1599
Joined: Sun Jun 04, 2017 8:15 pm

MQTT isn't too bad to add into your Arduino code. I think I would go that route.
Want to Support the Site?

Use this Amazon referral link and any purchase you make within 24 hrs will earn LEDgardener a commission at no cost to you!
Freemaniac
LED-Curious
LED-Curious
Reactions:
Posts: 3
Joined: Tue Nov 10, 2020 1:37 am

Can I hassle you for an example of your MQTT esp32 code. I cannot get the publish function to send calculated values from my sensors.
User avatar
LEDG
Site Admin
Reactions:
Posts: 1599
Joined: Sun Jun 04, 2017 8:15 pm

Sure thing. Here's my ESP32 code. Mind the noobiness of it.

Feel free to post your code as well and I can see if the problem stands out to me.
Attachments
ControlBox_ESP32_07-17-2020.ino
(23.28 KiB) Downloaded 97 times
Want to Support the Site?

Use this Amazon referral link and any purchase you make within 24 hrs will earn LEDgardener a commission at no cost to you!
Freemaniac
LED-Curious
LED-Curious
Reactions:
Posts: 3
Joined: Tue Nov 10, 2020 1:37 am

That was extremely helpful, made me realize I needed to convert my float values to strings in order for MQTT to publish them.

Thank you!
User avatar
LEDG
Site Admin
Reactions:
Posts: 1599
Joined: Sun Jun 04, 2017 8:15 pm

Great!
Want to Support the Site?

Use this Amazon referral link and any purchase you make within 24 hrs will earn LEDgardener a commission at no cost to you!
Baylos
LED-Curious
LED-Curious
Reactions:
Posts: 22
Joined: Sat Nov 07, 2020 11:49 am

Hi,

without any detail, it is difficult to provide you an answer. At least what kind of code you use and what you have tried so far would be nice to know.

I use ESP32 with SEN0169. There are some examples at GitHub. I used greenponik together with additional ADC.

I posted my code here:
viewtopic.php?f=35&t=5696&start=20

I get an MQTT response. Maybe later I will improve the code.

Hope that helps.


BR

B
stud
LED Lover
LED Lover
Reactions:
Posts: 143
Joined: Wed Jun 03, 2020 4:19 pm
Location: Canada

I'm not running DF PH/EC Sensors ,i'm using Atlas EZO ,after doin a little search i found this that might be useful :
https://community.dfrobot.com/makelog-308339.html
DF Sensors with MQTT on ESP
hope it helps you
Post Reply