Yes, i think you’re right, i love how coding this sort of thing make me have to think differently 🙂
I’ve also started to add a multi_state_button too, but classic vera UI, I just can’t get it positioned where I want it too go..
83123BB1-1401-4B29-B034-9B921793BDA2.jpeg
I really want the on/off toggle button to be in line with the “Output 1” wording, and the right chevron “>”
Worse case I revert to a standard button, current .json is pasted below., if anyone can find out how to lift it up a level/row..
{
"default_icon": "../../../icons/tv_100.png",
"state_icons":[],
"x": "2",
"y": "3",
"inScene": "1",
"ToggleButton": 1,
"Tabs": [
{
"Label": {
"lang_tag": "tabname_control",
"text": "Control"
},
"Position": "0",
"TabType": "flash",
"top_navigation_tab": 1,
"ControlGroup": [
{
"id": "1",
"scenegroup": "1",
"isSingle": "1"
},
{
"id": "2",
"scenegroup": "1",
"isSingle": "1"
}
],
"SceneGroup": [
{
"id": "1",
"top": "2",
"left": "0",
"x": "2",
"y": "1"
}
],
"Control": [
{
"ControlGroup": "1",
"ControlType": "button",
"top": "0",
"left": "0",
"Label": {
"lang_tag": "Input1",
"text": "Input1"
},
"Display": {
"Service": "urn:nodecentral-net:serviceId:SYMatrix1",
"Variable": "Pressed1",
"Value": "1",
"Top": 60,
"Left": 50,
"Width": 75,
"Height": 20
},
"Command": {
"Service": "urn:nodecentral-net:serviceId:SYMatrix1",
"Action": "SYCall",
"Parameters": [
{
"Name": "action",
"Value": "I1"
}
]
}
},
{
"ControlGroup": "1",
"ControlType": "button",
"top": "0",
"left": "1",
"Label": {
"lang_tag": "Input2",
"text": "Input2"
},
"Display": {
"Service": "urn:nodecentral-net:serviceId:SYMatrix1",
"Variable": "Pressed2",
"Value": "1",
"Top": 60,
"Left": 150,
"Width": 75,
"Height": 20
},
"Command": {
"Service": "urn:nodecentral-net:serviceId:SYMatrix1",
"Action": "SYCall",
"Parameters": [
{
"Name": "action",
"Value": "I2"
}
]
}
},
{
"ControlGroup": "2",
"ControlType": "button",
"top": "0",
"left": "1",
"Label": {
"lang_tag": "Input3",
"text": "Input3"
},
"Display": {
"Service": "urn:nodecentral-net:serviceId:SYMatrix1",
"Variable": "Pressed3",
"Value": "1",
"Top": 60,
"Left": 250,
"Width": 75,
"Height": 20
},
"Command": {
"Service": "urn:nodecentral-net:serviceId:SYMatrix1",
"Action": "SYCall",
"Parameters": [
{
"Name": "action",
"Value": "I3"
}
]
}
},
{
"ControlGroup": "2",
"ControlType": "button",
"top": "0",
"left": "1",
"Label": {
"lang_tag": "Input4",
"text": "Input4"
},
"Display": {
"Service": "urn:nodecentral-net:serviceId:SYMatrix1",
"Variable": "Pressed4",
"Value": "1",
"Top": 60,
"Left": 350,
"Width": 75,
"Height": 20
},
"Command": {
"Service": "urn:nodecentral-net:serviceId:SYMatrix1",
"Action": "SYCall",
"Parameters": [
{
"Name": "action",
"Value": "I4"
}
]
}
},
{
"ControlGroup": "2",
"ControlType": "multi_state_button",
"top": "0",
"left": "1",
"Display": {
"Top": 0,
"Left": 450
},
"states":[
{
"Label": {
"lang_tag": "ui7_cmd_on",
"text": "On"
},
"ControlGroup": "2",
"Display": {
"Service": "urn:upnp-org:serviceId:SwitchPower1",
"Variable": "Status",
"Value": "1"
},
"Command": {
"Service": "urn:upnp-org:serviceId:SwitchPower1",
"Action": "SetTarget",
"Parameters": [
{
"Name": "newTargetValue",
"Value": "1"
}
]
},
"ControlCode": "power_on"
},
{
"Label": {
"lang_tag": "ui7_cmd_off",
"text": "Off"
},
"ControlGroup": "2",
"Display": {
"Service": "urn:upnp-org:serviceId:SwitchPower1",
"Variable": "Status",
"Value": "0"
},
"Command": {
"Service": "urn:upnp-org:serviceId:SwitchPower1",
"Action": "SetTarget",
"Parameters": [
{
"Name": "newTargetValue",
"Value": "0"
}
]
},
"ControlCode": "power_off"
}
]
}
]
},
{
"Label": {
"lang_tag": "settings",
"text": "Settings"
},
"Position": "1",
"TabType": "javascript",
"ScriptName": "shared.js",
"Function": "simple_device"
},
{
"Label": {
"lang_tag": "advanced",
"text": "Advanced"
},
"Position": "2",
"TabType": "javascript",
"ScriptName": "shared.js",
"Function": "advanced_device"
},
{
"Label": {
"lang_tag": "notifications",
"text": "Notifications"
},
"Position": "3",
"TabType": "javascript",
"ScriptName": "shared.js",
"Function": "device_notifications"
}
],
"sceneList": {
"group_1": {
"cmd_1": {
"label": "ON",
"serviceId": "urn:upnp-org:serviceId:SwitchPower1",
"action": "SetTarget",
"arguments": {
"newTargetValue": "1"
},
"display": {
"service": "urn:upnp-org:serviceId:SwitchPower1",
"variable": "Status",
"value": "1"
}
},
"cmd_2": {
"label": "OFF",
"serviceId": "urn:upnp-org:serviceId:SwitchPower1",
"action": "SetTarget",
"arguments": {
"newTargetValue": "0"
},
"display": {
"service": "urn:upnp-org:serviceId:SwitchPower1",
"variable": "Status",
"value": "0"
}
}
}
},
"eventList2": [
{
"id": 1,
"label": {
"lang_tag": "ui7_a_device_is_turned_on_off",
"text": "A device is turned on or off"
},
"serviceId": "urn:upnp-org:serviceId:SwitchPower1",
"argumentList": [
{
"id": 1,
"dataType": "boolean",
"defaultValue": "1",
"allowedValueList": [
{
"Off": "0",
"HumanFriendlyText": {
"lang_tag": "ui7_hft_device_turned_off",
"text": "Whenever the _DEVICE_NAME_ is turned off"
}
},
{
"On": "1",
"HumanFriendlyText": {
"lang_tag": "ui7_hft_device_turned_on",
"text": "Whenever the _DEVICE_NAME_ is turned on"
}
}
],
"name": "Status",
"comparisson": "=",
"prefix": {
"lang_tag": "ui7_which_mode",
"text": "Which mode"
},
"suffix": {}
}
]
}
],
"DeviceType": "urn:nodecentral-net:device:SYMatrix:1",
"device_type": "urn:nodecentral-net:device:SYMatrix:1"
}
I managed to get it looking roughly right on the Control Tab, see below.. but this positioning is not reflected on the main UI (see image above)
23387124-EF0B-45D0-BD15-68DD3D9F772F.jpeg