Input Water Meter readings manually

My water service company can now provide daily meter reading in xls or csv format and I would like to insert these values in a “Utility Meter” module once a month.
Is there a way to do this?

Edit: is it possible to perform insert commands in influx DB?

You should have a look at the file sensor.

One way of achieving this is, to have a script re-write the csv file to a new file line by line in chronological order. The sensor will then pick up the values that you can then parse in home assistant to what you want with template sensors.

I’m not sure if the utility meter will work with this because it usually is used with regularly updated sensors and takes time stamps of updates into account. But you can always try and see if it gives what you need.

1 Like

thanks … the problem with File is that only the last line is taken into consideration according to the documentation

Exactly. That’s why I suggested re-writing the csv file to a new file. That new file should be monitored by the sensor and that will pick up the last line after each write.

got you point … but I dont think I can enter the date.
For example if I have a list of daily reading for August, how can I add them with the correct date?

I’m not so sure about what i will propose, but there’s a slight chance i’m right:

Influx DB draws data from maria DB or another database right?
Can’t you manually insert data on the source database with PHPMyAdmin?
There’s an addon that lets you browse and edit mariaDB.

Again, sorry if i’m completely off :slight_smile:

my electricity sensor write directly into the influxdb … will need to find some commands how to insert data manually into influxdb … will try to follow this when I have some time

Cant you just set it with an input_number once a month?

a daily count would be ideal since i have all the data in csv format.
I tried the following

INSERT L,entity_id=water_meter_mains litres=27 1596240000

but i am getting an error unable to parse: invalid boolean.
I am not sure if I should create a new table before doing the insert

the following worked fine … influx DB requires nano precision unix time.

L,entity_id=water_meter_mains value=27 1596240000000000000