Matrix Theme for HABPanel

That’s a really good idea. When I have some extra time, I’ll definitely do that.

One question – my main concern about the HabPanel gridster system is that it doesn’t support response design. I want to access my panels from desktop, tablet and phone and I want it to look great on all. Do you know if there is a way to make that work with HabPanel widgets?

That would be a question for @ysc I believe.

Gridster has some options for that: mobileModeEnabled / mobileBreakPoint which basically merge all columns into one if the width is less than the breakpoint, but I found them to be problematic (random spaces between widgets) so I’ve left it disabled.

I now realize they could be added as “experimental” options in the dashboard settings dialog however, with no guarantees of giving good results - there are already a bunch of those - number of columns, spacing between widgets, font scaling etc.

I’ll keep it in mind.

Cool, I’ll be happy to play and test them out when ready.

What about dynamic height of the widgets? It would be important for the height be adjustable automatically based on content.

Thanks! :slight_smile:

I get an error:
$ /usr/bin/python /etc/openhab2/scripts/spotify.py
Successfully got state from OpenHab: spotify_client_id
Successfully got state from OpenHab: spotify_client_secret
Successfully got state from OpenHab: spotify_access_token
Successfully got state from OpenHab: spotify_refresh_token
Successfully got state from OpenHab: spotify_token_issued
Successfully got state from OpenHab: spotify_token_expiry
– Calling Token Refresh Service
Successfully got state from OpenHab: spotify_auth_code
– Calling Token Service for the first time
– Calling Service: Update
{
“error”: {
“status”: 401,
“message”: “Invalid access token”
}
}
-> Item node missing from response :frowning:

I didn’t know how to do check the check this point, maybe it has something to do with this:

Check that the spotify_auth_code is set in OpenHab?

Looks like it can’t get the token for the first time. I added some error handling to spotify.py. Can you get the latest version and try again?

I made it work, thanks:

First I got;

$ /usr/bin/python /etc/openhab2/scripts/spot                                                      ify.py
Successfully got state from OpenHab: spotify_client_id
Successfully got state from OpenHab: spotify_client_secret
Successfully got state from OpenHab: spotify_access_token
Successfully got state from OpenHab: spotify_refresh_token
Successfully got state from OpenHab: spotify_token_issued
Successfully got state from OpenHab: spotify_token_expiry
-- Calling Token Refresh Service
 -> Error refreshing token:{u'error_description': u'Invalid client secret', u'er                                                      ror': u'invalid_client'}
Successfully got state from OpenHab: spotify_auth_code
-- Calling Token Service for the first time
 -> Error getting token:{u'error_description': u'Invalid client secret', u'error                                                      ': u'invalid_client'}
-- Calling Service: Update
{
  "error": {
    "status": 401,
    "message": "Invalid access token"
  }
}
 -> Item node missing from response :(
Successfully posted state to OpenHab: spotify_lastConnectionDateTime = 2017-07-1         

Then I updated the client id and secret, and then it worked :smiley:

Done:

Actually when in mobile mode, the widgets don’t have a height fixed by the grid anymore - this was one of my gripes with this mode but it’s a good thing in your case.

Demo: http://imgur.com/QqY0Fz2

1 Like

Cool, thanks!

I’v got some errors when testing spotify.py :

pi@openhab:~ $ /usr/bin/python3 /etc/openhab2/scripts/spotify.py
Successfully got state from OpenHab: spotify_client_id
Successfully got state from OpenHab: spotify_client_secret
Successfully got state from OpenHab: spotify_access_token
Successfully got state from OpenHab: spotify_refresh_token
Successfully got state from OpenHab: spotify_token_issued
Successfully got state from OpenHab: spotify_token_expiry
– Calling Token Refresh Service
-> Error refreshing token:{‘error_description’: ‘Invalid client’, ‘error’: ‘invalid_client’}
Successfully got state from OpenHab: spotify_auth_code
– Calling Token Service for the first time
-> Error getting token:{‘error_description’: ‘Invalid client’, ‘error’: ‘invalid_client’}
– Calling Service: Update
-> Failure: <class ‘TypeError’>
OpenHab: Error posting state:name ‘basestring’ is not defined
Done in 1.2674803733825684 seconds

Any ideas ?

I see a lot of invalid_client errors, so I would try to repeat these steps, but I think @pmpkk is the one to ask. :slight_smile:

Yep, looks like the client id is not set or valid. Did you follow the instructions in here?

Excellent work ! Awesome !!!
Juste some questions :
I can’t add transparent graph from grafana.
Can I do that ? Your screen shows some graphs with transparent background (battery history for example).

Thanks

Hi Patrick
I trying to get the use you lib. to skip a track foreward in a rule? Do you by any chance have an example on how you implemented this?

hey there,

i´m still trying to embed the icons from www.materialdesignicons.com but still can´t get it work.

I have the following icon:

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M17,17A5,5 0 0,1 12,22A5,5 0 0,1 7,17C7,15.36 7.79,13.91 9,13V5A3,3 0 0,1 12,2A3,3 0 0,1 15,5V13C16.21,13.91 17,15.36 17,17M11,8V14.17C9.83,14.58 9,15.69 9,17A3,3 0 0,0 12,20A3,3 0 0,0 15,17C15,15.69 14.17,14.58 13,14.17V8H11Z" /></svg>

i now tried to use the file squidink.svg and insert the id thermometer-3:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
         viewBox="0 0 48 48" enable-background="new 0 0 48 48" xml:space="preserve">

<symbol id="thermomether-3">
    <g>

    <path d="M17,17A5,5 0 0,1 12,22A5,5 0 0,1 7,17C7,15.36 7.79,13.91 9,13V5A3,3 0 0,1 12,2A3,3 0 0,1 15,5V13C16.21,13.91 17,15.36 17,17M11,8V14.17C9.83,14.58 9,15.69 9,17A3,3 0 0,0 12,20A3,3 0$
    </path>




    </g>
</symbol>



</svg>

but the icon does not appera - any hints whats going wrong?

It doesn’t work for me. In advanced option, I chek the allow mobile modeand fill valuebut after clik on red gear and going back to options, mobile mode is unchecked.

Works here… anything in the Javascript console? Can anyone else confirm?

Excellent work! I really like it :grinning:
Juste a short question: Where can i find the python script svg_combiner.py?

Thanks in advance
rainer

Just one more newbie question.
How do I set the client ID received from spotify?
Save the Client ID to spotify_client_id in OpenHab (e.g. through openhab CLI smarthome:update spotify_client_id {your_id})

How to access the CLI from BASH?