Introduction: The Bitcoin Watcher

Picture of The Bitcoin Watcher

We already saw in the instructabe "Scroll a Message on a LED Matrix" how to get the up-to-date Bitcoin value through the paymium API.

We'll see here how to go a step further, and create alerts.

Step 1: Get the Bitcoin Value

Picture of Get the Bitcoin Value

The paymium API proposes to get the Bitcoin value through the command

It results in the string :


The interesting part here is ask, that gives the last known Bitcoin value. It will be stored in msg.payload.ask.

Step 2: Display the Value

Picture of Display the Value

In order to display the value, we just have to put the msg.payload.ask value in a string stored in msg.payload :


Step 3: When to Display?

Picture of When to Display?

We can decide when to display the Bitcoin value on the LED panel through the Inject node. In this example, we decide to display the value every 5 minutes.

Step 4: Create Alerts and Notifications

Picture of Create Alerts and Notifications

What is interesting with Bitcoin is certainly to create alerts and notifications. We can imagine for example to play a sound, to send a mail or a SMS, but there are plenty of different ways to notify.

Let's take an example: we'll here send a sms if the running value goes above 400 euros, and display the value with different colors.

We first test the value with the following function:

if (msg.payload.ask >= 400) {
return [ msg, null ]; } else { return [ null, msg ]; }

And we launch the two different actions depending on the result of the test.

If condition is verified, we write the value in green, and send a sms with the value, and if not, we display the value in red.

Step 5: Learn More!

Picture of Learn More!


About This Instructable




Bio: The ThingBox Project - A ready to flash Raspberry Pi image that contains Node-RED and Internet Of Things software for non developers.
More by thethingbox:Telegram Bot and TimeSquAir: the BedrockInstall Zwave Soft Remote on TimeSquAirInstall Zwave LED Bulb on TimeSquAir
Add instructable to: