Sorry, I forgot a screenshot
Read the statement by Michael Teeuw here.
Posts made by Tippon
-
MMM-Cryptocurrency
I’ve got MMM-Cryptocurrency up and running, but I want to display my current portfolio value too. Someone else has requested it as an option in the past, and there has been a solution posted.
I’m having a problem with arcangeloerrico’s wallet code from the issue listed here:
I’ve copied the code they posted for McNose, and it seems to be mostly working, but the wallet value is wrong, and it’s not consistent.
ETH is currently priced at £1,400 and Doge is currently £0.039. If I put 10 ETH and 10 Doge into the wallet section of config.js, my ETH shows as £14.00 and Doge shows as £390.00.
The first two coins I list are valued at 100 times lower than they should be, the next three are 100 times higher, the sixth coin is correct, then the next two are 100 times higher again. I can’t see any obvious reason for this.
I’ve put the edited code below, with my details removed.
I’d be very grateful if anyone could help me please :)
config.js
{ module: 'MMM-cryptocurrency', disabled: false, position: 'bottom_bar', config: { apikey: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', currency: [ 'bitcoin', 'ethereum', 'stellar', 'dogecoin', 'algorand', 'litecoin', 'cardano', ], conversion: 'GBP', maximumFractionDigits: 3, headers: [ 'change24h', 'change1h', 'change7d' ], displayType: 'details', wallet: [0.14,10.0,150.951,10.0,2.22,0.057,1.234], showGraphs: true } },
MMM-Cryptocurrency.js Line 3 - 18
defaults: { currency: ['bitcoin'], conversion: 'USD', displayLongNames: false, headers: [], displayType: 'detail', showGraphs: false, logoHeaderText: 'Crypto currency', significantDigits: [2,4], minimumFractionDigits: 2, maximumFractionDigits: 5, coloredLogos: true, fontSize: 'xx-large', limit: '100', apiDelay: 300000, },
MMM-Cryptocurrency.js Line 168 - 173
var tableHeaderValues = [ this.translate('CURRENCY'), this.translate('PRICE'), ('Portfolio'), ('Asset') ]
MMM-Cryptocurrency.js Line 200 - 209
var myPrice=currentCurrency.price.replace("£",""); var myPrice=myPrice.replace(".", "").replace(",", "."); var myWallet=(this.config.wallet[i]).toFixed(4); var myValue='£' + (this.config.wallet[i]*myPrice).toFixed(2); var tdValues = [ name, currentCurrency.price, myWallet, myValue ]
MMM-Cryptocurrency.js Line 427 - 434
var cPrice = apiResult[j].price.replace("£", ""); var cPrice = cPrice.replace(".", "").replace(",", "."); var myWallet = (this.config.wallet[j] * cPrice || 0).toFixed(2); var priceWrapper = document.createElement('td') var price = document.createElement('price') price.style.fontSize = this.config.fontSize price.innerHTML = cPrice + '£ x ' + this.config.wallet[j] + ' = ' + myWallet + '£'; price.innerHTML = apiResult[j].price.replace("GBP", "£")
-
Location and temp problems with Weather
Hi all :)
I’ve just got everything set up in a virtual machine while I wait for my hardware to arrive, and I’m having some problems with the updated weather module.
I’ve got it running, and it looks good. I’ve got two copies, one displaying the current weather and one for the hourly forecast, and they’ve got the location above the modules. The problem is, the weather doesn’t match with the Open Weather Map website (showing approx 5c and cloudy, but 1c and clear on the website), and the location is displaying the latitude and longitude rather than the town name. My phone’s weather app uses Open Weather Map too, and it’s matching the site.
As far as I can see, everything is set up properly, including the /onecall endpoint for the hourly weather. The changes below are in weather.js with the two entries at the bottom in config.js
Can someone tell me what I’m missing please?
(P.S. I’m happy with the location being public, as it’s for the nearest town and doesn’t identify me)
weatherProvider: "openweathermap", roundTemp: false, type: "hourly", // current, forecast, daily (equivalent to forecast), hourly (only with OpenWeatherMap /onecall endpoint) lat: 51.7162, lon: 3.4518, location: 'Aberdare,GB', locationID: 2657835,
{ module: "weather", position: "top_right", config: { // See 'Configuration options' for more information. type: 'current' } }, { module: "weather", position: "top_right", config: { // See 'Configuration options' for more information. type: 'hourly' } },