Hey everybody,
I am currently working on a project and would need some advice on how to preceed
I have an Arduino UNO hooked up to an ESP8266 that I intend to connect with my HA instance. The Arduino is using the WiFiESP library, together with an ESP-01 (default firmware).
The Arduino is controlling my heat system in my house and thus I would like to both send realtime data to HA about different temperatures, states of pumps etc every couple seconds/minutes. In addition to that I would like to be able to update a few parameters that controls how the Arduino operates.
I’ve taken a look at the API, and how I could use it to update states on HA but I have not found anything optional.
An ideal senario would be a single HTTP request from the Arduino to HA, that both updates all sensors aswell as fetching the current parameters.
I’ve tested the built in python_service functionality, however it seems to be lacking any way to return data to the client.
I know there are addons like pyscript, that allows for way more powerful scripts. I would prefer not to go there, since it requires a lot more work on the HA side, however if I have no other options I might be forced.
One solution could possibly be two calls, one to a python_service updating all sensors. Then one call to fetch all parameters. Could I store all the sensor data in the same entity, under different attribute variables or would I need to have separate sensors? And how would I go about creating these sensors as they would be ‘virtual’? They would be updated just by this script I would create. And similarly, how could I store the parameters in HA. Currently I have three different integers, that I want to be able to edit in a nice way on the frontend. Would i store them in different entities, sensors or could I store them inside the attributes of a parent?
I’ve looked a bit on having the Arduino run the webserver instead, and then calling it from HA. That way I could easily have a json_attributes sensor, that fetches all variables in a request. However this seems to be very unstable, as the Arduino does lots of other things in between and might miss a request.
Has anyone had a similar setup or ideas how I could set this one up efficiently.
Thank you!!