Page 6 of 13

Re: fuTelldus - PHP application for sensor-logging

Posted: Fri Mar 17, 2023 9:45 am
by turbosnute
Great application and it looks beautiful!

I agree with kringon, it would be nice if others also could join the development.

I would love to see some event system.

Re: fuTelldus - PHP application for sensor-logging

Posted: Fri Mar 17, 2023 9:45 am
by jnsfi
I'm also interested to join development and I am currently doing touch screen UI over fuTelldus. :)

Image

Image

Image

Re: fuTelldus - PHP application for sensor-logging

Posted: Fri Mar 17, 2023 9:45 am
by free30
JohanS wrote: Here I leave place for instructions on how to install fuTelldus on a Raspberry PI from scratch.
...
For those who wants to try this with our own server (raspberry pi works GREAT) here are the steps. If there is time I will uptdate this to include all steps etc. etc. this is just a ROUGH guide...
...
NOTE THIS IS NOT WORKING FOR ME YET!!!!
Hi any chance you'd look at doing your complete guide ?
I'm mostly understand windows and could do with clear instructions installing this on a Raspberry Pi from scratch.

Re: fuTelldus - PHP application for sensor-logging

Posted: Fri Mar 17, 2023 9:45 am
by log
I'd like combine the graphs in highcharts to include all temp-sensors in one graph. Preferably on the public page. Any know how do solve this?

Re: fuTelldus - PHP application for sensor-logging

Posted: Fri Mar 17, 2023 9:45 am
by dico
Hi all!

First off all I must say that the front-end looks beautiful jnsfi !

I am sorry for my absence on this project lately. I just started up a new developing company with some friends, and we are currently in release of a couple of commercial products. Therefore, I just have to prioritize the projects that would give me some income :-)

However, I really hope those of you who are developer’s take this project further. I already see there is contributors on GitHub, and that is great!

Re: fuTelldus - PHP application for sensor-logging

Posted: Fri Mar 17, 2023 9:45 am
by penol
jnsfi wrote:I'm also interested to join development and I am currently doing touch screen UI over fuTelldus. :)

Image

Image

Image
When will this be released to the public?

Re: fuTelldus - PHP application for sensor-logging

Posted: Fri Mar 17, 2023 9:45 am
by comaglove
Thank you for this wonderful php app. I wonder if it is possible to combine temperature and humidity in highcharts?

/ Emil

Re: fuTelldus - PHP application for sensor-logging

Posted: Fri Mar 17, 2023 9:45 am
by hulttis
Thanks for great app!

Re: fuTelldus - PHP application for sensor-logging

Posted: Fri Mar 17, 2023 9:45 am
by hulttis
comaglove wrote:Thank you for this wonderful php app. I wonder if it is possible to combine temperature and humidity in highcharts?

/ Emil
Yes, it is!

Re: fuTelldus - PHP application for sensor-logging

Posted: Fri Mar 17, 2023 9:45 am
by comaglove
hulttis wrote:
comaglove wrote:Thank you for this wonderful php app. I wonder if it is possible to combine temperature and humidity in highcharts?

/ Emil
Yes, it is!
Thanks for the information!

Re: fuTelldus - PHP application for sensor-logging

Posted: Fri Mar 17, 2023 9:45 am
by comaglove
hulttis wrote:
comaglove wrote:Thank you for this wonderful php app. I wonder if it is possible to combine temperature and humidity in highcharts?

/ Emil
Yes, it is!
Can you explain how?

Re: fuTelldus - PHP application for sensor-logging

Posted: Fri Mar 17, 2023 9:45 am
by Nautilus
Baltta wrote:hey, I try install synology NAS. I get it all most right. But cron job don't work only manually.
When I try that "Setting up CRON on synology DSM" it stop over here. In error line 13

DiskStation> /usr/bin/php /volume1/web/futelldus/cron_temp_log.php
PHP Fatal error: Class 'Mysqli' not found in /volume1/web/futelldus/cron_temp_log.php on line 13

Fatal error: Class 'Mysqli' not found in /volume1/web/futelldus/cron_temp_log.php on line 13
Hi,

just installed fuTelldus and had the exact same problem with my Qnap ts259 NAS. I then read somewhere that Qnap's php does not support Mysqli, but that was a rather old post so not sure if it's like that anymore. Anyhow, I was able to overcome it by changing to wget instead of php so I just added the line to cron like "/usr/bin/wget -q http://<server>/Web/FuTelldus/cron_temp_log.php" and it works now.

At least one problem I've noticed is the highcharts time, which is off by -2 hours. I read in earlier posts there had been similar issues but it should've been resolved with the UTC setting. I checked and the setting is there, still the time is off. Any suggestions? RGraph is showing a correct time.

Edit: Just found out that the UTC setting was not implemented so after adding that it is now in correct time..

Also, I noticed that the development is moved to GitHub from dico's site (from where I downloaded version 3). I was only able to find the currently 7 months old files from GitHub which I assume are the same as I dowloaded (at least according to readme), is there some newer ones available somewhere with maybe some of the enhancements mentioned here already included? I found the site a bit hard to navigate..:)

And last but not least, thanks a lot for dico, this is an excellent addition to every telldus setup with temperature sensors!

Re: fuTelldus - PHP application for sensor-logging

Posted: Fri Mar 17, 2023 9:45 am
by dumbo
Would someone be so kind as to explain how to combine temperature and humidity in highcharts?

Re: fuTelldus - PHP application for sensor-logging

Posted: Fri Mar 17, 2023 9:45 am
by anunis
hi
this app seems cool and fitting my needs, however i can't make it works with Tellprox (https://github.com/p3tecracknell/tellprox/). Did someone already successed ?
Tellprox is running well on :8080, i may retrieve sensors informations throught http://myip:8080/xml/sensor/info?key=mykey&id=42
In fuTelldus i updated in lib/base.inc.php the field define('URL', 'http://api.telldus.com'); to http://myip:8080
The configuration keys and tocken are set with 'mykey'.
Then i can't see any sensors in Sensors tab as i would expect.


edit : i partialy answer myself :
- when i put an empty api key on tellprox side, data may be retrieve from futelldus. Is this the normal behaviour ?
- once communication between tellprox and futelldus was established, i could get sensors list, last measure update, but not the measurement. I dont know if this is a bug or if it's something related with my configuration but the XML 'data' markup seems to be uncorrectly handle, i have to to the following changes in inc/sensors_data.php to make it works:

Code: Select all

                                        //echo "<td>".$xmldata->data[0]['value']."</td>";
                                        echo "<td>".$xmldata->data[0]->children()[1]."</td>";
                                       //echo "<td>".$xmldata->data[1]['value']."</td>";
                                        echo "<td>".$xmldata->data[1]->children()[1]."</td>";
and this change in cron_temp_log.php to handle temperature and humidity sensors :

Code: Select all

                        //$tempValue            = trim($xml->data[0]['value']);
                        //$humidityValue        = trim($xml->data[1]['value']);

                        $tempValue            = trim($xml->data[0]->children()[1]);
                        if (sizeof($xml->data) > 1)
                        {
                                $humidityValue        = trim($xml->data[1]->children()[1]);
                        }
                        else
                        {
                                $humidityValue        = 0;
                        }

Re: fuTelldus - PHP application for sensor-logging

Posted: Fri Mar 17, 2023 9:45 am
by Jesa
dumbo wrote:Would someone be so kind as to explain how to combine temperature and humidity in highcharts?
I have modified fuTelldus/inc/chart_highchart.php, and added some comments to show what changes I have done. There might be more changes than whats commented.

If one of the values is constant for the period selected there is no yAxis value (don't know how to fix this)

Hope this helps :-)

Jesa

Code: Select all

<script src="lib/packages/Highstock-1.3.1/js/highstock.js"></script>
<script src="lib/packages/Highstock-1.3.1/js/modules/exporting.js"></script>

<?php

	// Set how long back you want to pull data
    $showFromDate = time() - 86400 * $config['chart_max_days']; // 86400 => 24 hours * 10 days


    /* TEMP SENSOR 01: Get sensors
    --------------------------------------------------------------------------- */
    $query = "SELECT * FROM ".$db_prefix."sensors WHERE user_id='{$user['user_id']}' AND monitoring='1'";
    $result = $mysqli->query($query);

    while ($row = $result->fetch_array()) {

    	echo "<div class='well'>";

        unset($temp_values);
        $joinValues = "";
        unset($hum_values);		// added humidity variables
        $humValues = "";		// added humidity variables


        /* Get sensordata and generate graph
        --------------------------------------------------------------------------- */
        $queryS = "SELECT * FROM ".$db_prefix."sensors_log WHERE sensor_id='{$row["sensor_id"]}' AND time_updated > '$showFromDate' ORDER BY time_updated ASC";
        $resultS = $mysqli->query($queryS);

        
        while ($sensorData = $resultS->fetch_array()) {
            $db_tempValue = trim($sensorData["temp_value"]);
			$db_humValue = trim($sensorData["humidity_value"]);		//retrive humidity values

            $timeJS = $sensorData["time_updated"] * 1000;
            $temp_values[]        = "[" . $timeJS . "," . round($db_tempValue, 2) . "]";
			$hum_values[]         = "[" . $timeJS . "," . round($db_humValue, 2) . "]";		// do something with values
        }


        $joinValues = join($temp_values, ',');
        $joinhumValues = join($hum_values, ',');		// do something more with values


echo <<<end
<script type="text/javascript">

$(function() {
	$('#{$row["sensor_id"]}').highcharts('StockChart', {
		

		chart: { height: 600		// changed hight to make more space
		},

		title: {
            text: '{$row["name"]}'
        },

		rangeSelector: {
			enabled: true,
			buttons: [{
				type: 'hour',
				count: 1,
				text: '1h'
			},{
				type: 'hour',
				count: 12,
				text: '12h'
			},{
				type: 'day',
				count: 1,
				text: '1d'
			},{
				type: 'week',
				count: 1,
				text: '1w'
			}, {
				type: 'month',
				count: 1,
				text: '1m'
			}, {
				type: 'month',
				count: 6,
				text: '6m'
			}, {
				type: 'year',
				count: 1,
				text: '1y'
			}, {
				type: 'all',
				text: 'All'
			}],
			selected: 2
		},


        legend: {
			align: "center",
			layout: "horizontal",
			enabled: true,
			verticalAlign: "bottom",
		},

		yAxis: [{
			title: {
				text: 'Temperature (°C)',
			},
			labels: {
			    formatter: function() {
					return this.value + '\u00B0C';
			    },
				format: '{value}°C',
			    style: {
					color: '#777'
			    }
			},
			height: 260,			// set manual hight for temperature
		}, {
			title: {						// added humidity yAxis
				text: 'Humidity (%)',
				style: {color: '#31EBB3'}	// set manual color for yAxis humidity
			},
			labels: {						
			    formatter: function() {
					return this.value +'%';
			    },
				format: '{value}%',
			    style: {
					color: '#777'
			    }
			},
			top: 335,						//positioned humidity below temperature 
			height: 120,					// set manual hight for humidity
			offset: 0,						//lining humidity yAxis label upto temperature
		    
		}],

		series: [{
			name: 'Temperature',
			data: [$joinValues],
			type: 'spline',
			tooltip: {
				valueDecimals: 1, valueSuffix: '°C'
			}
		},{
			name: 'Humidity',				// added humidity as xAxis data
			data: [$joinhumValues],
			color: '#31EBB3',				// set graf color to the same as yAxis label
			type: 'spline',
			yAxis: 1,						// connecting humdity data to yAxis
			tooltip: {
				valueDecimals: 1, valueSuffix: '%'
			}
			
		}],

		// tooltip: {						// seperate tooltips set i data series
	    //    valueSuffix: '°C'
	    // },

		xAxis: {
			type: 'datetime',
		}, 

		 
	});
});

</script>

<div id="{$row["sensor_id"]}" style="height: 600px; min-width: 500px"></div>		
end;
	// changed height to match graf height

	echo "</div>";

    }

?>