From c87ae1e4bf3822319a3bd4bcc41a5c0de67973b5 Mon Sep 17 00:00:00 2001 From: Matthew Horwood Date: Sat, 13 Jul 2024 13:11:22 +0100 Subject: [PATCH] bug: set the value --- src/model/data.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/model/data.php b/src/model/data.php index 4c27453..a2ef776 100644 --- a/src/model/data.php +++ b/src/model/data.php @@ -92,10 +92,12 @@ public function process_data($mqtt_topic, $foxess_data, $collected_data, $total_ } }elseif(array_key_exists('unit', $collected_data[$device]['result'][0]['datas'][$i]) === false){ // Text values + $data = $collected_data[$device]['result'][0]['datas'][$i]; $this->mqtt->post_mqtt(''.$mqtt_topic.'/'.$deviceSN.'/'.$name, $data['value']); $this->log('Post '.$data['value'].' of '.$name.' to MQTT', 1); }elseif(strstr($option, 'currentFault') !== false || strstr($option, 'currentFaultCount') !== false){ // only Faults + $data = $collected_data[$device]['result'][0]['datas'][$i]; $this->mqtt->post_mqtt(''.$mqtt_topic.'/'.$deviceSN.'/'.$name, $data['value']); $this->log('Post '.$data['value'].' of '.$name.' to MQTT', 1); }elseif(strstr($option, 'runningState') !== false){ // only runningState