Mirror temperature sensor to virtual device

You can use my.smartthings advanced rules.

Instructions are here:

Add only action when you add rule using my.smartthings advanced rules

Change your Device IDs to json and paste json

        {
            "every": {
                "interval": {
                    "value": {
                        "integer": 5
                    },
                    "unit": "Minute"
                  },
			  "actions": [
						 {
						"command": {
						  "devices": [
							"757d033d-0168-4934-b6c8-d270893b08ad"
						  ],
						  "commands": [
							{
							  "component": "main",
							  "capability": "partyvoice23922.vtempset",
							  "command": "setvTemp",
							  "arguments": [
								{
								  "device": {
									"devices": [
									  "b64a38a7-907d-406a-90f8-c8cf7a0eae86"
									],
									"component": "main",
									"capability": "temperatureMeasurement",
									"attribute": "temperature"
								  }
								}
							  ]
							}
						  ]
						}
					  }
					]
	         }
	     }
1 Like

thanks how do I enable the new rule, as it is in not active status after the creation and I cannot turn active

I do not know. All my rules are enabled and not possible to disable.

my_smartthings_com-advanced Rules Rules API  Rule Enabled

1 Like

Hello all. I have a little problem of my own, although I have managed to create a virtual temperature sensor which does update fine in the beginning, after a couple of days it stops updating the correct temperature. The virtual sensors were created with Vedge and the rules were created through TAustin API. Thank you very much for your time.

Reboot your hub using SmartThings Advanced Web App.

The mirroring should start working.

Thanks for your code, I change only the fields you said, but getting this error “422 The request is malformed. name: Unrecognized field “name” (class v20190122.internal.st.behaviors.Action), not marked as ignorable” ? I used Notepad++ and save file as JSON, and use vEdge Creator to create virtual temp.

Are you creating the Rule using the Advanced Web App? That expects you to only paste in the JSON for the content of the actions array (keeping the supplied []).

So you don’t want the opening:

{
  "name": "There is a separate field for this",
  "actions": 

You also don’t want anything after the closing ] of the actions array. Which unfortunately means you can’t specify the sequence if you have multiple actions.

Yes I created rule by Advance Web App:

{
“name”: “Virtual Temperature update every 5 minutes”,
“actions”: [
{
“every”: {
“interval”: {
“value”: {
“integer”: 5
},
“unit”: “Minute”
},
“actions”: [
{
“command”: {
“devices”: [
“88d76e73-5a5b-4827-8506-15822dc5d213”
],
“commands”: [
{
“component”: “main”,
“capability”: “partyvoice23922.vtempset”,
“command”: “setvTemp”,
“arguments”: [
{
“device”: {
“devices”: [
“bf4606cd-6a80-40fa-bc04-493c247f6737”
],
“component”: “main”,
“capability”: “temperatureMeasurement”,
“attribute”: “temperature”
}
}
]
}
]
}
}
]
}
}
]
}

The code are inside [ ]

The AWA doesn’t want you to paste in the whole Rule. It just wants the value for actions.

So in your case you to remove the first:

{
  "name”: “Virtual Temperature update every 5 minutes",
  "actions":

You should keep the [ that comes after "actions":.

You also want to remove the last:

}

That will leave you with something starting with [ and ending with ]. That is what they want.

I don’t know why they ask for the Rule in the way they do. It would be easier, and more useful, to just let you paste in a whole valid Rule.

1 Like

Compare your JSON with the one from here:

See the difference?

You have to remove the the first (3) and last lines. @orangebucket explained it twice.

1 Like

I just start to use smartthing, so everything is learning.

Sorry for the newbie
Finally It works. Thanks for your help

2 Likes

You have to thank @orangebucket , not me.

:+1:Big thanks to @orangebucket