Get cryptocurrency values?

Any easy way to get cryptocurrency values in OH?
Thanks!

Yes

EDIT:
The above answer fits your question :wink:
Since you give no information what “easy” for you is and how much you are willing to invest.

You could use APIs like CoinMarketCap to get some data and parse it to openHAB items.
But you gave ZERO INFORMATION about your setup!
If you use for example HABPanel you could also create just HTML panels with data from Coinbase
Or like this click_me

Again no information provided!

While I agree that the question could have been more fully formed, I don’t think the sarcasm is necessary. This isn’t something that’s going to be in the docs, and there are no search results for “crypto currency” (though I didn’t look deeper than that).

You’re basically picking on the word “easy”, but if they had asked “has anyone tried getting cryptocurrency values into OH?”, the one-liner question would be a perfectly fine starting point for a discussion. Besides, you were able to provide pretty good options without needing more information.

There are definitely cases where posters need to provide more information in order to be properly helped (e.g. solving a problematic rule without providing the code), but I don’t think this is one of them. And I don’t think we should ever respond to these cases sarcastically. It just pushes people away.

Please note that this isn’t personal (I don’t think we’ve spoken before). I just think that sarcasm is one of the main problems with many communities/forums/comments on the web, and we’d all be better off with less of it.

2 Likes

I agree with you, I was in a conf-call when I posted so 1 of my 2 neurons was busy already :slight_smile:

Let’s see if I can elaborate a little better…

Is there a simple method to get crypto values from coinmarketcap or similar APIs and have them as items in OH?
As of now I am doing it via a PowerShell script that writes data to a MQTT topic and then I have the items configured through the MQTT binding but I guess that there is to be a better way to get the values in OH.
Any suggestions?

Pls and thanks!

I obtain share prices from www.alphavantage.co using their free api and use this rule below to update the different items.

import java.util.List

val List<String> stocks = newArrayList("TW", "TCG", "SLA", "RMG", "BARC", "VOD") // Each stock symbol

rule "Get share prices"
when
    Time cron "0 1/15 * ? * * *"
then
    logInfo("org.openhab","Shares: Obtaining the latest prices.")
    stocks.forEach[ stock, i |
            val csv = sendHttpGetRequest("https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=LON:"+stock+"&interval=15min&outputsize=compact&datatype=csv&apikey=MYAPIKEYGOESHERE").split("\n")
            val firstLine = csv.get(2).split(",")
            val price = firstLine.get(2).trim
            sendCommand(stock+"_Current_Price", price)
    ]
	logInfo("org.openhab","Shares: Updated completed.")
end
1 Like

You are right, and I want to apologize for my sarcasm.

1 Like