Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.influxdb.const Namespace Reference

Variables

string API_VERSION_2 = "2"
 
int BATCH_BUFFER_SIZE = 100
 
int BATCH_TIMEOUT = 1
 
string CATCHING_UP_MESSAGE = "Catching up, dropped %d old events."
 
tuple CLIENT_ERROR_V1
 
tuple CLIENT_ERROR_V2
 
int CODE_INVALID_INPUTS = 400
 
dictionary COMPONENT_CONFIG_SCHEMA_CONNECTION
 
string CONF_BUCKET = "bucket"
 
string CONF_COMPONENT_CONFIG = "component_config"
 
string CONF_COMPONENT_CONFIG_DOMAIN = "component_config_domain"
 
string CONF_COMPONENT_CONFIG_GLOB = "component_config_glob"
 
string CONF_DB_NAME = "database"
 
string CONF_DEFAULT_MEASUREMENT = "default_measurement"
 
string CONF_FIELD = "field"
 
string CONF_FUNCTION = "function"
 
string CONF_GROUP_FUNCTION = "group_function"
 
string CONF_IGNORE_ATTRIBUTES = "ignore_attributes"
 
string CONF_IMPORTS = "imports"
 
string CONF_MEASUREMENT_ATTR = "measurement_attr"
 
string CONF_MEASUREMENT_NAME = "measurement"
 
string CONF_ORG = "organization"
 
string CONF_OVERRIDE_MEASUREMENT = "override_measurement"
 
string CONF_PRECISION = "precision"
 
string CONF_QUERIES = "queries"
 
string CONF_QUERIES_FLUX = "queries_flux"
 
string CONF_QUERY = "query"
 
string CONF_RANGE_START = "range_start"
 
string CONF_RANGE_STOP = "range_stop"
 
string CONF_RETRY_COUNT = "max_retries"
 
string CONF_SSL_CA_CERT = "ssl_ca_cert"
 
string CONF_TAGS = "tags"
 
string CONF_TAGS_ATTRIBUTES = "tags_attributes"
 
string CONF_WHERE = "where"
 
tuple CONNECTION_ERROR
 
string DEFAULT_API_VERSION = "1"
 
string DEFAULT_BUCKET = "Home Assistant"
 
string DEFAULT_DATABASE = "home_assistant"
 
string DEFAULT_FIELD = "value"
 
string DEFAULT_FUNCTION_FLUX = "|> limit(n: 1)"
 
string DEFAULT_GROUP_FUNCTION = "mean"
 
string DEFAULT_HOST_V2 = "us-west-2-1.aws.cloud2.influxdata.com"
 
string DEFAULT_MEASUREMENT_ATTR = "unit_of_measurement"
 
string DEFAULT_RANGE_START = "-15m"
 
string DEFAULT_RANGE_STOP = "now()"
 
bool DEFAULT_SSL_V2 = True
 
bool DEFAULT_VERIFY_SSL = True
 
string DOMAIN = "influxdb"
 
string EVENT_NEW_STATE = "new_state"
 
string INFLUX_CONF_FIELDS = "fields"
 
string INFLUX_CONF_MEASUREMENT = "measurement"
 
string INFLUX_CONF_ORG = "org"
 
string INFLUX_CONF_STATE = "state"
 
string INFLUX_CONF_TAGS = "tags"
 
string INFLUX_CONF_TIME = "time"
 
string INFLUX_CONF_VALUE = "value"
 
string INFLUX_CONF_VALUE_V2 = "_value"
 
string LANGUAGE_FLUX = "flux"
 
string LANGUAGE_INFLUXQL = "influxQL"
 
 MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=10)
 
tuple NO_BUCKET_ERROR
 
tuple NO_DATABASE_ERROR
 
tuple QUERY_ERROR
 
tuple QUERY_MULTIPLE_RESULTS_MESSAGE
 
string QUERY_NO_RESULTS_MESSAGE = "Query returned no results, sensor state set to UNKNOWN: %s."
 
int QUEUE_BACKLOG_SECONDS = 30
 
 RE_DECIMAL = re.compile(r"[^\d.]+")
 
 RE_DIGIT_TAIL = re.compile(r"^[^\.]*\d+\.?\d+[^\.]*$")
 
string RENDERING_QUERY_ERROR_MESSAGE = "Could not render query template: %s."
 
string RENDERING_QUERY_MESSAGE = "Rendering query: %s."
 
string RENDERING_WHERE_ERROR_MESSAGE = "Could not render where template: %s."
 
string RENDERING_WHERE_MESSAGE = "Rendering where: %s."
 
string RESUMED_MESSAGE = "Resumed, lost %d events."
 
int RETRY_DELAY = 20
 
int RETRY_INTERVAL = 60
 
string RETRY_MESSAGE = f"%s Retrying in {RETRY_INTERVAL} seconds."
 
string RUNNING_QUERY_MESSAGE = "Running query: %s."
 
string TEST_QUERY_V1 = "SHOW DATABASES;"
 
string TEST_QUERY_V2 = "buckets()"
 
int TIMEOUT = 10
 
string WRITE_ERROR = "Could not write '%s' to influx due to '%s'."
 
string WROTE_MESSAGE = "Wrote %d events."
 

Detailed Description

Constants for InfluxDB integration.

Variable Documentation

◆ API_VERSION_2

string homeassistant.components.influxdb.const.API_VERSION_2 = "2"

Definition at line 74 of file const.py.

◆ BATCH_BUFFER_SIZE

int homeassistant.components.influxdb.const.BATCH_BUFFER_SIZE = 100

Definition at line 80 of file const.py.

◆ BATCH_TIMEOUT

int homeassistant.components.influxdb.const.BATCH_TIMEOUT = 1

Definition at line 79 of file const.py.

◆ CATCHING_UP_MESSAGE

string homeassistant.components.influxdb.const.CATCHING_UP_MESSAGE = "Catching up, dropped %d old events."

Definition at line 120 of file const.py.

◆ CLIENT_ERROR_V1

tuple homeassistant.components.influxdb.const.CLIENT_ERROR_V1
Initial value:
1 = (
2  "InfluxDB database is not accessible due to '%s'. "
3  "Please check that the database, username and password are correct and "
4  "that the specified user has the correct permissions set."
5 )

Definition at line 102 of file const.py.

◆ CLIENT_ERROR_V2

tuple homeassistant.components.influxdb.const.CLIENT_ERROR_V2
Initial value:
1 = (
2  "InfluxDB bucket is not accessible due to '%s'. "
3  "Please check that the bucket, org and token are correct and "
4  "that the token has the correct permissions set."
5 )

Definition at line 97 of file const.py.

◆ CODE_INVALID_INPUTS

int homeassistant.components.influxdb.const.CODE_INVALID_INPUTS = 400

Definition at line 85 of file const.py.

◆ COMPONENT_CONFIG_SCHEMA_CONNECTION

dictionary homeassistant.components.influxdb.const.COMPONENT_CONFIG_SCHEMA_CONNECTION
Initial value:
1 = {
2  # Connection config for V1 and V2 APIs.
3  vol.Optional(CONF_API_VERSION, default=DEFAULT_API_VERSION): vol.All(
4  vol.Coerce(str),
5  vol.In([DEFAULT_API_VERSION, API_VERSION_2]),
6  ),
7  vol.Optional(CONF_HOST): cv.string,
8  vol.Optional(CONF_PATH): cv.string,
9  vol.Optional(CONF_PORT): cv.port,
10  vol.Optional(CONF_SSL): cv.boolean,
11  vol.Optional(CONF_VERIFY_SSL, default=DEFAULT_VERIFY_SSL): cv.boolean,
12  vol.Optional(CONF_SSL_CA_CERT): cv.isfile,
13  vol.Optional(CONF_PRECISION): vol.In(["ms", "s", "us", "ns"]),
14  # Connection config for V1 API only.
15  vol.Inclusive(CONF_USERNAME, "authentication"): cv.string,
16  vol.Inclusive(CONF_PASSWORD, "authentication"): cv.string,
17  vol.Optional(CONF_DB_NAME, default=DEFAULT_DATABASE): cv.string,
18  # Connection config for V2 API only.
19  vol.Inclusive(CONF_TOKEN, "v2_authentication"): cv.string,
20  vol.Inclusive(CONF_ORG, "v2_authentication"): cv.string,
21  vol.Optional(CONF_BUCKET, default=DEFAULT_BUCKET): cv.string,
22 }

Definition at line 133 of file const.py.

◆ CONF_BUCKET

string homeassistant.components.influxdb.const.CONF_BUCKET = "bucket"

Definition at line 22 of file const.py.

◆ CONF_COMPONENT_CONFIG

string homeassistant.components.influxdb.const.CONF_COMPONENT_CONFIG = "component_config"

Definition at line 29 of file const.py.

◆ CONF_COMPONENT_CONFIG_DOMAIN

string homeassistant.components.influxdb.const.CONF_COMPONENT_CONFIG_DOMAIN = "component_config_domain"

Definition at line 31 of file const.py.

◆ CONF_COMPONENT_CONFIG_GLOB

string homeassistant.components.influxdb.const.CONF_COMPONENT_CONFIG_GLOB = "component_config_glob"

Definition at line 30 of file const.py.

◆ CONF_DB_NAME

string homeassistant.components.influxdb.const.CONF_DB_NAME = "database"

Definition at line 21 of file const.py.

◆ CONF_DEFAULT_MEASUREMENT

string homeassistant.components.influxdb.const.CONF_DEFAULT_MEASUREMENT = "default_measurement"

Definition at line 25 of file const.py.

◆ CONF_FIELD

string homeassistant.components.influxdb.const.CONF_FIELD = "field"

Definition at line 40 of file const.py.

◆ CONF_FUNCTION

string homeassistant.components.influxdb.const.CONF_FUNCTION = "function"

Definition at line 46 of file const.py.

◆ CONF_GROUP_FUNCTION

string homeassistant.components.influxdb.const.CONF_GROUP_FUNCTION = "group_function"

Definition at line 39 of file const.py.

◆ CONF_IGNORE_ATTRIBUTES

string homeassistant.components.influxdb.const.CONF_IGNORE_ATTRIBUTES = "ignore_attributes"

Definition at line 33 of file const.py.

◆ CONF_IMPORTS

string homeassistant.components.influxdb.const.CONF_IMPORTS = "imports"

Definition at line 48 of file const.py.

◆ CONF_MEASUREMENT_ATTR

string homeassistant.components.influxdb.const.CONF_MEASUREMENT_ATTR = "measurement_attr"

Definition at line 26 of file const.py.

◆ CONF_MEASUREMENT_NAME

string homeassistant.components.influxdb.const.CONF_MEASUREMENT_NAME = "measurement"

Definition at line 41 of file const.py.

◆ CONF_ORG

string homeassistant.components.influxdb.const.CONF_ORG = "organization"

Definition at line 23 of file const.py.

◆ CONF_OVERRIDE_MEASUREMENT

string homeassistant.components.influxdb.const.CONF_OVERRIDE_MEASUREMENT = "override_measurement"

Definition at line 27 of file const.py.

◆ CONF_PRECISION

string homeassistant.components.influxdb.const.CONF_PRECISION = "precision"

Definition at line 34 of file const.py.

◆ CONF_QUERIES

string homeassistant.components.influxdb.const.CONF_QUERIES = "queries"

Definition at line 37 of file const.py.

◆ CONF_QUERIES_FLUX

string homeassistant.components.influxdb.const.CONF_QUERIES_FLUX = "queries_flux"

Definition at line 38 of file const.py.

◆ CONF_QUERY

string homeassistant.components.influxdb.const.CONF_QUERY = "query"

Definition at line 47 of file const.py.

◆ CONF_RANGE_START

string homeassistant.components.influxdb.const.CONF_RANGE_START = "range_start"

Definition at line 44 of file const.py.

◆ CONF_RANGE_STOP

string homeassistant.components.influxdb.const.CONF_RANGE_STOP = "range_stop"

Definition at line 45 of file const.py.

◆ CONF_RETRY_COUNT

string homeassistant.components.influxdb.const.CONF_RETRY_COUNT = "max_retries"

Definition at line 32 of file const.py.

◆ CONF_SSL_CA_CERT

string homeassistant.components.influxdb.const.CONF_SSL_CA_CERT = "ssl_ca_cert"

Definition at line 35 of file const.py.

◆ CONF_TAGS

string homeassistant.components.influxdb.const.CONF_TAGS = "tags"

Definition at line 24 of file const.py.

◆ CONF_TAGS_ATTRIBUTES

string homeassistant.components.influxdb.const.CONF_TAGS_ATTRIBUTES = "tags_attributes"

Definition at line 28 of file const.py.

◆ CONF_WHERE

string homeassistant.components.influxdb.const.CONF_WHERE = "where"

Definition at line 42 of file const.py.

◆ CONNECTION_ERROR

tuple homeassistant.components.influxdb.const.CONNECTION_ERROR
Initial value:
1 = (
2  "Cannot connect to InfluxDB due to '%s'. "
3  "Please check that the provided connection details (host, port, etc.) are correct "
4  "and that your InfluxDB server is running and accessible."
5 )

Definition at line 92 of file const.py.

◆ DEFAULT_API_VERSION

string homeassistant.components.influxdb.const.DEFAULT_API_VERSION = "1"

Definition at line 55 of file const.py.

◆ DEFAULT_BUCKET

string homeassistant.components.influxdb.const.DEFAULT_BUCKET = "Home Assistant"

Definition at line 53 of file const.py.

◆ DEFAULT_DATABASE

string homeassistant.components.influxdb.const.DEFAULT_DATABASE = "home_assistant"

Definition at line 50 of file const.py.

◆ DEFAULT_FIELD

string homeassistant.components.influxdb.const.DEFAULT_FIELD = "value"

Definition at line 57 of file const.py.

◆ DEFAULT_FUNCTION_FLUX

string homeassistant.components.influxdb.const.DEFAULT_FUNCTION_FLUX = "|> limit(n: 1)"

Definition at line 60 of file const.py.

◆ DEFAULT_GROUP_FUNCTION

string homeassistant.components.influxdb.const.DEFAULT_GROUP_FUNCTION = "mean"

Definition at line 56 of file const.py.

◆ DEFAULT_HOST_V2

string homeassistant.components.influxdb.const.DEFAULT_HOST_V2 = "us-west-2-1.aws.cloud2.influxdata.com"

Definition at line 51 of file const.py.

◆ DEFAULT_MEASUREMENT_ATTR

string homeassistant.components.influxdb.const.DEFAULT_MEASUREMENT_ATTR = "unit_of_measurement"

Definition at line 61 of file const.py.

◆ DEFAULT_RANGE_START

string homeassistant.components.influxdb.const.DEFAULT_RANGE_START = "-15m"

Definition at line 58 of file const.py.

◆ DEFAULT_RANGE_STOP

string homeassistant.components.influxdb.const.DEFAULT_RANGE_STOP = "now()"

Definition at line 59 of file const.py.

◆ DEFAULT_SSL_V2

bool homeassistant.components.influxdb.const.DEFAULT_SSL_V2 = True

Definition at line 52 of file const.py.

◆ DEFAULT_VERIFY_SSL

bool homeassistant.components.influxdb.const.DEFAULT_VERIFY_SSL = True

Definition at line 54 of file const.py.

◆ DOMAIN

string homeassistant.components.influxdb.const.DOMAIN = "influxdb"

Definition at line 73 of file const.py.

◆ EVENT_NEW_STATE

string homeassistant.components.influxdb.const.EVENT_NEW_STATE = "new_state"

Definition at line 72 of file const.py.

◆ INFLUX_CONF_FIELDS

string homeassistant.components.influxdb.const.INFLUX_CONF_FIELDS = "fields"

Definition at line 66 of file const.py.

◆ INFLUX_CONF_MEASUREMENT

string homeassistant.components.influxdb.const.INFLUX_CONF_MEASUREMENT = "measurement"

Definition at line 63 of file const.py.

◆ INFLUX_CONF_ORG

string homeassistant.components.influxdb.const.INFLUX_CONF_ORG = "org"

Definition at line 70 of file const.py.

◆ INFLUX_CONF_STATE

string homeassistant.components.influxdb.const.INFLUX_CONF_STATE = "state"

Definition at line 67 of file const.py.

◆ INFLUX_CONF_TAGS

string homeassistant.components.influxdb.const.INFLUX_CONF_TAGS = "tags"

Definition at line 64 of file const.py.

◆ INFLUX_CONF_TIME

string homeassistant.components.influxdb.const.INFLUX_CONF_TIME = "time"

Definition at line 65 of file const.py.

◆ INFLUX_CONF_VALUE

string homeassistant.components.influxdb.const.INFLUX_CONF_VALUE = "value"

Definition at line 68 of file const.py.

◆ INFLUX_CONF_VALUE_V2

string homeassistant.components.influxdb.const.INFLUX_CONF_VALUE_V2 = "_value"

Definition at line 69 of file const.py.

◆ LANGUAGE_FLUX

string homeassistant.components.influxdb.const.LANGUAGE_FLUX = "flux"

Definition at line 82 of file const.py.

◆ LANGUAGE_INFLUXQL

string homeassistant.components.influxdb.const.LANGUAGE_INFLUXQL = "influxQL"

Definition at line 81 of file const.py.

◆ MIN_TIME_BETWEEN_UPDATES

homeassistant.components.influxdb.const.MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=10)

Definition at line 87 of file const.py.

◆ NO_BUCKET_ERROR

tuple homeassistant.components.influxdb.const.NO_BUCKET_ERROR
Initial value:
1 = (
2  "InfluxDB bucket '%s' cannot be found. "
3  "Check the name is correct and the token has access to it."
4 )

Definition at line 107 of file const.py.

◆ NO_DATABASE_ERROR

tuple homeassistant.components.influxdb.const.NO_DATABASE_ERROR
Initial value:
1 = (
2  "InfluxDB database '%s' cannot be found. "
3  "Check the name is correct and the user has access to it."
4 )

Definition at line 111 of file const.py.

◆ QUERY_ERROR

tuple homeassistant.components.influxdb.const.QUERY_ERROR
Initial value:
1 = (
2  "Could not execute query '%s' due to '%s'. Check the syntax of your query."
3 )

Definition at line 116 of file const.py.

◆ QUERY_MULTIPLE_RESULTS_MESSAGE

tuple homeassistant.components.influxdb.const.QUERY_MULTIPLE_RESULTS_MESSAGE
Initial value:
1 = (
2  "Query returned multiple results, only value from first one is shown: %s."
3 )

Definition at line 125 of file const.py.

◆ QUERY_NO_RESULTS_MESSAGE

string homeassistant.components.influxdb.const.QUERY_NO_RESULTS_MESSAGE = "Query returned no results, sensor state set to UNKNOWN: %s."

Definition at line 124 of file const.py.

◆ QUEUE_BACKLOG_SECONDS

int homeassistant.components.influxdb.const.QUEUE_BACKLOG_SECONDS = 30

Definition at line 77 of file const.py.

◆ RE_DECIMAL

homeassistant.components.influxdb.const.RE_DECIMAL = re.compile(r"[^\d.]+")

Definition at line 90 of file const.py.

◆ RE_DIGIT_TAIL

homeassistant.components.influxdb.const.RE_DIGIT_TAIL = re.compile(r"^[^\.]*\d+\.?\d+[^\.]*$")

Definition at line 89 of file const.py.

◆ RENDERING_QUERY_ERROR_MESSAGE

string homeassistant.components.influxdb.const.RENDERING_QUERY_ERROR_MESSAGE = "Could not render query template: %s."

Definition at line 129 of file const.py.

◆ RENDERING_QUERY_MESSAGE

string homeassistant.components.influxdb.const.RENDERING_QUERY_MESSAGE = "Rendering query: %s."

Definition at line 128 of file const.py.

◆ RENDERING_WHERE_ERROR_MESSAGE

string homeassistant.components.influxdb.const.RENDERING_WHERE_ERROR_MESSAGE = "Could not render where template: %s."

Definition at line 131 of file const.py.

◆ RENDERING_WHERE_MESSAGE

string homeassistant.components.influxdb.const.RENDERING_WHERE_MESSAGE = "Rendering where: %s."

Definition at line 130 of file const.py.

◆ RESUMED_MESSAGE

string homeassistant.components.influxdb.const.RESUMED_MESSAGE = "Resumed, lost %d events."

Definition at line 121 of file const.py.

◆ RETRY_DELAY

int homeassistant.components.influxdb.const.RETRY_DELAY = 20

Definition at line 76 of file const.py.

◆ RETRY_INTERVAL

int homeassistant.components.influxdb.const.RETRY_INTERVAL = 60

Definition at line 78 of file const.py.

◆ RETRY_MESSAGE

string homeassistant.components.influxdb.const.RETRY_MESSAGE = f"%s Retrying in {RETRY_INTERVAL} seconds."

Definition at line 119 of file const.py.

◆ RUNNING_QUERY_MESSAGE

string homeassistant.components.influxdb.const.RUNNING_QUERY_MESSAGE = "Running query: %s."

Definition at line 123 of file const.py.

◆ TEST_QUERY_V1

string homeassistant.components.influxdb.const.TEST_QUERY_V1 = "SHOW DATABASES;"

Definition at line 83 of file const.py.

◆ TEST_QUERY_V2

string homeassistant.components.influxdb.const.TEST_QUERY_V2 = "buckets()"

Definition at line 84 of file const.py.

◆ TIMEOUT

int homeassistant.components.influxdb.const.TIMEOUT = 10

Definition at line 75 of file const.py.

◆ WRITE_ERROR

string homeassistant.components.influxdb.const.WRITE_ERROR = "Could not write '%s' to influx due to '%s'."

Definition at line 115 of file const.py.

◆ WROTE_MESSAGE

string homeassistant.components.influxdb.const.WROTE_MESSAGE = "Wrote %d events."

Definition at line 122 of file const.py.