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) 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…

Best Home Automation shopping experience. Shop at getvera!

© 2020 Vera Control Ltd., All Rights Reserved. Terms of Use | Privacy Policy | Forum Rules