Indigo MySQL client deprecated

Posted on
Tue Apr 01, 2008 2:52 pm
dalenis offline
Posts: 123
Joined: Apr 02, 2003
Location: Lunenburg, MA

(No subject)

CharlieParker wrote:
support wrote:
How are you logging the temperature changes to SQLite currently? Are you using Trigger Actions that then execute a script?


No triggers, I run a shell script every 5 minutes to poll my devices and INSERT the current temperature readings into the SQLite db. I use php and JpGraph (a php library) to graph historical temps. Works for me, I'm just looking for other cool ways to use your cool software :D Thanks again.


Charlie,

Do you mind sharing some of your PHP code to query your SQLite db and pass this to JpGraph? I did a bit of playing few years ago with MySQL and JpGraph.... forgot all I learned :oops:

Dale

Posted on
Wed Apr 02, 2008 10:03 am
CharlieParker offline
Posts: 241
Joined: Apr 10, 2006
Location: Lower Hudson Valley

(No subject)

dalenis wrote:
Do you mind sharing some of your PHP code to query your SQLite db and pass this to JpGraph?


Dale,

Here's my php code to draw a graph.

Code: Select all
/*
sqlite> .schema
CREATE TABLE Temps (tempOutside FLOAT, tempBasement FLOAT, time TIMESTAMP );
CREATE INDEX TempsX ON Temps (time);
*/
include ("jpgraph/jpgraph.php");
include ("jpgraph/jpgraph_line.php");

$daysToGraph = $_GET["GoBack"];
$end = "-"  . $daysToGraph . " days";

$db = sqlite_open('/path/to/db/temps.db', 0666, $sqliteerror);
$result = sqlite_query($db, "select * from Temps where time > datetime('now','localtime', '" . $end. "');");   

$i = 0;
$tp = 0;
while ($row = sqlite_fetch_array($result, SQLITE_ASSOC)) {
   $basementTemperatureArray[$i] = $row['tempBasement'];
   $outsideTempArray[$i] = $row['tempOutside'];
   
   // set up tick points - on the hour when graphing a single day
   //     at midnight if graphing more than one day
   $day = substr ($row['time'], 8, 2);
   $hour = substr ($row['time'], 11, 2);
   $minutes = substr ($row['time'], 14, 2);
   if ($daysToGraph == 1) {
      if ( $minutes == "00") {
            $tickpointPositions[$tp] = $i;
            $tickpointNames[$tp] = $hour;   
            $tp++;
      }
   }
   else {
      if (( $hour == "00") and ( $minutes == "00")){
            $tickpointPositions[$tp] = $i;
            $tickpointNames[$tp] = $day;
            $tp++;
      }      
   }
   $i++;   
}

$lineplotBasement=new LinePlot($basementTemperatureArray);
$lineplotBasement->SetColor("blue");
$lineplotOutside=new LinePlot($outsideTempArray);
$lineplotOutside->SetColor("red");

$graph = new Graph(850,280,"auto");   
$graph->SetScale("linlin", 0 , 0 , 0 , $i);
$graph->xaxis->SetTickPositions($tickpointPositions, null, $tickpointNames);
if ($daysToGraph > 1)
   $graph ->xgrid->Show(true);
$graph->Add($lineplotBasement);
$graph->Add($lineplotOutside);
$graph->Stroke();

Posted on
Sun Apr 06, 2008 8:31 pm
barhorn offline
Posts: 4
Joined: Nov 03, 2004

Unfortunately, I'm using MySQL

I realize I'm a bit late responding; I haven't kept up with my RSS reader. But, I just wanted to pitch in my two cents.

I'm currently using the Indigo MySQL client, and unfortunately, I'm not going to be able to use Postgres, nor SQLite. It is integrated into an online web application, and I don't really want to spend all the time and effort to convert everything to a different database backend.

I guess I'll have to go back to using a script to parse the log file via a cron job.

Posted on
Mon Apr 14, 2008 3:44 pm
matt (support) offline
Site Admin
User avatar
Posts: 21427
Joined: Jan 27, 2003
Location: Texas

Re: What about sqlite

dchote wrote:
What about opening up support for sqlite. Pretty much every scripting language out there has support for sqlite. Not to mention its easy to throw together a core data app....

-Dan

The current beta of 2.5 can now log to SQLite.

Regards,
Matt

Posted on
Thu Nov 20, 2008 9:05 am
gg2 offline
Posts: 29
Joined: Apr 16, 2008

Graph of Variable/Parameter History

Matt

You mentioned in this thread, back on April 1 2008, that you were intending to add graphing of historical data to the client. Obviously, with the popularity of Venstar (Temperature monitoring/control) it would be very useful to be able see historical temperature data, thermostat on/off state (plus outside temperature). Do you intend to develop this, or do you have a suggestion for an alternative solution?

Yours, Rick

Posted on
Thu Nov 20, 2008 12:35 pm
Martijn Heeroma offline
Posts: 189
Joined: Oct 24, 2007

(No subject)

Here's my php code to draw a graph.


Cool, thnx for the code

Posted on
Thu Nov 20, 2008 2:08 pm
matt (support) offline
Site Admin
User avatar
Posts: 21427
Joined: Jan 27, 2003
Location: Texas

Re: Graph of Variable/Parameter History

Hi Rick,

I am interested in doing this, but it won't be making it into the next major version of Indigo. I did some experimenting with using the Google Chart API, but I'm not sure that I want to rely on an external charting engine. This is definitely an area where a 3rd party developer could create an Indigo Web Server plug-in which generates the chart based on the SQLite, PostgreSQL, or MySQL data and returns it via Indigo's Web Server.

Image

Posted on
Wed Aug 28, 2013 7:13 am
PME999 offline
Posts: 54
Joined: Jul 28, 2012

Re: Indigo MySQL client deprecated

Hello
I'm using indigo6 with x10, rfxcom, current cost and Vera modules.
I would like to follow some graphs of variable values from indigo with a simple solution without complicated programming (not able to do it)
I tried since weeks to find solutions but without success.
I understand it will maybe be a feature of next indigo (7?!) but anybody can help me before ...
Thanks a lot
Patrice

Posted on
Sat Jun 28, 2014 10:56 am
MacDefender offline
Posts: 33
Joined: Oct 02, 2013
Location: Germany

Re: Indigo MySQL client deprecated

Any chance to see MySQL support again in Indigo?
Also PostgreSQL is easy to install under MacOS nearly all servers come with MySQL installed. Even my QNAP NAS has MySQL installed and support for MySQL is much better than for PostgreSQL installations.

For example I can't install PostgreSQL on my QNAP with QTS4.1 due to slow support for PostgreSQL packages. So I can't use the NAS for logging and handling the data there.
And all the virtual servers we can rent here come with MYSQL installed and no ready to install option for PostgreSQL there although it would be possible to install it manual.

Maybe an optional plugin for MySQL connections? No need to supply any MySQL components as the server is already existent on all these servers/NAS systems. Just a SQL connection to these servers?

Posted on
Sun Jun 29, 2014 10:05 am
matt (support) offline
Site Admin
User avatar
Posts: 21427
Joined: Jan 27, 2003
Location: Texas

Re: Indigo MySQL client deprecated

I'll add it to the feature request list, but given the time involved to implement it (more than a couple of hours) I'm not sure if it will make it near the top of the list anytime soon. If a third party wants to create a plugin that does it, of course, that would be another possibility.

Image

Who is online

Users browsing this forum: No registered users and 4 guests