UI7 - Updated D_DSCAlarmPartition2.json - state icons?

Hi

Does anyone have an updated D_DSCAlarmPartition2.json file for UI7 that shows an appropriate default icon and also changes when the alarm state is changed ? Mine currently is blank.

I donā€™t think anyone has done so, unless someone has posted it before and I havenā€™t seen it

This may involve more than just a change to the static JSON file, as the location for icons was changed in 7.30. The icons themselves may need to be moved (or reinstalled) in the new ā€œcorrectā€ location, in addition to changing the paths in the static JSON file.

@parkerc If you want to try to fix your selfā€¦ here is how I fixed the Concord 4 JSON (see post Concord 4 Fix-up Icons and Zones Page and QuickArm - Unmaintained - Ezlo Community) I just changed it to use stock images that I knew were on the Vera by default.

Download the JSON file, and look for where images are defined.
If you use stock images you donā€™t have to worry about re-directs or figuring out where things ended up with the plug in (if they are anywhere usable at all).

I used door_lock_unlocked.png for un-armed and door_lock_locked.png for Armed (stay or away), and siren_on.png for any active alarm.

If you look at the D_ConcordPartition.json for the Concord 4 (that I posted above). You can probably make similar fixes for the DSC partition JSON and get some default icons working.

Thanks

Changing the default icon on D_DSCAlarmPanel1.json seemed reasonably straightforward; and I pointed that to a locally hosted .png file.

Originallyā€¦

{
    "flashicon": "icons\/generic_sensor.swf",
    "imgIconBody": "",
    "imgIconDimmable": "",
    "imgIconTurnable": "",
    "imgIconMin": "",
    "imgIconMax": "",
    "halloIconsDir": "pics\/hallo",
    "inScene": "0",
    "DisplayStatus": {
        
    },

Changed it toā€¦

{
    "default_icon": "https://192.168.1.227:8081/vera/icons/security.png",
    "inScene": "0",
    "DisplayStatus": {
        
    },

Which resulted in thisā€¦

The D_DSCAlarmPartition2.json looked a little more complex due to its change of states, and looking at the wiki, Vera had shared an example like this below but there is so much more to the plug-in that this simplistic exampleā€¦

{
    "default_icon": "binary_light_default.png",
    "state_icons": [
        {
            "img": "binary_light_off.png",
            "conditions": [
                {
                    "service": "urn:upnp-org:serviceId:SwitchPower1",
                    "variable": "Status",
                    "operator": "==",
                    "value": 0,
                    "subcategory_num": 0
                }
            ]
        },
        {
            "img": "binary_light_on.png",
            "conditions": [
                {
                    "service": "urn:upnp-org:serviceId:SwitchPower1",
                    "variable": "Status",
                    "operator": "==",
                    "value": 1,
                    "subcategory_num": 0
                }
            ]
        }
    ],
}

If you put that png file into /www/cmh/skins/default/icons on your Vera (running 7.30 or higher), then the static JSON can refer to it as ../../../icons/security.png (yes, ugly relative path kludging), which is the new structure/setup. They broke all old plugins that didnā€™t use absolute URLs when they made this change.

The state icons are pretty easy. Each element of the array sets up the condition that has to be met to select the named icon image. The first one to match controls. If none matches, the default icon is used.

:crazy_face: keep in mind who your talking to :crazy_face::rofl::rofl:

You went right to it, despite theā€¦ ahemā€¦ quality of the documentation available! :slight_smile: You should have no problem with the state icons. Itā€™s really just these steps: (1) find all the icons; (2) upload (or move) them to /www/cmh/skins/default/icons/; (3) modify all of the pathnames in the JSON file to the new ../../../icons/ form. Reload Luup, hard refresh, Bobā€™s your uncle.

if you do manage to figure out the icons would you mind sharing the files :slight_smile:

Quick question, can I use an image already on the Vera

/cmh/skins/default/img/other/prestMonitoring.png  

Would that simply translate to this in the .json

 "default_icon": "/cmh/skins/default/img/other/prestMonitoring.png"

Unfortunately noā€¦ they really botched up the path handling on the JavaScript side.

If you start with ../../../ in the URL, that gets you to the physical directory /www/cmh/skins/default/, and from there you can navigate back down. So to get to:

/www/cmh/skins/default/img/other/prestMonitoring.png

the URL should be

../../../img/other/prestMonitoring.png

ā€¦ā€œshould beā€ā€¦

Ok, great, thanks @rigpapa that works, as I kinda-like this particular image/iconā€¦

1 Like

To move on and consider how to update the .json file for one of this DSC plug-in tiles, if I wanted to create some sort of visual representation for the ā€˜statesā€™ of these 3 manual variables (just as an exampleā€¦

Which would have the two options eachā€¦

"urn:micasaverde-com:serviceId:DSCAlarmPanel1","EnableRemoteArm"   value = "true" or "false"
"urn:micasaverde-com:serviceId:DSCAlarmPanel1","EnableRemotePanic"   value = "true" or "false"
"urn:micasaverde-com:serviceId:DSCAlarmPanel1","EnableManualLabels"   value = "true" or "false"

Which I be right in saying the .json part would need to be updated to something like this.

"state_icons": [
    {
        "img": "binary_light_off.png",
        "conditions": [
            {
                "service": "urn:micasaverde-com:serviceId:DSCAlarmPanel1",
                "variable": "EnableRemoteArm",
                "operator": "==",
                "value": false,
                "subcategory_num": 0
            }
        ]
    },

You probably will need to quote the value (e.g. "false" not false), but otherwise seems about right (assuming the service ID is correct as well).

Just to confuse matters, looking at the Vera mobile app, it has its own icons assigned ?

Does the mobile app do things differently?

The display on the mobile apps has very little to do with the static JSON. Thatā€™s long been a sore point of mine.

Hi Rigpapa.

I also have a dsc plugin, all functions work well.

As for the problem, the dsc alarm panel and partition ā€œdevicesā€ unfortunately have no icons.
I tried to find the icons in vera root with Winscp, but unfortunately I couldnā€™t find any psc related to dsc. Where can I find these pngs so I can copy them?
Thanks for the help.
Krisztian

Iā€™m not the maintainer of that plugin, and I donā€™t have a DSC system, so I canā€™t really dive any deeper than the general information I gave @parkerc. Perhaps he can chime in with a fixed JSON file?

or @Krisztian_Szabo if you want to post the JSON file here, I can probably fix it up with default icons like I did for the Concord4 plug in, instead of trying to find/re-use specialize DSC images. Instead I just re-used items I knew would be on the Vera (like door locks, and siren images instead).

Hi, unfortunately I canā€™t upload any .json files, but I can paste the code in, but as you can see from the thread above, I played around with mine to make the icon appear, so it might not be wise to share thatā€¦

Thankfully I believe I still have copies of the original files (the DSC plugin has two tiles) - Iā€™ll post them separately below due to their sizeā€¦