Home Assistant Add-on: InfluxDB v2

I never used any include and exclude option and in the past year my database size has grown significantly, 30GB to 55GB. I don’t use any purge also.

Today, I have added the include and exclude options. Hopefully size increase will be in check now.

my question is:
can I delete all the entities that are filtered out now from the influxdb?
or maybe just delete entries that haven’t been updated for six months?

Hi @danieloldberg , thanks for your work on influxdbv2. I was about to stream my data to a local instance but I have been unable get it to write to influxdb cloud using the same configuration.

I only modified the host to my cloud URL.

Wonder about two things:

  1. What token when importing? The one of the influxdb2 initialization? I can’t find a token in my 1.8 setup.

Error: failed to write data: 401 Unauthorized: unauthorized access

I’d go with bucket, organization and token of the influxdb2 setup. But it doesn’t work.

  1. The export file is only 3 MB. When I run a backup for my db it is round about 600mb.

All in all. I am not able to import the data without the correct token.

//EDIT: ok, i just created a new token. import works but the old values aren’t existent just the metadata is imported this way.

Hello,

I have sensor data written to InfluxDB
“2024-07-19T00:00:00Z”,
0.633

Is it possible to update this data to 0.733 and keep the same timedata?

Just send same new value with same timestamp to influxdb. It’s like an update statement.

https://docs.influxdata.com/influxdb/v2/write-data/best-practices/duplicate-points/

Someone know how to do this in HomeAssistant?

Why would you go thru Home Assisstant? You are asking for data manipulation. HA is a client to write data into influxdb only. When you want to manipulate data its best to use the tools which influxdb provides. Cli, http-api or influxdb tools. Best you check their official documents or their forums.

I want to manipulate my data what is written in InfluxDB with Home Assistant

That’s irrelevant. You want to manipulate data. Best tools are the once which are provided by the vendor. When you want to rename a word document you will use the windows explorer to rename the file, I doubt you would wait until Microsoft build a file explorer into the Word applicaiton, yes Word was the tool which created the file initially. But the Winodws Explorer was build to handle files. So it’s better to use the tool which was build to handle specific tasks.

Homeassistant did what you told to do, log the current values or defined sensors. Nothing more, nothing less.

InfluxDB is in HomeAssistant, my sensor is in HomeAssistant, so i want to change that value in InfluxDB

I dont want to manually change data

You don’t need to convice me. I gave you 2 (3) options in influxdb how you could make the adjustment. It’s your decission whether you want to read thru the documents, when you wait long enough there could be somebody who provide you a script or tool. It could take a while, probably never.

Maybe it’s possible with a script, as long as it is in HomeAssistant :slightly_smiling_face:

it’s possible by script. You need to search the commands in the official influxDb documentation and wrap a script around. You can call the cli or api depending your skills

1 Like

where can i create a token?

i havent "
Load Data"

Following the documentation it should be possible by opening the link

https://community.home-assistant.io/t/home-assistant-add-on-influxdb-v2/617977

You need to do the following steps in order to get this working:

Browse to http://{{ HOME_ASSISTANT_URL }}:8086 (replace {{ HOME_ASSISTANT_URL }} with the address to your home assistant installation)

Go through the onboarding process by creating a default user, password, organization and bucket.

Save the operator token for future use. Note: It’s best to create a separate user and token to be used in home assistant. Operator token has unlimited permissions to your InfluxDB installation.

I fail to create a token and/or organization. I follow the instructions that say:

Browse to http://{{ HOME_ASSISTANT_URL }}:8086 (replace {{ HOME_ASSISTANT_URL }} with the address to your home assistant installation)

But that page just give me 404 page not found. I just installed InfluxDB, default config. Add-on version 5.0.0.

I can create databases and users by going to the InfluxDB integration in HA and then to InfluxDB Admin. But are users = organizations and password = token?

EDIT: Ok. Seems like it works if I set API version to 1 and use username/password. Seems legacy?

I cannot give you further advise as I’m running everything in docker. Therefor I cannot test by myself on my installation.

When you read the documentation it’s designed for InfluxDB v2. Organization and bucket is v2.

I could imagine that your first setup attempt created something in background what leads to issues when you re-run. Do you have the option to test setup on a fresh installation? When you use SD-Card as storage just make a backup and start from scratch. When it’s a normal PC you could also test in a virtual machine. VM Ware Workstation is free for private use.

Additionally1 you could search the issue tracker if similar issue was reported earlier. In best case including solution.
Issues · home-assistant/home-assistant.io (github.com)

Additionally2, you could go with version 1 and use the upgrade path after installation. I think there was a chapter how to upgrade in an earlier post. Same here, make a backup before any actiion

Hello !
Is it possible ton configure HA to push data to 2 distincts influxdb databases ? I have influx v1 and influx v2 instances, and I want to push my datas to both.

I would be interested as well. Unfortunately not foreseen to have multiple instances.

You need to search influxdb tools or apps to sync or split depending your needs.

Asked several times.

https://community.home-assistant.io/t/multiple-database-influxdb-in-ha/487432/9

I think this is a limitation of the client integration.
I’d suggest looking up the github repository and find if there are any issues on this topic. If so, try to contribute. If not, the add an issue with your use case.