Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

Get icon image


Manuel Blanco

Question

Hello, I am developing my own Dashboard in net core.
My problem is that I don't know how to get the image of a room.
That is, where do I get the image that is associated with the room, I have not seen any service that returns the image of an icon.

I await your response.
Greetings

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

If you get the room struct with the api you get the icon name and extension,

ex.

Please login or register to see this code.

and then you have the icon at 

http://<HC3_IP>/assets/icon/fibaro/rooms/<icon>.<iconExtension>

Link to comment
Share on other sites

  • 0

Dear @jgab, I have just coded a QA to get the link for user icon but need your help to finish it;  it help you to scroll all your device list to get information like: "name", "id", "deviceIcon", "icon{"path","source"}" when existing and it looks like:

Please login or register to see this image.

/monthly_2024_06/image.png.e110a690bf13a3497277b909a2aaff97.png" />

note: the select button is only used to change color/text of the title.

 

To view the icon's image I need to copy "Label3" and paste it in my web browser

1)  I want to make the Label3 text as a direct link which means when you click it to go directly to the image, e.i. 

Please login or register to see this link.

  : is this possible?

2) The best will be to have the icon displayed above the title but all my trials until know fail.

 

When there is no path but still an icon id, I will change the QA icon by this ID which is OK on PC view and the new version 2.xx of the YUBII application🙂 but not on the old YUBII application☹️.

 

vs code "GetIconsFromHCE.lua" attached

Please login or register to see this attachment.

Edited by Christb
attached lua file
Link to comment
Share on other sites

  • 0

You want to display the image?

Like

Please login or register to see this code.

?
  • Thanks 1
Link to comment
Share on other sites

  • 0
39 minutes ago, Christb said:

Yes, I will test it now

Unfotunately, I have not the expected result as the "Alt Image" label is now replaced by an image symbol as balow but the icon is not displayed 

Please login or register to see this image.

/monthly_2024_06/image.png.6211d5dfa9c4ccd5a84d00d0acb87958.png" />

but if I am using the full link, yes it is working🙂

image.png.7ca8690c7d588dcd9a07d358f0b6a28d.png

 

The code is: local im = '<img src='..'"https://hc3-00006080'..path..'">'     

 

I need now to find a way to display the image of the icon when "deviceIcon" exists but has no "properties.icon[path]"

 

Do you know where are they located in HC3?

 

NEW: There is also for each device "type" for Fibaro made modules, a "source "and an" iconSet" id which normally is given by the REST API GET /icons  giving a table like this:

     {
    "type": "com.fibaro.FGCD001",
    "source": "HC",
    "iconSet": 118,
    "files": [     {
        "path": "assets/icon/fibaro/com.fibaro.FGCD001/com.fibaro.FGCD001-healthy.png"
      },
      {
        "path": "assets/icon/fibaro/com.fibaro.FGCD001/com.fibaro.FGCD001-moderate.png"
      },
      {
        "path": "assets/icon/fibaro/com.fibaro.FGCD001/com.fibaro.FGCD001-alarm.png"
      }
    ]  -- this is where icon path and for some type "condition" following a given event comming from the device

 

I will now work on getting these icons.

 

In fact getting all icons loaded in a HC3 is really tricky😁:  I am getting these icon paths in scanning my devices and when a icon is defined by "onoff/onoff0.png" then it exists the "on" icon:"onoff/onoff100.png"  suffix 0 "off", 100 "on"

But is it not so simple as for a shutter : shutter0.png = "close", shutter50.png = "alfway", shutter100.png="open"...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...