Page 1 of 1

Lcd4linux MySQL plugin with Domotiga

Posted: Mon Nov 07, 2011 9:14 pm
by djrm
Greetings,

I have a small backlit monochrome graphic Pico LCD display module of 256x64 bit resolution and have now got it to display DOmotiga sensor data using the MySQL plugin of Lcd4linux, I had been wondering how to achieve this for some time but found this was a very easy way to get some results.

The method is described on the lcd4linux wiki site here ssl.bulix.org/projects/lcd4linux/wiki/p ... ugin_mysql I have added some device widgets into my lcd4linux.conf file likethis:

Code: Select all

Widget MySQLupdated {
    class 'Text'
    expression MySQL::query('SELECT lastseen FROM devices WHERE id=57')
    width 20
    align 'L'
    update minute
}
The id number is found on the devices page of the Domotiga gui, that and more information is visible in the devices database.

Widget MySQLinside {
    class 'Text'
    expression MySQL::query('SELECT value FROM devices WHERE id=57') .' ' . MySQL::query('SELECT label FROM devices WHERE id=57')
    width 20
    align 'R'
    prefix 'Inside:'
    update minute
}
The widgets are used by the layout definition like this:

Code: Select all

Layout DOMOTIGA {
    Row1 {
	Col1  'MySQLupdated'
    }
    Row2 {
	Col1  'MySQLinside'
    }
...
This has run all day now on my arm system without problems.

Here is an image of the output, including a little Domotiga image too.
Image

Next task is to integrate a notify feature somhow, I'm looking at using the lcd4linux fifo feature for this but to do that will need some code modification to DomotiGa. I'll try and make line to show the last phone caller in a similar way too. The PipcoLCD Graphic display module has some buttons by the side of it, I may use them for something too. That is why the xwindow image has some simulated buttons on it.

hth David.

Re: Lcd4linux MySQL plugin with Domotiga

Posted: Wed Nov 16, 2011 8:31 am
by djrm
The mysql plugin definition got missed out, it is part of the lcd4linux.conf file ...

Code: Select all

Plugin MySQL {
#    server '192.168.2.x'	# if none, localhost assumed
#    port 3306			# if none, MySQL default assumed
    user 'domox'		# if none, lcd4linux unix owner assumed
    password 'kungx'		# if none, empty password assumed
    database 'domotiga'		# MUST be specified
}