Giter Site home page Giter Site logo

fransixles / cryptoinfo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from heyajohnny/cryptoinfo

0.0 0.0 0.0 41 KB

Provides Home Assistant sensors for all cryptocurrencies supported by CoinGecko

License: GNU General Public License v3.0

Python 100.00%

cryptoinfo's Introduction

Home Assistant sensor component for cryptocurrencies

hacs_badge

Powered by CoinGecko API

Provides Home Assistant sensors for all cryptocurrencies supported by CoinGecko

If you like my work, please buy me a coffee. This will keep me awake :)

Install:

  • Copy the files in the /custom_components/cryptoinfo/ folder to: [homeassistant]/config/custom_components/cryptoinfo/

Example config:

  sensor:
    - platform: cryptoinfo
      id: "main wallet"                (optional, default = '') add some extra naming to the sensor
      cryptocurrency_name: "ethereum"  (default = "bitcoin")
      currency_name: "eur"             (default = "usd")
      multiplier: 1                    (default = 1) the currency value multiplied by this number
      update_frequency: 15             (default = 60) number of minutes to refresh data of the sensor

Or copy paste the values from this configuration.yaml

For the complete list of supported values for 'cryptocurrency_name', visit this page: https://api.coingecko.com/api/v3/coins/list and copy / paste the "id" value to use as 'cryptocurrency_name'

For the complete list of supported values for 'currency_name', visit this page: https://api.coingecko.com/api/v3/simple/supported_vs_currencies and copy / paste the value to use as 'currency_name'

Attributes

There are 3 important attributes:

  • volume. This will return the 24 hour volume in 'currency_name'(default = "usd") of the 'cryptocurrency_name'(default = "bitcoin")
  • change. This will return the 24 hour change in 'currency_name'(default = "usd") of the 'cryptocurrency_name'(default = "bitcoin")
  • market_cap. This will return the total market cap of the 'cryptocurrency_name'(default = "bitcoin") displayed in 'currency_name'(default = "usd")

Example for usage of attributes. This example creates a new sensor with the attribute value 'vokume' of the sensor 'sensor.cryptoinfo_main_wallet_ethereum_eur':

  - platform: template
    sensors:
      cryptoinfo_main_wallet_ethereum_eur_24h_volume:
        value_template: "{{ state_attr('sensor.cryptoinfo_main_wallet_ethereum_eur', 'volume') | round(0) }}"
        unit_of_measurement: ""

If you want to know the total value of your cryptocurrencies, you could use this template as an example. This example combines the total value of 3 sensors into this 1 template sensor:

  - platform: template
    sensors:
      crypto_total:
        value_template: "{{
          ( states('sensor.cryptoinfo_main_wallet_ethereum_eur') | float | round(2)) +
          ( states('sensor.cryptoinfo_bitcoin_eur') | float | round(2)) +
          ( states('sensor.cryptoinfo_cardano_eur') | float | round(2))
          }}"
        unit_of_measurement: ''
        friendly_name: Total value of all my cryptocurrencies

Issues and new functionality

If there are any problems, please create an issue in https://github.com/heyajohnny/cryptoinfo/issues If you want new functionality added, please create an issue with a description of the new functionality that you want in: https://github.com/heyajohnny/cryptoinfo/issues

cryptoinfo's People

Contributors

heyajohnny avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.