{"id":14985217,"url":"https://github.com/diego7marques/ha-aws-cost","last_synced_at":"2025-04-10T23:50:31.140Z","repository":{"id":250066111,"uuid":"828506116","full_name":"diego7marques/ha-aws-cost","owner":"diego7marques","description":"Home assistant component for AWS Cost","archived":false,"fork":false,"pushed_at":"2025-03-24T10:11:47.000Z","size":44,"stargazers_count":1,"open_issues_count":4,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T20:38:13.589Z","etag":null,"topics":["aws","costexplorer","finops","homeassistant"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/diego7marques.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-07-14T11:09:01.000Z","updated_at":"2025-01-14T23:13:10.000Z","dependencies_parsed_at":"2024-08-26T14:58:36.209Z","dependency_job_id":"59db590d-1e2f-4541-b306-31db258a6720","html_url":"https://github.com/diego7marques/ha-aws-cost","commit_stats":{"total_commits":13,"total_committers":3,"mean_commits":4.333333333333333,"dds":0.3846153846153846,"last_synced_commit":"05c4da34aeafce90fab695f2c5786e706621fc09"},"previous_names":["diego7marques/ha-aws-cost"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diego7marques%2Fha-aws-cost","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diego7marques%2Fha-aws-cost/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diego7marques%2Fha-aws-cost/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diego7marques%2Fha-aws-cost/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/diego7marques","download_url":"https://codeload.github.com/diego7marques/ha-aws-cost/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248317707,"owners_count":21083528,"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":["aws","costexplorer","finops","homeassistant"],"created_at":"2024-09-24T14:10:31.594Z","updated_at":"2025-04-10T23:50:31.126Z","avatar_url":"https://github.com/diego7marques.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 💰 AWS Cost for Home Assistant \n\nThe ha-aws-cost custom component interacts with AWS to get the month to date cost and forecast cost and make it available on Home Assistant. It adds two new entities:\n\n* **Month to date cost:** The current cost of your AWS account \n* **Forecasted month costs:** The forecasted cost based in your current consumption \n\nIt was created to give you easy access to the current cost of your AWS account.\n\n## Pre-requirements\n1. You'll need an 'Access Key ID' and a 'Secret Access Key' to set the integration up. I strongly recommend you to create a new IAM user and policy with the following permissions:\n\n    ```json\n    {\n        \"Version\": \"2012-10-17\",\n        \"Statement\": [\n            {\n                \"Sid\": \"VisualEditor0\",\n                \"Effect\": \"Allow\",\n                \"Action\": [\n                    \"ce:GetCostAndUsage\",\n                    \"ce:GetCostForecast\"\n                ],\n                \"Resource\": \"*\"\n            }\n        ]\n    }\n    ```\n\nIn case you don't know how to generate the credentials, please read the following documentation: [Managing access keys for IAM users\n](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html#Using_CreateAccessKey)\n\n\n## Installation\n\n### Option 1: HACS\n\nFirst, install the custom integration using [HACS](https://hacs.xyz/).\n\n1. Add the integration using HACS\n2. Restart Home Assistant\n\n[![](https://my.home-assistant.io/badges/hacs_repository.svg)](https://my.home-assistant.io/redirect/hacs_repository/?owner=diego7marques\u0026repository=ha-aws-cost\u0026category=integration)\n\n### Option 2: Manual installation\n\n1. Download and copy the `custom_components/aws_cost` directory into the `custom_components` folder on your home assistant installation.\n\n2. Restart Home Assistant\n\n## Setup\n\nOnce installed, go to `Settings \u003e Devices \u0026 services \u003e + Add integration \u003e AWS Cost`. The setup will request 4 inputs:\n\n1. **AWS Access Key ID**: _Access key generated for the IAM user._\n2. **AWS Secret Access key**: _Access Secret key generated for the IAM User._\n3. **AWS Region**: _Your default region. As Cost Explorer is a global resource, the region will only be used to adquire the token._\n4. **Update Frequency**: _How many times you want your data to be updated a day. The options are: `Daily`, `Every 12 hours` and `Every 6 hours`._\n\n## Considerations\n\n* AWS charges $0.01 for any request done to AWS Cost Explorer API. For more information: [AWS Cost Explorer Pricing](https://aws.amazon.com/aws-cost-management/aws-cost-explorer/pricing/#:~:text=Cost%20Explorer%20offers%20hourly%20granularity,specific%20resource%20and%20usage%20type.)\n\n    _NOTE: Each pooling to update the entity state makes two requests to AWS CostExplorer API, using the `GetCostandUsage` and `GetCostForecast` operations._\n\n* The costs shown may not always be up-to-date, as AWS explains:\n\n    \u003e\"Cost Explorer refreshes your cost data at least once every 24 hours. However, this depends on your upstream data from your billing applications, and some data might be updated later than 24 hours.\"\n\n    Reference: [Analyzing your costs with AWS Cost Explorer](https://docs.aws.amazon.com/cost-management/latest/userguide/ce-what-is.html)\n\n## Example cards\n![image](https://github.com/user-attachments/assets/cc7aaaf2-b72a-435b-845d-2f02a85b16af)\n\n\u003cdetails\u003e\n  \u003csummary\u003e🔧 Code\u003c/summary\u003e\n    \n  ```yaml\n  type: horizontal-stack\n  cards:\n    - type: custom:mini-graph-card\n      name: AWS Cost\n      entities:\n        - entity: sensor.month_to_date_cost\n          name: Cost\n      icon: mdi:aws\n      hours_to_show: 72\n      show:\n        icon: true\n        name: true\n        state: true\n        legend: false\n    - type: custom:mini-graph-card\n      name: AWS Forecasted Cost\n      entities:\n        - entity: sensor.forecasted_month_costs\n          name: Forecast\n      icon: mdi:aws\n      hours_to_show: 72\n      show:\n        icon: true\n        name: true\n        state: true\n        legend: false\n  ```\n\u003c/details\u003e\n\n![image](https://github.com/user-attachments/assets/3835c842-d036-409b-a92c-2ff1cf9e562d)\n\n\u003cdetails\u003e\n  \u003csummary\u003e🔧 Code\u003c/summary\u003e\n    \n  ```yaml\n  type: custom:mushroom-chips-card\n  chips:\n  - type: entity\n    entity: sensor.month_to_date_cost\n    icon_color: orange\n    icon: mdi:aws\n  ```\n\u003c/details\u003e\n\nCards used:\n* 🍄 [Mushroom](https://github.com/piitaya/lovelace-mushroom)\n* [Horizontal stack card\n](https://www.home-assistant.io/dashboards/horizontal-stack/)\n  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiego7marques%2Fha-aws-cost","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiego7marques%2Fha-aws-cost","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiego7marques%2Fha-aws-cost/lists"}