Best way to get sensor data to HA?

I currently have an SCD30 and PMSA003i connected to a RasPi 3. It is running a python script that writes the values to a postgre sql db every 60 seconds. This is used for triggering fans to vent the house when Co2 is to high. Also to give me trends/history within a Grafana page. I am looking to redesign my system to use Shelly relays to replace pi’s around my house (9 of them) and to use HA to control the Air inlet valve for the house, hvac fan for supply and bathroom fans for the exhausting of co2/humidity. I am also wanting to control Hepa filter/fans in several rooms when particulate counts are high. Especially when someone burns popcorn. Also I do not want bluetooth for any of this portion.

Can HA do this? To get my sensor data into HA, what is the best way? ESP32 or Pi? Software?

Any examples or thoughts appreciated.

You could use both the HA API and MQTT to get sensor data from a Python environment to HA. No other hardware required.

Personally I would use MQTT, it’s probably easier for starters and you can now implement auto discovery in your MQTT data to make setup a breeze:

Therese even a Python library specifically for HA someone wrote:

Thank you, I’m digging through it.

Looks like I have to purchase more smart relays!

I was able to get this integrated with a sql server connection. one of the links gave me the idea. The hardest part was the url it needed.

db_url: postgresql://user:[email protected]:5432/mydatabase

image