Helium Blockchain custom component

@ryans any update on miner individual earnings?

@ryans An plan to integrate in it data of IoT devices connected by Lora at Helium network ? For now only way I see is to use MQTT server of Helium and bridge it with HA but not the easiest and useful :confused:

No, this is only for monitoring and visualizing data on the Helium blockchain. Anything to do with actual IoT data from sensors MUST always go through the Helium console and associates MQTT queues.

I agree, it would be nice if that process was easier. Hopefully someone figures out an interesting way to get LongFi IoT data forwarded to HA instances in an easier to setup way.

See @TheNard’s example above for how to get individual earnings.

I believe there isn’t any example to track individual miner earnings in this thread

1 Like

Is it hard to build something of this sort? I want to make the same but with my ckb wallet. I wanted to learn how to do this so that I can add other wallets as well…

I was able to create an automation to send my phone a notification every time my wallet changes (i.e. rewards):

alias: Helium Increase
description: ''
trigger:
  - platform: state
    entity_id: sensor.helium_wallet_today
condition:
  - condition: template
    value_template: '{{ trigger.to_state.state | float > trigger.from_state.state | float }}'
action:
  - service: notify.mobile_app_kayla_iphone
    data:
      title: New Helium Rewards
      message: >-
        Total Mined Today: {{ states('sensor.helium_wallet_today') }} HNT

        Total USD: ${{ ((states('sensor.helium_wallet_today') |float) *
        (states('sensor.helium_hnt_oracle_price') |float)) |round(2) }}
mode: single
5 Likes

Thanks for this! I came here to link to your forum post on reddit about phone notifications and after I posted it I saw you already shared how to do it. It’s working great.

I’m looking to try to do the same thing, have you had any luck with this?

I couldn’t seem to make this work adding file to automations.yaml via file editor. Then once inside the automations UI and edit YAML from there it worked. << posting this in case anyone has similar issue.

Thanks for this component!

This is awesome. Thanks so much.

Thanks for this brilliant custom component!

Although I have to say that I’m now obsessing at looking at my Apple Watch all the time :laughing:

See the bottom left complication showing Wallet total and Wallet today. I set the limit to 10 HNT as I stake it when it reaches 10.

Watch Face

4 Likes

thx for the tutorial :slight_smile:

Awesome example of showing on Apple Watch!

2 Likes

I’m unable to get more decimals for my wallet.

This configuration create a sensor (wallet) with only 2 decimals:

sensor:

  • platform: helium
    wallets:
    • 14MR1uu8vJERJs32UTRe6Y3TCyFRecTgAiVkkc5aLxeNJmRx9C1

How can I get more decimals?

thank you

The helium_wallet_today sensor didn’t seem to be returning the correct value (either were the weekly or monthly), so I switched the automation to just use the wallet. I also changed to look at the from and to state values to determine what the reward amount was and it displays that in the notification. You just have to update your wallet Id and device Id for your phone. And when you click the notification, it takes you to heliumtracker.io, you can change this to whatever you want. Works great (when I’m getting rewards, which has been infrequent lately). Thanks @kaylasiemon!

alias: New Helium Rewards
description: ''
trigger:
  - platform: state
    entity_id: sensor.helium_wallet_[WALLET ID GOES HERE]
condition:
  - condition: template
    value_template: '{{ trigger.to_state.state | float > trigger.from_state.state | float }}'
action:
  - device_id: [PHONE DEVICE ID GOES HERE]
    domain: mobile_app
    type: notify
    title: >-
      New Helium Reward {{ ((trigger.to_state.state | float) -
      (trigger.from_state.state | float))|round(5) }} HNT
    message: >-
      Wallet Total: {{
      states('sensor.helium_wallet_[WALLET ID GOES HERE]')
      }} HNT   ${{
      ((states('sensor.helium_wallet_[WALLET ID GOES HERE]')|float)
      * (states('sensor.helium_hnt_oracle_price')|float)) |round(2) }} USD
    data:
      clickAction: https://heliumtracker.io/dashboard
mode: single

If you open up the sensor.py file, you can find the round call and increase from 2 to whatever you want. Just make the change, save the file and restart HA.

/config/custom_components/helium/sensor.py

Line 210, it’s the last parameter of the round function.

Any suggestions on the default precision for rounding of this value (if not 2)…3? 4?

I changed mine to 6.