jbouwh / omnikdatalogger

Datalogger for Omnik solar power inverters with DSMR integration and output to Home Assistant, PVOUTPUT, InfluxDB and MQTT
https://jbsoft.nl/site/omnik-datalogger/
GNU General Public License v3.0
10 stars 3 forks source link

Unable to connect to InfluxDB #63

Closed ihulsbus closed 2 years ago

ihulsbus commented 2 years ago

I'm trying to output to an InfluxDB instance, but I'm getting 401's back on every config combination I try. InfluxDB version: 2.1.1 Data logger version: 1.10.5

config attempt 1:

  output.influxdb:
    host: <some_IP>
    port: 8086
    username: <username>
    password: <password>
    database: solar
    use_temperature: true

config attempt 2:

  output.influxdb:
    host: <some_IP>
    port: 8086
    jwt_token: <token>
    database: solar
    use_temperature: true

token is created in Data --> API Tokens

log output:

WARNING:omnik.datalogger:W 2022-02-11T15:54:21.734385 Unhandled RequestException error: 401 Client Error: Unauthorized for url: http://<some_IP>:8086/write?db=solar

Am I missing something obvious?

jbouwh commented 2 years ago

I'll try to share some tips how you can enable v1 auth on influx2

jbouwh commented 2 years ago

See the new documentation:

InfluxDB plugin settings in the section output.influxdb in of apps.yaml or config.yaml

key optional type default description
host True string localhost Hostname or fqdn of the InfluxDB server for logging.
port True integer 8086 InfluxDB port to be used.
ssl True bool false Use SSL. Set to true if the URL starts with https://
verify_ssl True bool true By default a certificate is validated. Set to false to disable validation.
ssl_ca_cert True string (none) Set an alternative CA cert. (InfluxDB 2.x client only)
org True string (none) The InfluxDB2 organisation (InfluxDB 2.x only)
bucket True string (none) The InfluxDB2 bucket to write to (InfluxDB 2.x only)
token True string (none) The InfluxDB2 authentication token (InfluxDB 2.x only)
use_temperature True bool false When set to true the temperature is obtained from OpenWeatherMap and logged.
database True string omnikdatalogger The InfluxDB database (InfluxDB 1.8x only)
username True string (none) The InfluxDB username used for Basic authentication (InfluxDB 1.8x only)
password True string (none) The InfluxDB password used for Basic authentication (InfluxDB 1.8x only)
jwt_token True string (none) The InfluxDB webtoken for JSON Web Token authentication (InfluxDB 1.8x only)

App-deamon config:

system_packages: []
python_packages:
  - cachetools
  - dsmr-parser
  - influxdb-client
init_commands: []
log_level: info