开关拓展命令
<p>[TOC]</p>
<table>
<thead>
<tr>
<th>4G喇叭</th>
<th>4G开关</th>
<th>WiFi喇叭</th>
<th>WiFi开关</th>
</tr>
</thead>
<tbody>
<tr>
<td><font color="red"><strong>&times;</strong></font></td>
<td><font color="green"><strong>&radic;</strong></font></td>
<td><font color="red"><strong>&times;</strong></font></td>
<td><font color="red"><strong>&times;</strong></font></td>
</tr>
</tbody>
</table>
<p>支持此功能的设备类型:<font color="green"><strong>&radic;</strong></font>-支持 <font color="red"><strong>&times;</strong></font>-不支持</p>
<h2>定时任务说明</h2>
<p>定时任务,分为:</p>
<ul>
<li>普通定时任务,如周一、三、五,13:00执行打开开关动作。</li>
<li>循环定时任务,如周一、三、五,11:30 - 15:10,循环执行开5分钟,关1分钟循环动作。</li>
</ul>
<p>每个插槽/开关可以有多组定时任务。</p>
<h2>获取所有定时任务(getTimeTasks)</h2>
<p><strong>简要描述</strong>
获取所有插槽定时任务。</p>
<p><strong>命令参数</strong></p>
<table>
<thead>
<tr>
<th>参数名</th>
<th>必须</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>method</td>
<td>是</td>
<td>string</td>
<td>getTimeTasks</td>
</tr>
<tr>
<td>frameId</td>
<td>否</td>
<td>string</td>
<td>帧ID</td>
</tr>
</tbody>
</table>
<p><strong>命令示例</strong></p>
<pre><code>{
&quot;method&quot;: &quot;getTimeTasks&quot;,
&quot;frameId&quot;: &quot;1745396239780&quot;
}</code></pre>
<p><strong>应答参数说明</strong></p>
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>method</td>
<td>string</td>
<td>getTimeTasks</td>
</tr>
<tr>
<td>result</td>
<td>string</td>
<td>返回结果。<code>ok</code>-成功;其他-具体失败原因</td>
</tr>
<tr>
<td>tasks</td>
<td>array</td>
<td>定时任务对象数组。按顺序从插槽/开关1到插槽/开关n</td>
</tr>
<tr>
<td>imei</td>
<td>string</td>
<td>设备imei</td>
</tr>
<tr>
<td>frameId</td>
<td>string</td>
<td>同命令frameId</td>
</tr>
<tr>
<td>timestamp</td>
<td>int</td>
<td>秒级时间戳,WiFi款不支持</td>
</tr>
</tbody>
</table>
<ul>
<li><code>tasks</code>数组对象说明</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>loopTimeTasks</td>
<td>array</td>
<td>循环定时任务对象数组</td>
</tr>
<tr>
<td>timeTasks</td>
<td>array</td>
<td>普通定时任务对象数组</td>
</tr>
</tbody>
</table>
<ul>
<li><code>loopTimeTasks</code>循环定时数组对象说明</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>string</td>
<td>任务id,由设置定时任务时分配</td>
</tr>
<tr>
<td>enable</td>
<td>bool</td>
<td>任务是否启用。<code>true</code>-启用,<code>false</code>-不启用</td>
</tr>
<tr>
<td>weekDays</td>
<td>array</td>
<td>每周的星期几数组,数组值为1-7,对应星期一到星期天。空数组则表示仅一次,处理完后<code>enable</code>会变为false</td>
</tr>
<tr>
<td>sHour</td>
<td>int</td>
<td>每天循环开始的小时</td>
</tr>
<tr>
<td>sMinute</td>
<td>int</td>
<td>每天循环开始的分钟</td>
</tr>
<tr>
<td>eHour</td>
<td>int</td>
<td>每天循环结束的小时</td>
</tr>
<tr>
<td>eMinute</td>
<td>int</td>
<td>每天循环结束的分钟</td>
</tr>
<tr>
<td>onMins</td>
<td>int</td>
<td>循环中打开的分钟数</td>
</tr>
<tr>
<td>offMins</td>
<td>int</td>
<td>循环中关闭的分钟数</td>
</tr>
</tbody>
</table>
<ul>
<li><code>timeTasks</code>普通定时数组对象说明</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>string</td>
<td>任务id,由设置定时任务时分配</td>
</tr>
<tr>
<td>enable</td>
<td>bool</td>
<td>任务是否启用。<code>true</code>-启用,<code>false</code>-不启用</td>
</tr>
<tr>
<td>weekDays</td>
<td>array</td>
<td>每周的星期几数组,数组值为1-7,对应星期一到星期天。空数组则表示仅一次,处理完后<code>enable</code>会变为false</td>
</tr>
<tr>
<td>hour</td>
<td>int</td>
<td>每天动作小时</td>
</tr>
<tr>
<td>minute</td>
<td>int</td>
<td>每天动作分钟</td>
</tr>
<tr>
<td>action</td>
<td>string</td>
<td>动作。<code>on</code>-打开;<code>off</code>-关闭;<code>toggle</code>-翻转</td>
</tr>
</tbody>
</table>
<p><strong>应答示例</strong></p>
<pre><code>{
&quot;tasks&quot;:
[
{
&quot;loopTimeTasks&quot;:
[
{
&quot;id&quot;: &quot;1702288670498&quot;,
&quot;sHour&quot;: 8,
&quot;sMinute&quot;: 0,
&quot;enable&quot;: true,
&quot;offMins&quot;: 10,
&quot;eMinute&quot;: 0,
&quot;onMins&quot;: 5,
&quot;weekDays&quot;: [1,4,5],
&quot;eHour&quot;: 10
}
],
&quot;timeTasks&quot;:
[
{
&quot;minute&quot;: 30,
&quot;hour&quot;: 10,
&quot;id&quot;: &quot;1702288645833&quot;,
&quot;enable&quot;: true,
&quot;weekDays&quot;: [1,2,3,7],
&quot;action&quot;: &quot;on&quot;
},
{
&quot;minute&quot;: 10,
&quot;hour&quot;: 8,
&quot;id&quot;: &quot;1702288818397&quot;,
&quot;enable&quot;: false,
&quot;weekDays&quot;: [1,2,6],
&quot;action&quot;: &quot;toggle&quot;
}
]
}
],
&quot;timestamp&quot;: 1702288823,
&quot;imei&quot;: &quot;861959069365794&quot;,
&quot;frameId&quot;: &quot;2147483647&quot;,
&quot;result&quot;: &quot;ok&quot;,
&quot;method&quot;: &quot;getTimeTasks&quot;
}</code></pre>
<p><strong>备注</strong>
无</p>
<h2>设置所有定时任务(setTimeTasks)</h2>
<p><strong>简要描述</strong>
设置所有插槽/开关定时任务。</p>
<p><strong>命令参数</strong></p>
<table>
<thead>
<tr>
<th>参数名</th>
<th>必须</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>method</td>
<td>是</td>
<td>string</td>
<td>setTimeTasks</td>
</tr>
<tr>
<td>tasks</td>
<td>array</td>
<td>定时任务对象数组。按顺序从插槽/开关1到插槽/开关n</td>
</tr>
<tr>
<td>frameId</td>
<td>否</td>
<td>string</td>
<td>帧ID</td>
</tr>
</tbody>
</table>
<ul>
<li><code>tasks</code>数组对象说明</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>必须</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>loopTimeTasks</td>
<td>否</td>
<td>array</td>
<td>循环定时任务对象数组</td>
</tr>
<tr>
<td>timeTasks</td>
<td>否</td>
<td>array</td>
<td>普通定时任务对象数组</td>
</tr>
</tbody>
</table>
<ul>
<li><code>loopTimeTasks</code>循环定时数组对象说明</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>必须</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>是</td>
<td>string</td>
<td>任务id,由设置定时任务时分配</td>
</tr>
<tr>
<td>enable</td>
<td>是</td>
<td>bool</td>
<td>任务是否启用。<code>true</code>-启用,<code>false</code>-不启用</td>
</tr>
<tr>
<td>weekDays</td>
<td>是</td>
<td>array</td>
<td>每周的星期几数组,数组值为1-7,对应星期一到星期天。空数组则表示仅一次,处理完后<code>enable</code>会变为false</td>
</tr>
<tr>
<td>sHour</td>
<td>是</td>
<td>int</td>
<td>每天循环开始的小时</td>
</tr>
<tr>
<td>sMinute</td>
<td>是</td>
<td>int</td>
<td>每天循环开始的分钟</td>
</tr>
<tr>
<td>eHour</td>
<td>是</td>
<td>int</td>
<td>每天循环结束的小时</td>
</tr>
<tr>
<td>eMinute</td>
<td>是</td>
<td>int</td>
<td>每天循环结束的分钟</td>
</tr>
<tr>
<td>onMins</td>
<td>是</td>
<td>int</td>
<td>循环中打开的分钟数</td>
</tr>
<tr>
<td>offMins</td>
<td>是</td>
<td>int</td>
<td>循环中关闭的分钟数</td>
</tr>
</tbody>
</table>
<ul>
<li><code>timeTasks</code>普通定时数组对象说明</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>必须</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>是</td>
<td>string</td>
<td>任务id,由设置定时任务时分配</td>
</tr>
<tr>
<td>enable</td>
<td>是</td>
<td>bool</td>
<td>任务是否启用。<code>true</code>-启用,<code>false</code>-不启用</td>
</tr>
<tr>
<td>weekDays</td>
<td>是</td>
<td>array</td>
<td>每周的星期几数组,数组值为1-7,对应星期一到星期天。空数组则表示仅一次,处理完后<code>enable</code>会变为false</td>
</tr>
<tr>
<td>hour</td>
<td>是</td>
<td>int</td>
<td>每天动作小时</td>
</tr>
<tr>
<td>minute</td>
<td>是</td>
<td>int</td>
<td>每天动作分钟</td>
</tr>
<tr>
<td>action</td>
<td>是</td>
<td>string</td>
<td>动作。<code>on</code>-打开;<code>off</code>-关闭;<code>toggle</code>-翻转</td>
</tr>
</tbody>
</table>
<p><strong>命令示例</strong></p>
<pre><code>{
&quot;tasks&quot;:
[
{
&quot;loopTimeTasks&quot;:
[
{
&quot;id&quot;: &quot;1702288670498&quot;,
&quot;sHour&quot;: 8,
&quot;sMinute&quot;: 0,
&quot;enable&quot;: true,
&quot;offMins&quot;: 10,
&quot;eMinute&quot;: 0,
&quot;onMins&quot;: 5,
&quot;weekDays&quot;: [1,4,5],
&quot;eHour&quot;: 10
}
],
&quot;timeTasks&quot;:
[
{
&quot;minute&quot;: 30,
&quot;hour&quot;: 10,
&quot;id&quot;: &quot;1702288645833&quot;,
&quot;enable&quot;: true,
&quot;weekDays&quot;: [1,2,3,7],
&quot;action&quot;: &quot;on&quot;
},
{
&quot;minute&quot;: 10,
&quot;hour&quot;: 8,
&quot;id&quot;: &quot;1702288818397&quot;,
&quot;enable&quot;: false,
&quot;weekDays&quot;: [1,2,6],
&quot;action&quot;: &quot;toggle&quot;
}
]
}
],
&quot;frameId&quot;: &quot;2147483647&quot;,
&quot;method&quot;: &quot;setTimeTasks&quot;
}</code></pre>
<p><strong>应答参数说明</strong></p>
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>method</td>
<td>string</td>
<td>getTimeTasks</td>
</tr>
<tr>
<td>result</td>
<td>string</td>
<td>返回结果。<code>ok</code>-成功;其他-具体失败原因</td>
</tr>
<tr>
<td>tasks</td>
<td>array</td>
<td>定时任务对象数组。按顺序从插槽/开关1到插槽/开关n</td>
</tr>
<tr>
<td>imei</td>
<td>string</td>
<td>设备imei</td>
</tr>
<tr>
<td>frameId</td>
<td>string</td>
<td>同命令frameId</td>
</tr>
<tr>
<td>timestamp</td>
<td>int</td>
<td>秒级时间戳,WiFi款不支持</td>
</tr>
</tbody>
</table>
<ul>
<li><code>tasks</code>数组对象说明</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>loopTimeTasks</td>
<td>array</td>
<td>循环定时任务对象数组</td>
</tr>
<tr>
<td>timeTasks</td>
<td>array</td>
<td>普通定时任务对象数组</td>
</tr>
</tbody>
</table>
<ul>
<li><code>loopTimeTasks</code>循环定时数组对象说明</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>string</td>
<td>任务id,由设置定时任务时分配</td>
</tr>
<tr>
<td>enable</td>
<td>bool</td>
<td>任务是否启用。<code>true</code>-启用,<code>false</code>-不启用</td>
</tr>
<tr>
<td>weekDays</td>
<td>array</td>
<td>每周的星期几数组,数组值为1-7,对应星期一到星期天。空数组则表示仅一次,处理完后<code>enable</code>会变为false</td>
</tr>
<tr>
<td>sHour</td>
<td>int</td>
<td>每天循环开始的小时</td>
</tr>
<tr>
<td>sMinute</td>
<td>int</td>
<td>每天循环开始的分钟</td>
</tr>
<tr>
<td>eHour</td>
<td>int</td>
<td>每天循环结束的小时</td>
</tr>
<tr>
<td>eMinute</td>
<td>int</td>
<td>每天循环结束的分钟</td>
</tr>
<tr>
<td>onMins</td>
<td>int</td>
<td>循环中打开的分钟数</td>
</tr>
<tr>
<td>offMins</td>
<td>int</td>
<td>循环中关闭的分钟数</td>
</tr>
</tbody>
</table>
<ul>
<li><code>timeTasks</code>普通定时数组对象说明</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>string</td>
<td>任务id,由设置定时任务时分配</td>
</tr>
<tr>
<td>enable</td>
<td>bool</td>
<td>任务是否启用。<code>true</code>-启用,<code>false</code>-不启用</td>
</tr>
<tr>
<td>weekDays</td>
<td>array</td>
<td>每周的星期几数组,数组值为1-7,对应星期一到星期天。空数组则表示仅一次,处理完后<code>enable</code>会变为false</td>
</tr>
<tr>
<td>hour</td>
<td>int</td>
<td>每天动作小时</td>
</tr>
<tr>
<td>minute</td>
<td>int</td>
<td>每天动作分钟</td>
</tr>
<tr>
<td>action</td>
<td>string</td>
<td>动作。<code>on</code>-打开;<code>off</code>-关闭;<code>toggle</code>-翻转</td>
</tr>
</tbody>
</table>
<p><strong>应答示例</strong></p>
<pre><code>{
&quot;tasks&quot;:
[
{
&quot;loopTimeTasks&quot;:
[
{
&quot;id&quot;: &quot;1702288670498&quot;,
&quot;sHour&quot;: 8,
&quot;sMinute&quot;: 0,
&quot;enable&quot;: true,
&quot;offMins&quot;: 10,
&quot;eMinute&quot;: 0,
&quot;onMins&quot;: 5,
&quot;weekDays&quot;: [1,4,5],
&quot;eHour&quot;: 10
}
],
&quot;timeTasks&quot;:
[
{
&quot;minute&quot;: 30,
&quot;hour&quot;: 10,
&quot;id&quot;: &quot;1702288645833&quot;,
&quot;enable&quot;: true,
&quot;weekDays&quot;: [1,2,3,7],
&quot;action&quot;: &quot;on&quot;
},
{
&quot;minute&quot;: 10,
&quot;hour&quot;: 8,
&quot;id&quot;: &quot;1702288818397&quot;,
&quot;enable&quot;: false,
&quot;weekDays&quot;: [1,2,6],
&quot;action&quot;: &quot;toggle&quot;
}
]
}
],
&quot;timestamp&quot;: 1702288823,
&quot;imei&quot;: &quot;861959069365794&quot;,
&quot;frameId&quot;: &quot;2147483647&quot;,
&quot;result&quot;: &quot;ok&quot;,
&quot;method&quot;: &quot;getTimeTasks&quot;
}</code></pre>
<p><strong>备注</strong>
无</p>
<h2>获取单个插槽/开关定时任务(getTimeTask)</h2>
<p><strong>简要描述</strong>
获取单个插槽/开关定时任务</p>
<p><strong>命令参数</strong></p>
<table>
<thead>
<tr>
<th>参数名</th>
<th>必须</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>method</td>
<td>是</td>
<td>string</td>
<td>getTimeTask</td>
</tr>
<tr>
<td>frameId</td>
<td>否</td>
<td>string</td>
<td>帧ID</td>
</tr>
</tbody>
</table>
<p><strong>命令示例</strong></p>
<pre><code>{
&quot;method&quot;: &quot;getTimeTask&quot;,
&quot;frameId&quot;: &quot;1745396239780&quot;
}</code></pre>
<p><strong>应答参数说明</strong></p>
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>method</td>
<td>string</td>
<td>getTimeTask</td>
</tr>
<tr>
<td>result</td>
<td>string</td>
<td>返回结果。<code>ok</code>-成功;其他-具体失败原因</td>
</tr>
<tr>
<td>loopTimeTasks</td>
<td>array</td>
<td>循环定时任务对象数组</td>
</tr>
<tr>
<td>timeTasks</td>
<td>array</td>
<td>普通定时任务对象数组</td>
</tr>
<tr>
<td>imei</td>
<td>string</td>
<td>设备imei</td>
</tr>
<tr>
<td>frameId</td>
<td>string</td>
<td>同命令frameId</td>
</tr>
<tr>
<td>timestamp</td>
<td>int</td>
<td>秒级时间戳,WiFi款不支持</td>
</tr>
</tbody>
</table>
<ul>
<li><code>loopTimeTasks</code>循环定时数组对象说明</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>string</td>
<td>任务id,由设置定时任务时分配</td>
</tr>
<tr>
<td>enable</td>
<td>bool</td>
<td>任务是否启用。<code>true</code>-启用,<code>false</code>-不启用</td>
</tr>
<tr>
<td>weekDays</td>
<td>array</td>
<td>每周的星期几数组,数组值为1-7,对应星期一到星期天。空数组则表示仅一次,处理完后<code>enable</code>会变为false</td>
</tr>
<tr>
<td>sHour</td>
<td>int</td>
<td>每天循环开始的小时</td>
</tr>
<tr>
<td>sMinute</td>
<td>int</td>
<td>每天循环开始的分钟</td>
</tr>
<tr>
<td>eHour</td>
<td>int</td>
<td>每天循环结束的小时</td>
</tr>
<tr>
<td>eMinute</td>
<td>int</td>
<td>每天循环结束的分钟</td>
</tr>
<tr>
<td>onMins</td>
<td>int</td>
<td>循环中打开的分钟数</td>
</tr>
<tr>
<td>offMins</td>
<td>int</td>
<td>循环中关闭的分钟数</td>
</tr>
</tbody>
</table>
<ul>
<li><code>timeTasks</code>普通定时数组对象说明</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>string</td>
<td>任务id,由设置定时任务时分配</td>
</tr>
<tr>
<td>enable</td>
<td>bool</td>
<td>任务是否启用。<code>true</code>-启用,<code>false</code>-不启用</td>
</tr>
<tr>
<td>weekDays</td>
<td>array</td>
<td>每周的星期几数组,数组值为1-7,对应星期一到星期天。空数组则表示仅一次,处理完后<code>enable</code>会变为false</td>
</tr>
<tr>
<td>hour</td>
<td>int</td>
<td>每天动作小时</td>
</tr>
<tr>
<td>minute</td>
<td>int</td>
<td>每天动作分钟</td>
</tr>
<tr>
<td>action</td>
<td>string</td>
<td>动作。<code>on</code>-打开;<code>off</code>-关闭;<code>toggle</code>-翻转</td>
</tr>
</tbody>
</table>
<p><strong>应答示例</strong></p>
<pre><code>{
&quot;loopTimeTasks&quot;: [
{
&quot;id&quot;: &quot;1702288670498&quot;,
&quot;sHour&quot;: 8,
&quot;sMinute&quot;: 0,
&quot;enable&quot;: true,
&quot;offMins&quot;: 10,
&quot;eMinute&quot;: 0,
&quot;onMins&quot;: 5,
&quot;weekDays&quot;: [1,4,5],
&quot;eHour&quot;: 10
}
],
&quot;timeTasks&quot;: [
{
&quot;minute&quot;: 30,
&quot;hour&quot;: 10,
&quot;id&quot;: &quot;1702288645833&quot;,
&quot;enable&quot;: true,
&quot;weekDays&quot;: [1,2,3,7],
&quot;action&quot;: &quot;on&quot;
},
{
&quot;minute&quot;: 10,
&quot;hour&quot;: 8,
&quot;id&quot;: &quot;1702288818397&quot;,
&quot;enable&quot;: false,
&quot;weekDays&quot;: [1,2,6],
&quot;action&quot;: &quot;toggle&quot;
}
],
&quot;timestamp&quot;: 1702288823,
&quot;imei&quot;: &quot;861959069365794&quot;,
&quot;frameId&quot;: &quot;2147483647&quot;,
&quot;result&quot;: &quot;ok&quot;,
&quot;method&quot;: &quot;getTimeTask&quot;
}</code></pre>
<p><strong>备注</strong>
无</p>
<h2>设置单个插槽/开关定时任务(setTimeTask)</h2>
<p><strong>简要描述</strong>
设置单个插槽/开关定时任务。</p>
<p><strong>命令参数</strong></p>
<table>
<thead>
<tr>
<th>参数名</th>
<th>必须</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>method</td>
<td>是</td>
<td>string</td>
<td>setTimeTask</td>
</tr>
<tr>
<td>loopTimeTasks</td>
<td>否</td>
<td>array</td>
<td>循环定时任务对象数组</td>
</tr>
<tr>
<td>timeTasks</td>
<td>否</td>
<td>array</td>
<td>普通定时任务对象数组</td>
</tr>
<tr>
<td>frameId</td>
<td>否</td>
<td>string</td>
<td>帧ID</td>
</tr>
</tbody>
</table>
<ul>
<li><code>loopTimeTasks</code>循环定时数组对象说明</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>必须</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>是</td>
<td>string</td>
<td>任务id,由设置定时任务时分配</td>
</tr>
<tr>
<td>enable</td>
<td>是</td>
<td>bool</td>
<td>任务是否启用。<code>true</code>-启用,<code>false</code>-不启用</td>
</tr>
<tr>
<td>weekDays</td>
<td>是</td>
<td>array</td>
<td>每周的星期几数组,数组值为1-7,对应星期一到星期天。空数组则表示仅一次,处理完后<code>enable</code>会变为false</td>
</tr>
<tr>
<td>sHour</td>
<td>是</td>
<td>int</td>
<td>每天循环开始的小时</td>
</tr>
<tr>
<td>sMinute</td>
<td>是</td>
<td>int</td>
<td>每天循环开始的分钟</td>
</tr>
<tr>
<td>eHour</td>
<td>是</td>
<td>int</td>
<td>每天循环结束的小时</td>
</tr>
<tr>
<td>eMinute</td>
<td>是</td>
<td>int</td>
<td>每天循环结束的分钟</td>
</tr>
<tr>
<td>onMins</td>
<td>是</td>
<td>int</td>
<td>循环中打开的分钟数</td>
</tr>
<tr>
<td>offMins</td>
<td>是</td>
<td>int</td>
<td>循环中关闭的分钟数</td>
</tr>
</tbody>
</table>
<ul>
<li><code>timeTasks</code>普通定时数组对象说明</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>必须</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>是</td>
<td>string</td>
<td>任务id,由设置定时任务时分配</td>
</tr>
<tr>
<td>enable</td>
<td>是</td>
<td>bool</td>
<td>任务是否启用。<code>true</code>-启用,<code>false</code>-不启用</td>
</tr>
<tr>
<td>weekDays</td>
<td>是</td>
<td>array</td>
<td>每周的星期几数组,数组值为1-7,对应星期一到星期天。空数组则表示仅一次,处理完后<code>enable</code>会变为false</td>
</tr>
<tr>
<td>hour</td>
<td>是</td>
<td>int</td>
<td>每天动作小时</td>
</tr>
<tr>
<td>minute</td>
<td>是</td>
<td>int</td>
<td>每天动作分钟</td>
</tr>
<tr>
<td>action</td>
<td>是</td>
<td>string</td>
<td>动作。<code>on</code>-打开;<code>off</code>-关闭;<code>toggle</code>-翻转</td>
</tr>
</tbody>
</table>
<p><strong>命令示例</strong></p>
<pre><code>{
&quot;method&quot;: &quot;setTimeTasks&quot;,
&quot;slotNum&quot;: 1,
&quot;timeTasks&quot;: [
{
&quot;id&quot;: &quot;1702288645833&quot;,
&quot;weekDays&quot;: [1,2,3,7],
&quot;hour&quot;: 10,
&quot;minute&quot;: 30,
&quot;action&quot;: &quot;on&quot;,
&quot;enable&quot;: true
}
],
&quot;loopTimeTasks&quot;: [
{
&quot;id&quot;: &quot;1702288670498&quot;,
&quot;weekDays&quot;: [1,4,5],
&quot;sHour&quot;: 8,
&quot;sMinute&quot;: 0,
&quot;eHour&quot;: 10,
&quot;eMinute&quot;: 0,
&quot;onMins&quot;: 5,
&quot;offMins&quot;: 10,
&quot;enable&quot;: true
}
],
&quot;frameId&quot;: &quot;1702288672404&quot;
}</code></pre>
<p><strong>应答参数说明</strong></p>
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>method</td>
<td>string</td>
<td>setTimeTask</td>
</tr>
<tr>
<td>result</td>
<td>string</td>
<td>返回结果。<code>ok</code>-成功;其他-具体失败原因</td>
</tr>
<tr>
<td>loopTimeTasks</td>
<td>array</td>
<td>循环定时任务对象数组</td>
</tr>
<tr>
<td>timeTasks</td>
<td>array</td>
<td>普通定时任务对象数组</td>
</tr>
<tr>
<td>imei</td>
<td>string</td>
<td>设备imei</td>
</tr>
<tr>
<td>frameId</td>
<td>string</td>
<td>同命令frameId</td>
</tr>
<tr>
<td>timestamp</td>
<td>int</td>
<td>秒级时间戳,WiFi款不支持</td>
</tr>
</tbody>
</table>
<ul>
<li><code>loopTimeTasks</code>循环定时数组对象说明</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>string</td>
<td>任务id,由设置定时任务时分配</td>
</tr>
<tr>
<td>enable</td>
<td>bool</td>
<td>任务是否启用。<code>true</code>-启用,<code>false</code>-不启用</td>
</tr>
<tr>
<td>weekDays</td>
<td>array</td>
<td>每周的星期几数组,数组值为1-7,对应星期一到星期天。空数组则表示仅一次,处理完后<code>enable</code>会变为false</td>
</tr>
<tr>
<td>sHour</td>
<td>int</td>
<td>每天循环开始的小时</td>
</tr>
<tr>
<td>sMinute</td>
<td>int</td>
<td>每天循环开始的分钟</td>
</tr>
<tr>
<td>eHour</td>
<td>int</td>
<td>每天循环结束的小时</td>
</tr>
<tr>
<td>eMinute</td>
<td>int</td>
<td>每天循环结束的分钟</td>
</tr>
<tr>
<td>onMins</td>
<td>int</td>
<td>循环中打开的分钟数</td>
</tr>
<tr>
<td>offMins</td>
<td>int</td>
<td>循环中关闭的分钟数</td>
</tr>
</tbody>
</table>
<ul>
<li><code>timeTasks</code>普通定时数组对象说明</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>string</td>
<td>任务id,由设置定时任务时分配</td>
</tr>
<tr>
<td>enable</td>
<td>bool</td>
<td>任务是否启用。<code>true</code>-启用,<code>false</code>-不启用</td>
</tr>
<tr>
<td>weekDays</td>
<td>array</td>
<td>每周的星期几数组,数组值为1-7,对应星期一到星期天。空数组则表示仅一次,处理完后<code>enable</code>会变为false</td>
</tr>
<tr>
<td>hour</td>
<td>int</td>
<td>每天动作小时</td>
</tr>
<tr>
<td>minute</td>
<td>int</td>
<td>每天动作分钟</td>
</tr>
<tr>
<td>action</td>
<td>string</td>
<td>动作。<code>on</code>-打开;<code>off</code>-关闭;<code>toggle</code>-翻转</td>
</tr>
</tbody>
</table>
<p><strong>应答示例</strong></p>
<pre><code>{
&quot;loopTimeTasks&quot;: [
{
&quot;id&quot;: &quot;1702288670498&quot;,
&quot;sHour&quot;: 8,
&quot;sMinute&quot;: 0,
&quot;enable&quot;: true,
&quot;offMins&quot;: 10,
&quot;eMinute&quot;: 0,
&quot;onMins&quot;: 5,
&quot;weekDays&quot;: [1,4,5],
&quot;eHour&quot;: 10
}
],
&quot;timeTasks&quot;: [
{
&quot;minute&quot;: 30,
&quot;hour&quot;: 10,
&quot;id&quot;: &quot;1702288645833&quot;,
&quot;enable&quot;: true,
&quot;weekDays&quot;: [1,2,3,7],
&quot;action&quot;: &quot;on&quot;
},
{
&quot;minute&quot;: 10,
&quot;hour&quot;: 8,
&quot;id&quot;: &quot;1702288818397&quot;,
&quot;enable&quot;: false,
&quot;weekDays&quot;: [1,2,6],
&quot;action&quot;: &quot;toggle&quot;
}
],
&quot;timestamp&quot;: 1702288823,
&quot;imei&quot;: &quot;861959069365794&quot;,
&quot;frameId&quot;: &quot;2147483647&quot;,
&quot;result&quot;: &quot;ok&quot;,
&quot;method&quot;: &quot;setTimeTask&quot;
}</code></pre>
<p><strong>备注</strong>
无</p>
<h2>获取电量计统计信息(getEMStatistics)</h2>
<p><strong>简要描述</strong>
获取电量计统计信息。</p>
<p><strong>命令参数</strong></p>
<table>
<thead>
<tr>
<th>参数名</th>
<th>必须</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>method</td>
<td>是</td>
<td>string</td>
<td>getEMStatistics</td>
</tr>
<tr>
<td>q</td>
<td>否</td>
<td>string</td>
<td>查询字符串,不传或<code>all</code>-全部统计信息;<code>month</code>-月统计信息;<code>day</code>-日统计信息;<code>hour</code>-小时统计信息;<code>hourSum</code>-小时累加统计信息;<code>total</code>-总电量信息。可组合使用,如:<code>total,day,hour</code> 表示返回总度数、日统计信息、小时统计信息</td>
</tr>
<tr>
<td>frameId</td>
<td>否</td>
<td>string</td>
<td>帧ID</td>
</tr>
</tbody>
</table>
<p><strong>命令示例</strong></p>
<pre><code>{
&quot;method&quot;: &quot;getEMStatistics&quot;,
&quot;q&quot;: &quot;all&quot;,
&quot;frameId&quot;: &quot;1745396239780&quot;
}</code></pre>
<p><strong>应答参数说明</strong></p>
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>method</td>
<td>string</td>
<td>getEMStatistics</td>
</tr>
<tr>
<td>result</td>
<td>string</td>
<td>返回结果。<code>ok</code>-成功;其他-具体失败原因</td>
</tr>
<tr>
<td>data</td>
<td>array</td>
<td>插槽电量计统计信息对象数组。按顺序从插槽1~插槽n。数值单位kWh(度)</td>
</tr>
<tr>
<td>imei</td>
<td>string</td>
<td>设备imei</td>
</tr>
<tr>
<td>frameId</td>
<td>string</td>
<td>同命令frameId</td>
</tr>
<tr>
<td>timestamp</td>
<td>int</td>
<td>秒级时间戳,WiFi款不支持</td>
</tr>
</tbody>
</table>
<ul>
<li><code>data</code>数组对象说明</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>total</td>
<td>double</td>
<td>累计电量</td>
</tr>
<tr>
<td>hourSumData</td>
<td>array</td>
<td>半小时累计电量数组,隔天累加。数组长度48,从0时0分(包含)~0时30分(不包含),0时30分(包含)~1时0分(不包含),…依此类推</td>
</tr>
<tr>
<td>hourData</td>
<td>array</td>
<td>半小时累计电量数组。注意:半小时累计电量数组数据可能不连续,请按照具体日期值为date的键值。具体例子请参考下面应答示例。半小时累计电量数组只保留最近48个记录,没有记录到的日期表示此半小时无累计电量或超出最长记录</td>
</tr>
<tr>
<td>dayData</td>
<td>array</td>
<td>日累计电量数组。注意:日累计电量数组数据可能不连续,请按照具体日期值为date的键值。具体例子请参考下面应答示例。日累计电量数组只保留最近30个记录,没有记录到的日期表示当天无累计电量或超出最长记录</td>
</tr>
<tr>
<td>monthData</td>
<td>array</td>
<td>月累计电量数组。注意:月累计电量数组数据可能不连续,请按照具体日期值为date的键值。具体例子请参考下面应答示例。月累计电量数组只保留最近12个记录,没有记录到的日期表示当月无累计电量或超出最长记录</td>
</tr>
</tbody>
</table>
<ul>
<li><code>hourData</code>数组对象说明</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>date</td>
<td>string</td>
<td>日期,格式 yyyyMMddHHmm,mm值为00或30</td>
</tr>
<tr>
<td>kwh</td>
<td>double</td>
<td>累计电量</td>
</tr>
</tbody>
</table>
<ul>
<li><code>dayData</code>数组对象说明</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>date</td>
<td>string</td>
<td>日期,格式 yyyyMMdd</td>
</tr>
<tr>
<td>kwh</td>
<td>double</td>
<td>累计电量</td>
</tr>
</tbody>
</table>
<ul>
<li><code>monthData</code>数组对象说明</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>date</td>
<td>string</td>
<td>日期,格式 yyyyMM</td>
</tr>
<tr>
<td>kwh</td>
<td>double</td>
<td>累计电量</td>
</tr>
</tbody>
</table>
<p><strong>应答示例</strong></p>
<pre><code>{
&quot;timestamp&quot;: 1712472461,
&quot;imei&quot;: &quot;861959069365794&quot;,
&quot;data&quot;: [
{
&quot;total&quot;: 8.401,
&quot;dayData&quot;: [
{&quot;date&quot;: &quot;20240407&quot;,&quot;kwh&quot;: 5.5258},
{&quot;date&quot;: &quot;20240330&quot;,&quot;kwh&quot;: 0.5}
],
&quot;hourData&quot;: [
{&quot;date&quot;: &quot;202404071030&quot;,&quot;kwh&quot;: 5.5258},
{&quot;date&quot;: &quot;202404071000&quot;,&quot;kwh&quot;: 0.5}
],
&quot;hourSumData&quot;:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2.267,1.233,0,0,0,0,0.541,0,0,0,0,0,0,0,0,0.158,0,0,0,0,0,0,0,0,0],
&quot;monthData&quot;: [
{&quot;date&quot;: &quot;202404&quot;,&quot;kwh&quot;: 5.5258},
{&quot;date&quot;: &quot;202403&quot;,&quot;kwh&quot;: 0.5}
]
}
],
&quot;result&quot;: &quot;ok&quot;,
&quot;frameId&quot;: 2147483647,
&quot;method&quot;: &quot;getEMStatistics&quot;
}</code></pre>
<p><strong>备注</strong>
无</p>
<h2>清空电量计统计信息(clearEMStatistics)</h2>
<p><strong>简要描述</strong>
清空电量计统计信息。</p>
<p><strong>命令参数</strong></p>
<table>
<thead>
<tr>
<th>参数名</th>
<th>必须</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>method</td>
<td>是</td>
<td>string</td>
<td>clearEMStatistics</td>
</tr>
<tr>
<td>slotNum</td>
<td>否</td>
<td>int</td>
<td>要清空电量统计信息的插槽编号。不传或<code>0</code>表示清空所有插槽的电量统计信息</td>
</tr>
<tr>
<td>frameId</td>
<td>否</td>
<td>string</td>
<td>帧ID</td>
</tr>
</tbody>
</table>
<p><strong>命令示例</strong></p>
<pre><code>{
&quot;method&quot;: &quot;clearEMStatistics&quot;,{
&quot;slotNum&quot;: 1,
&quot;frameId&quot;: &quot;1745396239780&quot;
}</code></pre>
<p><strong>应答参数说明</strong></p>
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>method</td>
<td>string</td>
<td>clearEMStatistics</td>
</tr>
<tr>
<td>result</td>
<td>string</td>
<td>返回结果。<code>ok</code>-成功;其他-具体失败原因</td>
</tr>
<tr>
<td>imei</td>
<td>string</td>
<td>设备imei</td>
</tr>
<tr>
<td>frameId</td>
<td>string</td>
<td>同命令frameId</td>
</tr>
<tr>
<td>timestamp</td>
<td>int</td>
<td>秒级时间戳,WiFi款不支持</td>
</tr>
</tbody>
</table>
<p><strong>应答示例</strong></p>
<pre><code>{
&quot;method&quot;: &quot;clearEMStatistics&quot;,
&quot;result&quot;: &quot;ok&quot;,
&quot;imei&quot;: &quot;1745396239780&quot;,
&quot;frameId&quot;: &quot;1745396239780&quot;,
&quot;timestamp&quot;: 1745396759
}</code></pre>
<p><strong>备注</strong>
无</p>