Skip to content
Permalink
Browse files

Merge pull request #18 from directman66/alpha

Update devices.html
  • Loading branch information...
directman66 committed Jul 11, 2019
2 parents 36e9536 + 69a97b0 commit 84ddf5c12c7f1fd1c805d1c8c9aff269be110388
@@ -62,6 +62,10 @@
global $retain;
$rec['RETAIN']=(int)$retain;
global $enable1;
$rec['ENABLE1']=(int)$enable1;
global $convertonoff;
$rec['CONVERTONOFF']=(int)$convertonoff;
@@ -591,6 +591,11 @@ function setPropertyDevice($id, $value, $set_linked=0) {
function api($params) {
debmes('Сработал api ','zigbee2mqtt');
debmes($params,'zigbee2mqtt');
debmes($_REQUEST,'zigbee2mqtt');
if ($_REQUEST['topic']) {
$this->processMessage($_REQUEST['topic'], $_REQUEST['msg']);
}
@@ -602,7 +607,7 @@ function processMessage($path, $value) {
// debmes('Сработал processMessage :'.$path." value:". $value.' strpos:'. strpos($path,"set"),'zigbee2mqtt');
debmes('Сработал processMessage :'.$path." value:". $value.' strpos:'. strpos($path,"set"),'zigbee2mqtt');
//if (ZMQTT_DEBUG=="1" ) debmes('Сработал processMessage :'.$path." value:". $value,'zigbee2mqtt');
if (preg_match('/\#$/', $path)) {
@@ -637,6 +642,7 @@ function processMessage2($path, $value) {
if (strpos($path,'igbee2mqtt/bridge/state')>0) {$msgtype='bridge_state';}
if (strpos($path,'igbee2mqtt/bridge/networkmap/raw')>0) {$msgtype='raw_map';}
if (strpos($path,'igbee2mqtt/bridge/networkmap')>0) {$msgtype='graphwiz';}
if (strpos($path,'igbee2mqtt/bridge/log')>0) {$msgtype='log';}
//if ($path=='zigbee2mqtt/bridge/log') {$msgtype=$json->{'type'};}
@@ -654,12 +660,13 @@ function processMessage2($path, $value) {
||$path=='zigbee2mqtt/bridge/networkmap/graphviz'
)
{
$json=json_decode($value);
$msgtype=$json->{'type'};
///debmes('Пришло важное сообщение, поместим его в журнал :'.$path." value:". $value." type:".$json->{'type'},'zigbee2mqtt');
//debmes('Пришло важное сообщение, поместим его в журнал :'.$path." value:". $value." type:".$json->{'type'},'zigbee2mqtt');
//{"type":"groups","message":{"1":{"friendly_name":"232323"},"2":{"friendly_name":"group1"},"3":{"friendly_name":"group1"},"4":{"friendly_name":"group1"}}}
@@ -980,9 +987,12 @@ function update_default($path, $value){
//debmes('Вызываю setglobal: value:'.$rec1['LINKED_OBJECT'].'.'.$rec1['LINKED_PROPERTY'].' value:'. $newvalue,'zigbee2mqtt');
$oldvalue=getGlobal($rec['LINKED_OBJECT'].'.'.$rec['LINKED_PROPERTY']);
if ($rec1['ENABLE1']<>"1"){
setGlobal($rec1['LINKED_OBJECT'].'.'.$rec1['LINKED_PROPERTY'], $newvalue, array('zigbee2mqtt'=>'0'));}
else if ($newvalue<>$oldvalue)
{setGlobal($rec1['LINKED_OBJECT'].'.'.$rec1['LINKED_PROPERTY'], $newvalue, array('zigbee2mqtt'=>'0'));}
if ($newvalue<>$oldvalue) setGlobal($rec1['LINKED_OBJECT'].'.'.$rec1['LINKED_PROPERTY'], $newvalue, array('zigbee2mqtt'=>'0'));
}
}
//debmes('Проверяем, нужно ли вызвать метод : '.$rec1['LINKED_OBJECT'].'.'.$rec1['LINKED_METHOD'].' value:'. $newvalue,'zigbee2mqtt');
if ($rec1['LINKED_OBJECT'] && $rec1['LINKED_METHOD']) {
@@ -3695,6 +3705,7 @@ function createdb()
zigbee2mqtt: PAYLOAD_OFF varchar(255) NOT NULL DEFAULT ''
zigbee2mqtt: PAYLOAD_TRUE varchar(255) NOT NULL DEFAULT ''
zigbee2mqtt: PAYLOAD_FALSE varchar(255) NOT NULL DEFAULT ''
zigbee2mqtt: ENABLE1 varchar(1) NOT NULL DEFAULT ''
zigbee2mqtt_log: ID int(10) unsigned NOT NULL auto_increment
zigbee2mqtt_log: TITLE varchar(255) NOT NULL DEFAULT ''
@@ -68,7 +68,7 @@
-->
<div class="col-md-3">
<select class="form-control" name="type_id" onChange="document.frmList_mqtt.submit();">
<select class="form-control" name="type_id" onChange="document.frmList_mqtt.submit();" [#if "<#SETTINGS_THEME#>"=="dark"&& ACTION=""#]style="background-color : grey;color:white"[#endif#]>



@@ -81,7 +81,7 @@


<div class="col-md-3">
<select class="form-control" name="vendor_id" onChange="document.frmList_mqtt.submit();">
<select class="form-control" name="vendor_id" onChange="document.frmList_mqtt.submit();" [#if "<#SETTINGS_THEME#>"=="dark"&& ACTION=""#]style="background-color : grey;color:white"[#endif#]>



@@ -96,19 +96,19 @@

<div class="col-md-3">

<select class="form-control" name="group_list_id" onChange="document.frmList_mqtt.submit();">
<select class="form-control" name="group_list_id" onChange="document.frmList_mqtt.submit();" [#if "<#SETTINGS_THEME#>"=="dark"&& ACTION=""#]style="background-color : grey;color:white"[#endif#]>
<option value="0">Устройства (Без групп)
<option value="100500"[#if ID="<#ID#>"#] selected[#endif#]>Группы (Без устройств)
<option value="100500"[#if Z2M_ID="100500"#]>Группы (Без устройств)
[#begin GROUP_LISTS#]
<option value="[#Z2M_ID#]"[#if ID="<#ID#>"#] selected[#endif#]>[#TITLE#]
<option value="[#Z2M_ID#]"[#if Z2M_ID="<#group_list_id#>"#] selected[#endif#]>[#TITLE#]
[#end GROUP_LISTS#]
</select>
</div>


<div class="col-md-3">

<select class="form-control" name="location_id" onChange="document.frmList_mqtt.submit();">
<select class="form-control" name="location_id" onChange="document.frmList_mqtt.submit();" [#if "<#SETTINGS_THEME#>"=="dark"&& ACTION=""#]style="background-color : grey;color:white"[#endif#]>
<option value="0"><#LANG_FILTER_BY_LOCATION#> (<#LANG_ALL#>)
[#begin LOCATIONS#]
<option value="[#ID#]"[#if ID="<#LOCATION_ID#>"#] selected[#endif#]>[#TITLE#]
@@ -117,7 +117,7 @@
</div>



[#if ACTION="" #] <br>[#endif#]



@@ -165,6 +165,18 @@
</div>
</div>

<div class="form-group">
<label class="control-label">
Сохранять только новые значения:

</label>
<div class="controls">
<input type="checkbox" name="enable1" value="1"[#if ENABLE1="1"#] checked[#endif#]>

</div>
</div>



<!-- DEVICE -->
<div class="form-group">

0 comments on commit 84ddf5c

Please sign in to comment.
You can’t perform that action at this time.