openhab / org.openhab.ui.habot

A chatbot for openHAB using machine-learning natural language processing from OpenNLP
Eclipse Public License 1.0
65 stars 31 forks source link

Question: Card Designer, how can i add a HbImage? #22

Closed michael1186 closed 6 years ago

michael1186 commented 6 years ago

How can i add a HbImage at habot's Card Designer?

hbimage

Please can you explain what that means in detail?

"Requires a sitemap and a 'imageSitemap=' property in the item's 'habot' metadata namespace"

Which item do I need in the default.items file, or do I need an own sitemap with an Image url="url"?

I have also tried the Thumbnail and FanArt item from the Kodi Binding, which were created automatically by the PaperUI. No image is displayed, only "{}".

ghys commented 6 years ago

It means you have to have in your items file something like:

String Yamaha_CoverArtUrl  "Yamaha Cover Art"  <microphone> {habot="Cover" [ imageSitemap="default" ], channel="yamahareceiver:...#playback_song_image_url"}

and and in default.sitemap:

Image item=Yamaha_CoverArtUrl

You can define a new sitemap specifically for this purpose, or use one you already have. The reason is to get the image through the proxy servlet openHAB adds for the sitemaps, not accessed directly. This is only for String items with an URL as its state, for Image items you normally don't need this, but I haven't tested if it works.