Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Can I get webserver to show a temperature graph?

If you have a question or need help, this is the place to be.
Post Reply
Pallantir
Posts: 41
Joined: Mon May 14, 2012 6:41 pm

Can I get webserver to show a temperature graph?

Post by Pallantir »

I have a bunch of temperature sensors, in almost every room in the house and the cabin, and I would like to be able to see in the webserver page how the temperature has changed over time on a few of them (mainly outdoors and indoors at the cabin when we're not there). At the moment the server shows the current temperature, but I have no idea how to creat a graph for this. Is there any code anywhere that can help me do that?
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Can I get webserver to show a temperature graph?

Post by krambriw »

There are several ways doing this. I personally use SwitchKing (SK) in a test drive since a while.

I have configured a data source in SK for each sensor of interest. Then I am using the SwitchKing plugin for EG to send data via the REST interface.

Below is a picture from SK showing one of my sensors ( a modified one for measuring the light level). Also below, see some screens as well as the python script from my EG configuration.
Image8.jpg
Below, configuring the SwitchKing plugin for EG
Image4.jpg
Define a macro that captures the event and evaluate, format and send to SK
Image6.jpg
Image6.jpg (5.88 KiB) Viewed 2112 times
The script

Code: Select all

def eventHandler(base, pload):
    try:
        if str(base).find('THGN122/123, THGN132, THGR122/228/238/268 id: 7940') > -1 :
            m = str(pload).split(' ')
            h = str(m[6])
            #print h
            eg.plugins.SwitchkingTellStick.DSSet(u'', u'Ljussensor', h, 0)

    except:
        pass


eg.event.suffix_copy = eg.event.suffix
eg.event.payload_copy = eg.event.payload

eventHandler(eg.event.suffix_copy, eg.event.payload_copy)

Best regards,Walter
Pallantir
Posts: 41
Joined: Mon May 14, 2012 6:41 pm

Re: Can I get webserver to show a temperature graph?

Post by Pallantir »

Thank you very much! I'm going to play with this in the weekend. :D
Post Reply