I am new to this and I struggle with one major setup.
I installed HA OS to Pi 4 and connected various devices to it, including solar inverter and a weather station. Everything is working fine, but I want the data to be used further on my website, which runs on an externally hosted server.
What I would like to do is to be able to send selected entity data (eg. temperature from my weather station, current solar panel generation) to this external server (the format does not really matter, either as a JSON text file, CSV file or anything easily readable) at a regular interval, say every minute.
I want to be able to display this data on my website in real-time and this would also create a long-term storage for the data, because unlike my Pi4 + SD card, my server has much larger storage capacity.
I found some topics mentioning MQTT, I installed it in my HA, but I am not sure how to set it up on the server side because I can only access my externally hosted server via FTP and I cannot install anything there.
The only downside to this approach is scan interval isn’t totally reliable. Everytime HA restarts or the REST integration is reloaded from the UI the state of that sensor will be recalculated and then a new 3600 second timer will start. Which means you won’t actually get data every hour. You’ll get it every hour while HA is running continuously but then every restart, update or reload it’ll give you a data point at an unpredictable time.
@jachymbrzezina If you want the data every hour on the hour (or at some other extremely regular and predictable interval) then I would suggest using a rest command instead. Then make an automation which calls your rest command at the interval you want with a time pattern trigger.
Plus rest commands support POST calls so the actual API call should be a lot easier. Don’t have to try and stuff all the info in the query string, just make a JSON payload.