Ph meter sensor : advice for implementation


I consider mesuring ph of the water of my swimming pool and accessing it via Home Assistant.
I am totally a new beginner with Home Assistant (but not in python).

After reading all the doc in the website, i am still wondering what is the best and fastest solution to fetch my ph sensor data and displaying it on HA.

here is my hardware configuration:

  • ph probe connected to a rpi on GPIO I2C bus.
  • home assistant running on the same rpi.

I am currently able to read my Ph data via GPIO I2C bus and storing it in a .txt file.

How can i simply read this .txt file to feed Home assistant ?

  • I am thinking about implementing MQTT exchange but i find it a little bit complicated just to read a .txt file that is on the same rpi than the one running HA.
  • I am also thinking about using REST or python API to post these data to HA. But again, it seems to me a little bit heavy just for reading a .txt file.

Any advice about how to proceed would be very appreciated.


Not a dev but I’m wondering if command line sensor would for this case. I use one to put the current release of HA in my status group like this:

  platform: command_line
  command: py -c "import requests; print(requests.get('').json()['info']['version'])"
  name: HA release

seems like this would be less ‘overkill’.

I am using the command line sensor to get exchange rates from

Wondering how frequently does HA update the command line sensor? Is there a way to define the frequency of updates?

Also, between the command line sensor and the rest sensor, which one should be used and when?