We have moved at community.getvera.com

Author Topic: [UI7] change or use different icons  (Read 11583 times)

Offline VeraEdger

  • Full Member
  • ***
  • Posts: 113
  • Karma: +1/-0
[UI7] change or use different icons
« on: August 03, 2015, 04:17:52 pm »
I would like to know if it possible (and how) to change the icons which are used in the GUI of UI7.
I have a fibaro double relay switch, which is the default bulp (lamp) in UI7. As I use it to switch my central ventilation,
I would like to use am image of a fan instead of the default lamp. And of course it must show the status....

Offline rafale77

  • Community Beta
  • Hero Member
  • ******
  • Posts: 1749
  • Karma: +101/-27
  • HA ≠ IoT as a blue sky is cloudless.
Re: [UI7] change or use different icons
« Reply #1 on: August 04, 2015, 05:02:51 am »
Yes it is possible.

In order to do this you will have to edit the json files.
After some frustrations with UI7 I found that it was easier to host the create and host the icons on a website and call them out using an url rather than putting them on the vera itself.

The UI7 is actually pretty simplistic when it comes to handling icons.

Look at the UI7 section in this wiki http://wiki.micasaverde.com/index.php/Luup_plugin_icons

As an example i can share, I created some subcategories of on/off light switches which are controlling irrigations amongst other things and gave them different on-off icons by adding the following code. This enabled me not to change the icon of the other devices using other subcategories.

Code: [Select]
        {
            "img": "http://anhman.neocities.org/sprinkler_off.png",
            "conditions": [
                {
                    "service": "urn:upnp-org:serviceId:SwitchPower1",
                    "variable": "Status",
                    "operator": "==",
                    "value": 0,
                    "subcategory_num": 6
                }
            ]
        },
        {
            "img": "http://anhman.neocities.org/sprinkler_on.png",
            "conditions": [
                {
                    "service": "urn:upnp-org:serviceId:SwitchPower1",
                    "variable": "Status",
                    "operator": "==",
                    "value": 1,
                    "subcategory_num": 6
                }
            ]

openLuup (79 devices, 141 scenes, 19 apps) master to VeraPlus (142 zwave nodes, 8 Zigbee nodes, 221 devices,  20 scenes , 2 apps) +  Hubitat (15 Zigbee nodes) + Home-Assistant (API Integrations). Bridged to Siri and Alexa. Homewave. VeraPlus ExtRooted and mios server independent.

Offline VeraEdger

  • Full Member
  • ***
  • Posts: 113
  • Karma: +1/-0
Re: [UI7] change or use different icons
« Reply #2 on: August 04, 2015, 05:10:56 am »
Great. Thank you very much. Will play with it.

Offline VeraEdger

  • Full Member
  • ***
  • Posts: 113
  • Karma: +1/-0
Re: [UI7] change or use different icons
« Reply #3 on: August 04, 2015, 05:15:38 am »
Uhm how should the file being edited? Via ssh? (which is no problem for me) or can it be done via web UI?

Edit:
Could you please help me a bit how to start? I read the wiki and when I go to the device I want to change I see the device XML:

device_file     D_BinaryLight1.xml

I think it's me, but I can't find that file.....

But.. it is also used for all my other switches..... :-(

So after finding it, I should add a line like this:
  <?xml version="1.0"?>
  <root xmlns="urn:schemas-upnp-org:device-1-0">
    <specVersion><!-- ... --></specVersion>
    <device>
      <deviceType>urn:schemas-futzle-com:device:holidayvirtualswitch:1</deviceType>
      <staticJson>D_HolidayVirtualSwitch1.json</staticJson>
      <!-- ... -->

Where to place the static json file?

Thanks.
« Last Edit: August 04, 2015, 05:49:47 am by VeraEdger »

Offline konradwalsh

  • Hero Member
  • *****
  • Posts: 566
  • Karma: +19/-6
Re: [UI7] change or use different icons
« Reply #4 on: August 04, 2015, 05:33:28 am »
Hi

You want to edit the file from its original over SSH..

Bear in mind that MIOS will overwrite the file on reboot.. so its kind of pointless...

Offline rafale77

  • Community Beta
  • Hero Member
  • ******
  • Posts: 1749
  • Karma: +101/-27
  • HA ≠ IoT as a blue sky is cloudless.
Re: [UI7] change or use different icons
« Reply #5 on: August 04, 2015, 10:09:08 am »
You are looking at the wrong file:

What you want to edit is the D_BinaryLight.json. It seemed obvious from the wiki.

And no the file does not get overwritten upon reboot. It does not even get overwritten upon firmware upgrades/downgrades as it is considered an app file.

The way to edit it is to go under apps, and look at the luup files. download it to your computer, edit it and upload it back.
openLuup (79 devices, 141 scenes, 19 apps) master to VeraPlus (142 zwave nodes, 8 Zigbee nodes, 221 devices,  20 scenes , 2 apps) +  Hubitat (15 Zigbee nodes) + Home-Assistant (API Integrations). Bridged to Siri and Alexa. Homewave. VeraPlus ExtRooted and mios server independent.

Offline VeraEdger

  • Full Member
  • ***
  • Posts: 113
  • Karma: +1/-0
Re: [UI7] change or use different icons
« Reply #6 on: August 04, 2015, 10:19:30 am »
Great. Thank you very much. I found the file.

And you are right, the xml points to the static file: D_BinaryLight.json

So here I have to configure the subs like you. Going to do that. Thanks

Edit:
YES. Got it working.

For the ones who want to try this too and use the code above, add the following at the end of it:

},

« Last Edit: August 04, 2015, 10:47:08 am by VeraEdger »