{"id":17526929,"url":"https://github.com/dgomes/ha_rrd_recorder","last_synced_at":"2025-05-08T19:33:35.693Z","repository":{"id":56019577,"uuid":"291157903","full_name":"dgomes/ha_rrd_recorder","owner":"dgomes","description":"RRD Custom Component for Home Assistant","archived":false,"fork":false,"pushed_at":"2024-03-30T22:09:50.000Z","size":47,"stargazers_count":11,"open_issues_count":4,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-03-30T23:21:43.739Z","etag":null,"topics":["home-assistant-component","rrdtool"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dgomes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-28T22:29:40.000Z","updated_at":"2024-05-20T14:42:20.199Z","dependencies_parsed_at":"2024-05-20T14:42:15.028Z","dependency_job_id":null,"html_url":"https://github.com/dgomes/ha_rrd_recorder","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgomes%2Fha_rrd_recorder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgomes%2Fha_rrd_recorder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgomes%2Fha_rrd_recorder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgomes%2Fha_rrd_recorder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dgomes","download_url":"https://codeload.github.com/dgomes/ha_rrd_recorder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253135438,"owners_count":21859645,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["home-assistant-component","rrdtool"],"created_at":"2024-10-20T15:02:38.253Z","updated_at":"2025-05-08T19:33:35.641Z","avatar_url":"https://github.com/dgomes.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# THIS PROJECT IS OBSOLETE\nEver since the introducation of [Long-term statistics](https://data.home-assistant.io/docs/statistics/) this project reason to exist has vanished. \n\n# RRD Recorder for Home Assistant\n\nThis integration is similar to other recorders (e.g. influxdb) but uses [RRDTool](https://oss.oetiker.ch/rrdtool/) as a backend.\nThe main benefit of using RRD Recorder is that you can store data for long periods of time without the complexity of adding servers/addon's, unfortunantely it comes with the cost of loss of detailed information for older periods of time (the concept is that you don't need details to the second for data generated a year ago, the average of the day year ago is enough)\n\nCurrently, this integration records to the RRD database files and has a \"Camera\" platform that will generate the graphs\n\n## Installation\n\nIf you are running Home Assistant OS or Container, you don't need to install anything extra.\n\n### Operating System dependencies\n\nRRD Recorder depends on librrd which is a C library. \n\nYou will need to follow the steps in https://pythonhosted.org/rrdtool/install.html before this integration will work.\n\nMost likely this will suffice in Debian/Ubuntu:\n```bash\n$ sudo apt-get install librrd-dev libpython3-dev\n```\n\nIf you are using Alpine Linux (the base of many Docker Images):\n```bash\n$ apk add build-base rrdtool-dev ttf-dejavu python3-dev py-pip\n```\n\n### Actual integration installation\n\n## Manual\n\n- Place the custom_components folder in your configuration directory (or add its contents to an existing custom_components folder). It should look similar to this:\n\n```\n\u003cconfig directory\u003e/\n|-- custom_components/\n|   |-- rrd_recorder/\n|       |-- __init__.py\n|       |-- camera.py\n|       |-- const.py\n|       |-- manifest.py\n|       |-- utils.py\n```\n\n- Edit your configuration.yaml file according to the example bellow \n\n## HACS\n\nIf you want HACS to handle installation and updates, add _RRD Recorder_ as a custom repository or find it in the default list of custom integrations.\n\n## Configuration\n\nExample:\n\n```yaml\n# Example configuration.yaml\nrrd_recorder:\n  path: '/rrd'\n  databases:\n    - name: internet_connection\n      step: 30s\n      data_sources:\n        - sensor: sensor.upnp_router_bytes_received\n          name: recv\n          cf: COUNTER\n          heartbeat: 300\n        - sensor: sensor.upnp_router_bytes_sent\n          name: sent\n          cf: COUNTER\n          heartbeat: 300\n      round_robin_archives:\n        - cf: AVERAGE\n          steps: 1m\n          rows: 1h\n        - cf: AVERAGE\n          steps: 5m\n          rows: 1d\n        - cf: AVERAGE\n          steps: 1h\n          rows: 1w\n        - cf: AVERAGE\n          steps: 1d\n          rows: 12M\n\ncamera:\n  - platform: rrd\n    name: vodafone\n    rrdfile: /rrd/mydata.rrd\n    timerange: 2d  \n    args:   #if you don't define any args you will get lines corresponding to the DS's in the file\n      - \"VDEF:vrecv=Recv,MAXIMUM\"\n      - \"VRULE:vrecv#FF3300:MAX\"\n      - \"VDEF:sent=Sent,MAXIMUM\"\n      - \"VRULE:sent#000000:MAX\"\n      - \"AREA:Recv#00FF00:Received Bytes\"\n      - \"LINE1:Sent#0033FF:Sent Bytes\"\n    rrdgraph_options:   # Optional graph enhancements\n      - \"--no-legend\"\n      - \"--lower-limit\"\n      - \"0\"\n```\n\n### RRD Configuration\n\n```yaml\npath:\n  description: The location relative to your HA config path where you want to store your rrd database files\n  required: false\n  type: string\ndatabases:\n  description: List of RRD databases (files) \n  required: true\n  type: list\n  keys:\n    name:\n      description: Name of the database\n      required: true\n      type: string\n    step: \n      description: how often to expect updates\n      required: false\n      type: seconds\n      default: 300\n    data_sources:\n      description: Data Sources (DS) of the database\n      required: true\n      type: list\n      keys:\n        sensor:\n          description: entity id to keep record of\n          required: true\n          type: entity_id\n        name:\n          description: short name to be used internally by RRD\n          required: true\n        cf: \n          description: consolidation function (check https://oss.oetiker.ch/rrdtool/doc/rrdcreate.en.html) for available functions\n          required: true\n          type: list\n        heartbeat:\n          description: amount of time after which DS is considered unknown\n    round_robin_archives:\n      description: Round Robin Archives stored\n      required: true\n      type: list\n      keys:\n        cf: \n          description: consolidation function (check https://oss.oetiker.ch/rrdtool/doc/rrdcreate.en.html) for available functions. Possible values are 'MIN','MAX','AVERAGE','LAST'\n          required: true\n          type: list\n        steps:\n          description: periodicy of records (a record is stored every step)\n          required: true\n          type: seconds\n        rows:\n          description: amount of steps recorded in the database\n          required: true\n          type: int\n```\n\n### Camera configuration\n\n```yaml\nname:\n  description: Name of the camera entity \n  required: true\n  type: string\nrrdfile:\n  description: path to the rrd file\n  required: true\nwidth:\n  description: width of the generated graph\n  required: false\n  default: 400\nheight:\n  description: height of the generated graph\n  required: false\n  default: 100\ntimerange:\n  description: amount of time to be displayed\n  required: false\n  default: 1d\nargs:\n  description: common arguments used by *rrdtool graph*\n  required: false\nrrdgraph_options:\n  description: additional `rrdgraph` command line options \n  require: false\n```\n\nThe camera component renders RRD graphs for displaying in HASS frontend.\n\nIt tries to guess everything from the rrd file automatically.\nAlternatively you can anytime pass new arguments in `args` or command line options in `rrdgraph_options`.\n\n#### `args`\n\nFor basic rrd graph, you do not need to make any own configuration in `args`.\nIn this case rrd graph will render a line for each datasource of `rrdfile` automatically.\n\nFor advanced graph rendering you can use `args` for definitions of parameters CDEF, VDEF, LINE1, ARRAY, etc.\nIf you will use own `args` configuration there is automatically generated DEF for each RRA of each datasource.\n\n**Example:**\n\nRrd file `example1.rrd` has configuration:\n\n    rrdtool create example1.rrd \\\n    --step '900' \\\n    'DS:temperature:GAUGE:1800:U:U' \\\n    'RRA:AVERAGE:0.5:4:48' \\\n    'RRA:AVERAGE:0.5:96:365'     \n\nFor this `example1.rrd` there are following DEF variables, which you can use in `args`.\n\n- `Temperature`\n- `Temperature_AVERAGE_4`\n- `Temperature_AVERAGE_96`\n\n*Note: As you see in example a `vname` is always a capitalized name of `ds-name`.*\n\n**Hint** use a tool such as [http://rrdwizard.appspot.com/rrdgraph.php](http://rrdwizard.appspot.com/rrdgraph.php)\n\n#### `rrdgraph_options`\n\nThis optional configuration allows passing any additional [rrdgraph command line options](https://oss.oetiker.ch/rrdtool/doc/rrdgraph.en.html#OPTIONS).\nEach command line parameter must be defined as separate array item.\n\n**Example: Dark Mode**\n\n```yaml\nrrdgraph_options:\n  - \"-c\"\n  - \"CANVAS#000000\"\n  - \"-c\"\n  - \"FONT#FFFFFF\"\n  - \"-c\"\n  - \"BACK#1C1C1C\"\n  - \"-c\"\n  - \"SHADEA#1C1C1C\"\n  - \"-c\"\n  - \"SHADEB#1C1C1C\"\n```\n\n**Example: Vertical Label**\n\n```yaml\nrrdgraph_options:\n  - \"--vertical-label\"\n  - \"Power [W]\"\n```\n\n**Example: Hiding Graph Legend**      \n\n```yaml\nrrdgraph_options:\n  - \"--no-legend\"\n```\n      \n**Example: Force X-axis from zero**\n\n```yaml\nrrdgraph_options:\n  - \"--lower-limit\"\n  - \"0\"\n```\n\n## Authors\n- Diogo Gomes\n- [Martin Zaloudek](https://github.com/ma-zal)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgomes%2Fha_rrd_recorder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdgomes%2Fha_rrd_recorder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgomes%2Fha_rrd_recorder/lists"}