Strange Q

i have setup Home assistant to send numbers to emoncms

one of them is rainfall that only updates once an hour… but i send data every 60 sec as i also log temperature

i want to make a feed out of the rainfall that only updates once an hour when the number change, and out of that a total for the day

are there an easy sneaky way to do the first part?

If you make the feed interval 1 hour, you can send the data as often as you want, only the last datapoint will be stored.

For the second part it depends on what the data says -

If it’s rain in the last hour, then “Power to kWh/d” may work???

If it’s cumulative rainfall for the day, then just have another feed with an interval of 1 day, and send the data to that as often as you want and the last datapoint will be stored, which should be the total rainfall just before midnight.

problem is that home assistant gets the rain from openweathermap and they reset the number on the hour

so yes the feed interval to one hour will work as long it takes the last reading before the hour number changes

and then yes its just a matter of doing a sum up of all the numbers from that feed and reset once midnight passes

hmm i cant set the interval

i self host but used to have emoncms on a rented server that allowed unlimited sql space hence i only have mysql… do i need to enable more engines?

Yes, you’ll need Fina & maybe Timeseries -

and how do i make sure the value it stores is the last before the hour number changes ?

that is where openweather map resets the rain during the last hour number

if i have those at just before hour number changes ie at minute 59 and sec 59 then i can just add the last 24 numbers to get the days total rain… and then add the last 30 to get the months rain

If you specify 1 hour feed interval, then there is one ‘slot’ for each hour, if you send data it gets put into the current valid slot, overwriting any data that was there previously. If you send the data every 60 seconds, the data stored in the 1 hour slot will be overwritten 60 times, but should end up being the data sent in the last 60 seconds of the hour.

ERROR: Feed could not be created, could not write meta data file fopen(/srv/mergerfs/Data/Emoncms/docker-compose-lamp/emoncmsdata/phpfina/80005.meta): Failed to open stream: No such file or directory

and i just did a chmod 777 just to be sure (know its not right)

root@omvnap:/srv/mergerfs/Data/Emoncms/docker-compose-lamp# chmod -R 777 emoncmsdata/

are there a way to check what user or process that tried to create the file?

i also tried to move the emoncms data folder inside the emoncms folder, same thing

think the docker stack i run this on dont have permissions to write i think, but cant figure how to change that (noob at the helm)

I can’t help you with Docker, I use the standard EmonSD (Linux ISO + EmonCMS) on a Raspberry Pi2.
Looking at LSOF shows nothing, which is odd.
“pi” is the main user on a standard install and owns a lot of processes.
There is also “emonhub”, “mysql” and “www-data” users and an MQTT process run by “root”.

I vaguely seem to recall that the “emonhub” process does the actual writing to phpfina files.
But there are a lot if mysqld instances.

Maybe someone else can jump in?

yep… that would be nice as i’m a noob still and just learning

i did once try the emoncms docker image but never got it going as far i could get an webpage served, so i found the current stack and copied over the files from a rented server