Influxdb is a time series database, designed to store series of data, and so is much more efficient at it. MariaDB is a relational database, which is good at storing complex relationships, but at the cost of efficiency for relatively simple tasks like this.
I have not used Hassio, but I would be surprised if there isn’t an addon for Influxdb.
alright, thx.
and you have set excludes/includes for recorder, history and logbook? They wont load in my setting, and overload the system to a standstill.
If so, please would you share you’re settings there? Since you run on a Pi, that would be good reference for me!
Ive set includes /excludes for now, but am not very confident ive set them tight enough.
As i understand it those are than read by MariaDB, and the Influx would create its own db, read by grafana on another device?
Just to make clear, what is stored in the influxdb database is configured in the Influxdb component settings, and is completely independent of the history and recorder components.
I use the default sqlite rather than Mariadb and my settings are quite simple
# Enables support for tracking state changes over time.
history:
# The recorder component is storing details in a database which then are handled by the history componen
recorder:
purge_interval: 1
purge_keep_days: 3
exclude:
domains:
- weblink
- updater
The sqllite database file is currently 36M.
For influxdb I specify the entities I want to store
yes! all other properties are retained… Ive just mailed the devs of the Iungo if this is expected behavior and if they could see on/off to be published once a minute or so.
What makes it even stranger is that is starts-off alright, and after some time suddenly the sensors are dead.
Ive even suspected my editing several automations to be the culprit, but is has roven to be the other way round. No on/off state read or resent.
Maybe my setting the recorder and logger/history options could have interfered? Ive included switches, sensors and binary_sensors, but still things went wrong this morning.
Did a reboot of the Iungo hub, and all sensors were populated again, thank goodness. Proves the code in HA is alright? or should anything here be changed:
ive checked that out, but it still is a bit off of a add-on… lots of finetuning still necessary. Not afraid of that, but i would love to be able to use this, to write the DB to an attached thumb.
Id probably
1- have to instruct Hassio to mount and use the thumb and then
2- instruct InfluxDB to use the thumb
using this code that seems to be an option:
This section controls where the actual shard data for InfluxDB lives and how it is flushed from the WAL. dir may need to be changed to a suitable place for you system, but the WAL settings are an advanced configuration. The defaults should work for most systems.
dir = “/var/lib/influxdb/data” The directory where InfluxDB stores the data. This directory may be changed. Note: The default directory for OS X installations is /Users/<username>/.influxdb/data Environment variable: INFLUXDB_DATA_DIR
obviously i want to be able to force the HA to read the state of the switches. I thought to create some buttons to run the command_line state i use before, and an extra for the mqtt to reread.
I do that sometimes manually because the Hub itself doesn’t always show the correct state either…
my curl was:
curl -X POST -d ‘{“seq”:1, “method”:“object_prop_get”, “arguments”:{“oid”:“7b4d9b1b”, “prop”:“state”}}’ http://xxxx.xxxx/iungo/api_request
Hrm… An easier option might be to create an input_boolean to track state. You could create an automation that’s triggered by changes to the mqtt topic and sets the input_boolean accordingly. The input_boolean state would be restored on startup if you have recorder component configured. You could even add a trigger to turn the input_boolean on when power usage > 0.
o dear, this sounds way over my head right now.
`really have to let sink in what you say.
I have recorder configured (still) so thats easy
the other aspects are understandably sane, automate in case of undesired behavior, and repair, but i wouldn’t know how to begin yet.
Suppose you couldn’t be tempted to give it a first shot… #fingerscrossed…
wow. thats a great start, i can fill this in with all my sensors (i think)
Still, what would happen when either on or off is triggered. would they reread the value? the service turn_on or _off doesn’t actually switch anything does is?
The input_boolean will turn on if the mqtt topic receives a payload of on or if the usage sensor changes to any value that’s above 0. The input_boolean will turn off if the mqtt topic receives a payload of off. The state of the sensor will be restored from recorder component when Home Assistant starts.