Duino-Coin Balance command line sensor (curl + jq)

I want to have a simple sensor that shows the balance of my Duino-Coin, I have found a nice add-on that is programmed in python, DuinoCoin-balance-Home-Assistant but I rather prefer to follow the home assistant docs and do my own, using the sensor command_line and a customization of the icon.

This is how to have the sensor only editing the configuration.yaml.

# Example configuration.yaml for Duino_coin, Balance for revox ( founder of Duino-Coin) , just change it by your user name.
sensor:
  - platform: command_line
    name: Duino
    command: "curl https://server.duinocoin.com/balances/revox | jq '.result.balance'"
    unit_of_measurement: 'Ducos'
    unique_id: 'Duino_test'
    value_template: "{{ value | round (3) }}"

homeassistant:
  name: Home
  unit_system: metric
  # etc

  customize:
    sensor.duino:
      entity_picture: https://raw.githubusercontent.com/revoxhere/duino-coin/master/Resources/duco-alt.png

2 Likes