I would like to create a project to integrate a pH and PPM/EC sensors into Home Assistant. I am using this for my indoor aquaponics system. I have an Arduino Nano connected to the homemade PPM/EC sensor. I can read the values in Home Assistant using and Arduino components. I can also read the pH sensor in a similar way. Water temp might also be needed for accurate reading of water.
I would like some info on how I would create a sensor component for these. Can someone help me find the correct place to start? I just graduated with a degree in computer programming and web development. I know how to code, I just need some general advice. I am hoping I can create a component that will add to the value of Home Assistant as I have used for over a year now and really enjoy it.
I also have the code for the Arduino, maybe there is a better way to deploy this. Anyways, hope I hear back from some fellow Home Assistant users.
If you’re using an Arduino you could, rather easily:
Integrate the PubSubClient library into your Arduino sketch to publish the sensor values over MQTT. HA supports MQTT well, including sensors. There are many many example sketches online that use sensors and publish their data over MQTT.
Integrate the aREST library into your Arduino sketch to make the sensor values available. HA has an aREST component and sensor platform.
These are easy ways to get the data into HA.
If you want to create a custom component for your Arduino sketch, you first need to decide how your sketch is going to make its data available (what protocol?) - probably creating a REST endpoint on your Arduino sketch is another of the easiest ways, HA could poll that and display the values in a sensor entity.
No progress. I still have all of the hardware, I was able to connect the pH sensor to the ardino but the values did not mean much. Would need to create a code block that will convert it to pH values.