Smashing/smashing

Smashing not displaying data

gazzmanzx6 opened this issue ยท 17 comments

Describe the bug
After updating Smashing to 1.3.2 from 1.2.0 my dashboard no longer receives values from the netatmo and klimato widgets.
The widgets show in the dashboard but without any data.

To Reproduce
Steps to reproduce the behavior:

  1. Update Smashing to 1.3.2

Expected behavior
Display data from netatmo and klimato widgets.

Screenshots

  • Smashing 1.2.0
    Screenshot 2021-02-28 at 3 10 11 pm
  • Smashing 1.3.2
    Screenshot 2021-02-28 at 3 16 08 pm

Desktop:

  • OS: Raspbian Buster
  • Browser Chromium
  • Ruby and gems versions
    ruby 2.5.7p157 (2019-03-15 revision 67260) [arm-linux-gnueabihf]
    backports (3.18.2, 3.17.0)
    bigdecimal (default: 1.3.4)
    bundler (2.2.11, 2.1.4)
    cmath (default: 1.0.0)
    coffee-script (2.4.1)
    coffee-script-source (1.12.2)
    concurrent-ruby (1.1.8, 1.1.7, 1.1.6)
    csv (default: 1.0.0)
    curb (0.9.11, 0.9.10)
    daemons (1.3.1)
    date (default: 1.0.0)
    dbm (default: 1.0.0)
    did_you_mean (1.2.1)
    et-orbi (1.2.4)
    etc (default: 1.0.0)
    eventmachine (1.2.7)
    execjs (2.7.0)
    fcntl (default: 1.0.0)
    ffi (1.14.2, 1.13.1)
    fiddle (default: 1.0.0)
    fileutils (default: 1.0.2)
    fugit (1.4.2, 1.3.8)
    gdbm (default: 2.0.0)
    io-console (default: 0.4.6)
    ipaddr (default: 1.2.0)
    json (2.5.1, 2.3.1, 2.3.0, default: 2.1.0)
    minitest (5.11.3)
    multi_json (1.15.0, 1.14.1)
    mustermann (1.1.1)
    net-telnet (0.1.1)
    openssl (default: 2.1.2)
    power_assert (1.1.1)
    psych (default: 3.0.2)
    raabro (1.4.0, 1.3.1)
    rack (2.2.3, 2.0.9)
    rack-protection (2.1.0, 2.0.8.1)
    rake (12.3.1)
    rdoc (default: 6.0.1)
    ruby2_keywords (0.0.4, 0.0.2)
    rufus-scheduler (3.7.0, 3.6.0, 3.4.2)
    sass (3.4.25)
    sassc (2.4.0)
    scanf (default: 1.0.0)
    sdbm (default: 1.0.0)
    sinatra (2.1.0, 2.0.8.1)
    sinatra-contrib (2.1.0, 2.0.8.1)
    smashing (1.3.2)
    sprockets (4.0.2, 3.7.2)
    stringio (default: 0.0.1)
    strscan (default: 1.0.0)
    test-unit (3.2.8)
    thin (1.8.0, 1.7.2)
    thor (1.1.0, 1.0.1, 0.19.4)
    tilt (2.0.10)
    tzinfo (2.0.4, 2.0.2, 2.0.1)
    webrick (default: 1.4.2)
    xmlrpc (0.3.0)
    zlib (default: 1.0.0)

Notes:
Uninstalling 1.3.2 and reinstalling 1.2.0 gets it working again.

kinow commented

/cc @toy I will investigate, but my guess is some widgets are doing something different with the even stream

kinow commented

@gazzmanzx6 are you able to share a little more about your dashboard, please? If not the source code, then perhaps just confirm that you have ID's for each widget used in your dashboard? Also, anything in your browser console?

kinow commented

I found the same repo for the netatmo widget.

The weather widget is https://github.com/alexanderbecher/klimato-dashing-widget
The netatmo widget is the one you have linked to.
@kinow I'm not sure what you mean by ID's for each widget?

kinow commented

Thanks @gazzmanzx6 . Would you be able to share an example dashboard to reproduce the issue?

dashboard.zip
This is my dashboard.

kinow commented

I think the job for klimato is not sending an event with ID wunderground. Still not sure why ๐Ÿ˜•

I didn't think it used wunderground but yahoo weather?

kinow commented

@gazzmanzx6 I think I got it working.

image

To confirm I'm using the latest version, I checked the browser network tab for the /events subscription, and confirmed it's using the ids parameter.

image

In desktop.erb, the data-view of the WUnderground widget was wrong.

<!-- was -->
        <li data-row="2" data-col="1" data-sizex="1" data-sizey="1">
            <div class="background-secondary-2-0" data-id="wunderground" data-view="Wunderground" data-title="WUnderground" data-postfix=""></div>
        </li>


<!-- fixed with -->

        <li data-row="2" data-col="1" data-sizex="1" data-sizey="1">
            <div class="background-secondary-2-0" data-id="wunderground" data-view="Klimato" data-title="WUnderground" data-postfix=""></div>
        </li>

And then the job klimato.rb I added my API key and details, and also:

# was

    send_event "klimato", { location: location["city"], temperature: today["temperature"], code: today["code"], format: format,
    forecast1: forecast[1]["low"].to_s+"\u00b0 - "+forecast[1]["high"].to_s+"\u00b0", forecast1Icon: forecast[1]["code"], forecast1day: forecast[1]["day"].upcase,
    forecast2: forecast[2]["low"].to_s+"\u00b0 - "+forecast[2]["high"].to_s+"\u00b0", forecast2Icon: forecast[2]["code"], forecast2day: forecast[2]["day"].upcase}

# fixed with

    send_event "wunderground", { location: location["city"], temperature: today["temperature"], code: today["code"], format: format,
    forecast1: forecast[1]["low"].to_s+"\u00b0 - "+forecast[1]["high"].to_s+"\u00b0", forecast1Icon: forecast[1]["code"], forecast1day: forecast[1]["day"].upcase,
    forecast2: forecast[2]["low"].to_s+"\u00b0 - "+forecast[2]["high"].to_s+"\u00b0", forecast2Icon: forecast[2]["code"], forecast2day: forecast[2]["day"].upcase}

This way Smashing is able to automatically subscribe the widgets to the events, and load the widgets/views.

kinow@ranma:~/Downloads/dashboard$ gem list

*** LOCAL GEMS ***

addressable (2.7.0)
algolia_html_extractor (2.6.4)
algoliasearch (1.27.5)
backports (3.20.1, 3.18.2)
benchmark (default: 0.1.0)
bigdecimal (default: 2.0.0)
bundler (2.2.4, default: 2.1.4)
camertron-eprun (1.1.1)
cgi (default: 0.1.0)
cldr-plurals-runtime-rb (1.1.0)
coffee-script (2.4.1)
coffee-script-source (1.12.2)
colorator (1.1.0)
concurrent-ruby (1.1.8, 1.1.7)
csv (default: 3.1.2)
curb (0.9.11)
daemons (1.3.1)
date (default: 3.0.0)
dbm (default: 1.1.0)
delegate (default: 0.1.0)
did_you_mean (default: 1.4.0)
docile (1.1.5)
em-websocket (0.5.2)
et-orbi (1.2.4)
etc (default: 1.1.0)
eventmachine (1.2.7)
execjs (2.7.0)
fakeweb (1.3.0)
fcntl (default: 1.0.0)
ffi (1.14.2)
fiddle (default: 1.0.0)
filesize (0.2.0)
fileutils (default: 1.4.1)
forwardable (default: 1.3.1)
forwardable-extended (2.6.0)
fugit (1.4.2, 1.4.1)
gdbm (default: 2.1.0)
getoptlong (default: 0.1.0)
haml (5.0.4)
http_parser.rb (0.6.0)
httpclient (2.8.3)
i18n (0.9.5)
io-console (default: 0.5.6)
ipaddr (default: 1.2.2)
irb (default: 1.2.6)
jekyll (3.8.7)
jekyll-algolia (1.6.0)
jekyll-feed (0.15.1)
jekyll-last-modified-at (1.3.0)
jekyll-sass-converter (1.5.2)
jekyll-seo-tag (2.7.1)
jekyll-sitemap (1.4.0)
jekyll-watch (2.2.1)
json (2.5.1, default: 2.3.0)
kramdown (1.17.0)
liquid (4.0.3)
listen (3.4.1)
logger (default: 1.4.2)
matrix (default: 0.2.0)
mercenary (0.3.6)
metaclass (0.0.4)
mini_portile2 (2.5.0)
minima (2.5.1)
minitest (5.13.0, 5.10.3)
mocha (1.2.1)
multi_json (1.15.0)
mustermann (1.1.1)
mutex_m (default: 0.1.0)
net-pop (default: 0.1.0)
net-smtp (default: 0.1.0)
net-telnet (0.2.0)
nokogiri (1.11.1 x86_64-linux)
observer (default: 0.1.0)
open3 (default: 0.1.0)
openssl (default: 2.1.2)
ostruct (default: 0.2.0)
pathutil (0.16.2)
posix-spawn (0.3.15)
power_assert (1.1.7)
prime (default: 0.1.1)
progressbar (1.11.0)
pstore (default: 0.1.0)
psych (default: 3.1.0)
public_suffix (4.0.6)
raabro (1.4.0)
racc (1.5.2, default: 1.4.16)
rack (2.2.3, 2.2.2, 2.0.9)
rack-protection (2.1.0, 2.0.8.1)
rack-test (0.6.3)
rake (13.0.1, 12.3.3)
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
rdoc (default: 6.2.1)
readline (default: 0.0.2)
readline-ext (default: 0.1.0)
reline (default: 0.1.5)
rexml (default: 3.2.3)
rouge (3.26.0)
rss (default: 0.2.8)
ruby2_keywords (0.0.4, 0.0.2)
rufus-scheduler (3.7.0, 3.6.0, 3.4.2)
safe_yaml (1.0.5)
sass (3.7.4, 3.4.25)
sass-listen (4.0.0)
sassc (2.4.0)
sdbm (default: 1.0.0)
simplecov (0.14.1)
simplecov-html (0.10.2)
sinatra (2.1.0, 2.0.8.1)
sinatra-contrib (2.1.0, 2.0.8.1)
singleton (default: 0.1.0)
smashing (1.3.2)
sprockets (4.0.2, 3.7.2)
stringio (default: 0.1.0)
strscan (default: 1.0.3)
temple (0.8.2)
test-unit (3.3.4)
thin (1.8.0, 1.7.2)
thor (1.1.0, 1.0.1, 0.19.4)
tilt (2.0.10)
timeout (default: 0.1.0)
tracer (default: 0.1.0)
twitter_cldr (6.4.0)
tzinfo (2.0.4)
uri (default: 0.10.0)
verbal_expressions (0.1.5)
webrick (default: 1.6.0)
xmlrpc (0.3.0)
yaml (default: 0.1.0)
zlib (default: 1.1.0)

kinow commented

I didn't think it used wunderground but yahoo weather?

It's using Yahoo Weather. I created a test app/API Key.

image

But in your dashboard the data-id and data-title have WUnderground. The Widget used is Klimato. And the data from Yahoo Weather (which is closing in a few days/months I think, BTW).

The only dashboards I use are the ones named raspi.erb & raspi2.erb.
Are you saying that the fact it is wrong in an unused desktop is causing the problem?
If so, I presume I can just delete the desktop.erb file and it should all work again?

kinow commented

The only dashboards I use are the ones named raspi.erb & raspi2.erb.
Are you saying that the fact it is wrong in an unused desktop is causing the problem?

No, sorry. I just tried the first dashboard that was loaded when I started smashing with your archive. I hadn't seen other dashboards.

If so, I presume I can just delete the desktop.erb file and it should all work again?

I don't think so, just tried that to confirm and it didn't fix the issue. For some reason after I start your raspi dashboard, the /events?ids= URL did not include the Widgets' IDs. Let me see why notโ€ฆ

image

kinow commented

Ah! Tested with @toy 's #182 PR, and now the dashboard data was loaded successfully. Let me see if we can merge that PR and release a new version ๐Ÿ‘

image

kinow commented

@gazzmanzx6 let's try again :-)

Released with 3.3.0, could you try that latest version and see if that works for you, please? Should be in RubyGems in ~20 minutes or less. If it doesn't work just re-open with any console or browser logs you have.

@kinow just updated to latest version and all is working again.

Thanks for your quick efforts on this.

kinow commented

Thank you for your patience and for confirming it's working now. Kudos to @toy for fixing it so quickly ๐ŸŽ‰