Hello,
I have upgrade UI5 to UI7 but we unable to create scene automation
Before I have UI5 account then I upgrade to UI7
Create scene worked perfect with ui5. I am using same data format to request for a UI7 unit.
I am sending the json string as a POST parameter because the string is very long.
Every thing is worked fine with UI5. But dont know what is the issue with UI7.
Following are the details for your reference
URL :
https://vera-us-oem-relay41.mios.com/relay/relay/relay/device/35011801/session/0DD42F5FCF72EA43B0BE822C45A3A28E3B2608/port_3480/data_request?id=scene&action=createPOST data
{"scene_name":"if master bed is off then 2 thrmostat is heat on","name":"if master bed is off then 2 thrmostat is heat on","groups":[{"delay":0,"actions":[{"device":"11","service":"urn:upnp-org:serviceId:HVAC_UserOperatingMode1","action":"SetModeTarget","arguments":[{"name":"NewModeTarget","value":"HeatOn"}]}]}],"triggers":[{"name":"testing tiggers","enabled":1,"device":"9","template":"1","arguments":[{"id":1,"value":"Off"}]}],"timers":[],"lua":""}
we post data using curl with MMSSession token
$ch = curl_init ($url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("MMSSession:$sessionToken"));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_BINARYTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT, 60); //timeout in seconds
if($aPostData != null)
{
$fields_string = '';
foreach($aPostData as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
$fields_string = rtrim($fields_string, '&');
curl_setopt($ch,CURLOPT_POST, count($aPostData));
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
//print_r(count($aPostData));
//print_r($aPostData);
}
$result = curl_exec($ch);
if i am print this $result varible then it's show 'ERROR'
Please advice
Thanks