Trigger in JSON files?

There are several JSON files included with the standard Vera firmware distribution that contain a ‘conditions’: element. I’m am NOT referring to conditions for controlling which icon to display. The conditions I’m interested in follow the ‘control’: element. Here is an example:

  	"Conditions": [
            {
                "Trigger": {
                    "Operands": [
                        {
                            "Service": "urn:upnp-org:serviceId:HVAC_UserOperatingMode1",
                            "Variable": "ModeStatus",
                            "Value": {
                                "Equals": "Off"
                            }
                        }
                    ]
                },
                "Action": "disable",
                "Target": "thermo_set_heat"
            },

I don’t suppose that the functionality of these type of conditions is described anywhere in the wiki? Does anyone know what the possible values are for the Operands, Actions, and Target elements?

I’ve used these just a little. I’ve only used Action values “enable” and “disable” (and you need to supply both if you intend to supply either–it’s apparently supposed to restore their state but I’ve found that to be buggy/inconsistent, at least in older firmware, I haven’t tried just “disable” alone with newer to see if now restores correctly). The Target is the value from the ControlCode of a control in the Control section of the static JSON file. This basically lets you enable or disable a control based on the value of a state variable.

This is from D_DimmableLight1.json… not sure what this does, but seems like when you set the load slider between 1 and 100, it activates the “power_on” control… but that seems redundant, as I believe Luup does this internally

{
                    "Trigger": {
                        "Operands": [
                            {
                                "Service": "urn:upnp-org:serviceId:Dimming1",
                                "Variable": "LoadLevelStatus",
                                "Value": {
                                    "Min": "1",
                                    "Max": "100"
                                }
                            }
                        ]
                    },
                    "Actions": [
                        {
                            "Action": "set_value",
                            "ActionArgument": "100",
                            "Target": "power_on"
                        }
                    ]
                }

Note also here that the “Value” under “Operands” lets you provide a range.

1 Like

Best Home Automation shopping experience. Shop at getvera!

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