Korey wrote:Hey Dave!
Seems like this should a a new option from within your plug in! (Create Graphic)
Heh....don't give me any ideas!
Dave
Korey wrote:Hey Dave!
Seems like this should a a new option from within your plug in! (Create Graphic)
DaveL17 wrote:Korey wrote:Hey Dave!
Seems like this should a a new option from within your plug in! (Create Graphic)
Heh....don't give me any ideas!
Dave
Too late.. Looks like you'll be burning the midnight oil again
#! /usr/bin/env gnuplot
reset
set terminal pngcairo enhanced background "#000000" font "Lato-Light,9" linewidth 1 rounded size 600,200
set output "/Users/TV/10DayForecast.png"
dataFileForecast = "/Users/TV/10DayForecast.csv"
set datafile separator ','
set timefmt "%Y-%m-%d"
stats dataFileForecast using 2:4 nooutput
freezeWarning = 32.
Yhigh = STATS_max_x + 10.
Ylow = STATS_min_y - 10.
freezeLabel = ((freezeWarning-Ylow) / (Yhigh-Ylow))
unset key
set border linetype rgb "#666666"
set boxwidth 0.25 relative
set style fill transparent solid 0.4
set style line 1 linetype rgb "#0066CC"
set style line 2 linetype rgb "#FFFFFF" pointtype 7 pointsize .5
set style line 3 linetype rgb "#666666"
set style line 4 linetype rgb "#FFFF00"
set style line 5 linetype rgb "#333333"
set label "°" right
unset mxtics
set tics textcolor rgb "#666666"
# X Axis
set xdata time
set xtics format "%a" nomirror
set autoscale xfix
set offsets 12*60*60,12*60*60,0,0
# Y Axis
set ytics format "%2f°" nomirror
set yrange [Ylow:Yhigh]
unset ytics
if (32 > Ylow) set label "32°" at graph 0.01,freezeLabel tc rgb "#FFFFFF" font ",8"
# Y2 Axis
set y2tics format "%2.0f%%" nomirror
set y2range [0:100]
plot dataFileForecast using 1:6 with impulses linestyle 4 axes x1y2,\
dataFileForecast using 1:2 with freezeWarning with lines linestyle 1 axes x1y1,\
dataFileForecast using 1:2 with points linestyle 2 axes x1y1,\
dataFileForecast using 1:2:3 with labels offset 1.75,0.5 textcolor "#FFFFFF" font ",8" axes x1y1,\
dataFileForecast using 1:4 with freezeWarning with lines linestyle 1 axes x1y1,\
dataFileForecast using 1:4 with points linestyle 2 axes x1y1,\
dataFileForecast using 1:4:5 with labels offset 1.75,0.5 textcolor "#FFFFFF" font ",8" axes x1y1,\
freezeWarning with freezeWarning with lines linestyle 1 axes x1y1
Same result using the modified script.
#! /usr/bin/env gnuplot
reset
set terminal pngcairo enhanced background "#000000" font "Lato-Light,9" linewidth 1 rounded size 600,200
set output "/Users/TV/10DayForecast.png"
dataFileForecast = "/Users/TV/10DayForecast.csv"
set datafile separator ','
set timefmt "%Y-%m-%d"
stats dataFileForecast using 2:4 nooutput
freezeWarning = 32.
Yhigh = STATS_max_x + 10.
Ylow = STATS_min_y - 10.
freezeLabel = ((freezeWarning-Ylow) / (Yhigh-Ylow))
unset key
set border linetype rgb "#666666"
set boxwidth 0.25 relative
set style fill transparent solid 0.4
set style line 1 linetype rgb "#0066CC"
set style line 2 linetype rgb "#FFFFFF" pointtype 7 pointsize .5
set style line 3 linetype rgb "#666666"
set style line 4 linetype rgb "#FFFF00"
set style line 5 linetype rgb "#333333"
set label "°" right
unset mxtics
set tics textcolor rgb "#666666"
# X Axis
set xdata time
set xtics format "%a" nomirror
set autoscale xfix
set offsets 12*60*60,12*60*60,0,0
# Y Axis
set ytics format "%2f°" nomirror
set yrange [Ylow:Yhigh]
unset ytics
if (32 > Ylow) set label "32°" at graph 0.01,freezeLabel tc rgb "#FFFFFF" font ",8"
# Y2 Axis
set y2tics format "%2.0f%%" nomirror
set y2range [0:100]
plot dataFileForecast using 1:4 with lines
Seems we have a winner.
#! /usr/bin/env python2.6
# -*- coding: utf-8 -*-
import os.path
from os import system
csvFilePath = "/Users/TV/10DayForecast.csv"
dateTime = str(indigo.server.getTime())
day1 = str(indigo.devices[665976433].states["maxTemp2ndDay"])
day2 = str(indigo.devices[665976433].states["maxTemp3rdDay"])
day3 = str(indigo.devices[665976433].states["maxTemp4thDay"])
day4 = str(indigo.devices[665976433].states["maxTemp5thDay"])
day5 = str(indigo.devices[665976433].states["maxTemp6thDay"])
day6 = str(indigo.devices[665976433].states["maxTemp4thDay"])
day7 = str(indigo.devices[665976433].states["maxTemp4thDay"])
day8 = str(indigo.devices[665976433].states["maxTemp4thDay"])
day9 = str(indigo.devices[665976433].states["maxTemp4thDay"])
day10 = str(indigo.devices[665976433].states["maxTemp4thDay"])
highTemp1 = str(int(indigo.devices[665976433].states["maxTempToday"]))
highTemp2 = str(int(indigo.devices[665976433].states["maxTempToday"]))
highTemp3 = str(int(indigo.devices[665976433].states["maxTempToday"]))
highTemp4 = str(int(indigo.devices[665976433].states["maxTempToday"]))
highTemp5 = str(int(indigo.devices[665976433].states["maxTempToday"]))
highTemp6 = str(int(indigo.devices[665976433].states["maxTempToday"]))
highTemp7 = str(int(indigo.devices[665976433].states["maxTempToday"]))
highTemp8 = str(int(indigo.devices[665976433].states["maxTempToday"]))
highTemp9 = str(int(indigo.devices[665976433].states["maxTempToday"]))
highTemp10 = str(int(indigo.devices[665976433].states["maxTempToday"]))
lowTemp1 = str(int(indigo.devices[665976433].states["maxTempToday"]))
lowTemp2 = str(int(indigo.devices[665976433].states["maxTempToday"]))
lowTemp3 = str(int(indigo.devices[665976433].states["maxTempToday"]))
lowTemp4 = str(int(indigo.devices[665976433].states["maxTempToday"]))
lowTemp5 = str(int(indigo.devices[665976433].states["maxTempToday"]))
lowTemp6 = str(int(indigo.devices[665976433].states["maxTempToday"]))
lowTemp7 = str(int(indigo.devices[665976433].states["maxTempToday"]))
lowTemp8 = str(int(indigo.devices[665976433].states["maxTempToday"]))
lowTemp9 = str(int(indigo.devices[665976433].states["maxTempToday"]))
lowTemp10 = str(int(indigo.devices[665976433].states["maxTempToday"]))
precip1 = str(indigo.devices[665976433].states["maxTemp4thDay"])
precip2 = str(indigo.devices[665976433].states["maxTemp4thDay"])
precip3 = str(indigo.devices[665976433].states["maxTemp4thDay"])
precip4 = str(indigo.devices[665976433].states["maxTemp4thDay"])
precip5 = str(indigo.devices[665976433].states["maxTemp4thDay"])
precip6 = str(indigo.devices[665976433].states["maxTemp4thDay"])
precip7 = str(indigo.devices[665976433].states["maxTemp4thDay"])
precip8 = str(indigo.devices[665976433].states["maxTemp4thDay"])
precip9 = str(indigo.devices[665976433].states["maxTemp4thDay"])
precip10 = str(indigo.devices[665976433].states["maxTemp4thDay"])
csvFile = open(csvFilePath, "w")
element = (day1 + "," + highTemp1 + "," + highTemp1 + "°," + lowTemp1 + "," + lowTemp1 + "°," + precip1 + "\n" +
day2 + "," + highTemp2 + "," + highTemp2 + "°," + lowTemp2 + "," + lowTemp2 + "°," + precip2 + "\n" +
day3 + "," + highTemp3 + "," + highTemp3 + "°," + lowTemp3 + "," + lowTemp3 + "°," + precip3 + "\n" +
day4 + "," + highTemp4 + "," + highTemp4 + "°," + lowTemp4 + "," + lowTemp4 + "°," + precip4 + "\n" +
day5 + "," + highTemp5 + "," + highTemp5 + "°," + lowTemp5 + "," + lowTemp5 + "°," + precip5 + "\n" +
day6 + "," + highTemp6 + "," + highTemp6 + "°," + lowTemp6 + "," + lowTemp6 + "°," + precip6 + "\n" +
day7 + "," + highTemp7 + "," + highTemp7 + "°," + lowTemp7 + "," + lowTemp7 + "°," + precip7 + "\n" +
day8 + "," + highTemp8 + "," + highTemp8 + "°," + lowTemp8 + "," + lowTemp8 + "°," + precip8 + "\n" +
day9 + "," + highTemp9 + "," + highTemp9 + "°," + lowTemp9 + "," + lowTemp9 + "°," + precip9 + "\n" +
day10 + "," + highTemp10 + "," + highTemp10 + "°," + lowTemp10 + "," + lowTemp10 + "°," + precip10)
csvFile.write(element)
csvFile.close()
system('/opt/local/bin/gnuplot /Library/Application\ Support/Perceptive\ Automation/Indigo\ 6/Scripts/10DayForecast.gp')
#! /usr/bin/env python2.6
# -*- coding: utf-8 -*-
import os.path
from os import system
csvFilePath = "/Users/TV/10DayForecast.csv"
dateTime = str(indigo.server.getTime())
day1 = str(indigo.devices[665976433].states["d01_date"])
day2 = str(indigo.devices[665976433].states["d02_date"])
day3 = str(indigo.devices[665976433].states["d03_date"])
day4 = str(indigo.devices[665976433].states["d04_date"])
day5 = str(indigo.devices[665976433].states["d05_date"])
day6 = str(indigo.devices[665976433].states["d06_date"])
day7 = str(indigo.devices[665976433].states["d07_date"])
day8 = str(indigo.devices[665976433].states["d08_date"])
day9 = str(indigo.devices[665976433].states["d09_date"])
day10 = str(indigo.devices[665976433].states["d10_date"])
highTemp1 = str(int(indigo.devices[665976433].states["d01_high"]))
highTemp2 = str(int(indigo.devices[665976433].states["d02_high"]))
highTemp3 = str(int(indigo.devices[665976433].states["d03_high"]))
highTemp4 = str(int(indigo.devices[665976433].states["d04_high"]))
highTemp5 = str(int(indigo.devices[665976433].states["d05_high"]))
highTemp6 = str(int(indigo.devices[665976433].states["d06_high"]))
highTemp7 = str(int(indigo.devices[665976433].states["d07_high"]))
highTemp8 = str(int(indigo.devices[665976433].states["d08_high"]))
highTemp9 = str(int(indigo.devices[665976433].states["d09_high"]))
highTemp10 = str(int(indigo.devices[665976433].states["d10_high"]))
lowTemp1 = str(int(indigo.devices[665976433].states["d01_low"]))
lowTemp2 = str(int(indigo.devices[665976433].states["d02_low"]))
lowTemp3 = str(int(indigo.devices[665976433].states["d03_low"]))
lowTemp4 = str(int(indigo.devices[665976433].states["d04_low"]))
lowTemp5 = str(int(indigo.devices[665976433].states["d05_low"]))
lowTemp6 = str(int(indigo.devices[665976433].states["d06_low"]))
lowTemp7 = str(int(indigo.devices[665976433].states["d07_low"]))
lowTemp8 = str(int(indigo.devices[665976433].states["d08_low"]))
lowTemp9 = str(int(indigo.devices[665976433].states["d09_low"]))
lowTemp10 = str(int(indigo.devices[665976433].states["d10_low"]))
precip1 = str(indigo.devices[665976433].states["d01_pop"])
precip2 = str(indigo.devices[665976433].states["d02_pop"])
precip3 = str(indigo.devices[665976433].states["d03_pop"])
precip4 = str(indigo.devices[665976433].states["d04_pop"])
precip5 = str(indigo.devices[665976433].states["d05_pop"])
precip6 = str(indigo.devices[665976433].states["d06_pop"])
precip7 = str(indigo.devices[665976433].states["d07_pop"])
precip8 = str(indigo.devices[665976433].states["d08_pop"])
precip9 = str(indigo.devices[665976433].states["d09_pop"])
precip10 = str(indigo.devices[665976433].states["d10_pop"])
csvFile = open(csvFilePath, "w")
element = (day1 + "," + highTemp1 + "," + highTemp1 + "°," + lowTemp1 + "," + lowTemp1 + "°," + precip1 + "\n" +
day2 + "," + highTemp2 + "," + highTemp2 + "°," + lowTemp2 + "," + lowTemp2 + "°," + precip2 + "\n" +
day3 + "," + highTemp3 + "," + highTemp3 + "°," + lowTemp3 + "," + lowTemp3 + "°," + precip3 + "\n" +
day4 + "," + highTemp4 + "," + highTemp4 + "°," + lowTemp4 + "," + lowTemp4 + "°," + precip4 + "\n" +
day5 + "," + highTemp5 + "," + highTemp5 + "°," + lowTemp5 + "," + lowTemp5 + "°," + precip5 + "\n" +
day6 + "," + highTemp6 + "," + highTemp6 + "°," + lowTemp6 + "," + lowTemp6 + "°," + precip6 + "\n" +
day7 + "," + highTemp7 + "," + highTemp7 + "°," + lowTemp7 + "," + lowTemp7 + "°," + precip7 + "\n" +
day8 + "," + highTemp8 + "," + highTemp8 + "°," + lowTemp8 + "," + lowTemp8 + "°," + precip8 + "\n" +
day9 + "," + highTemp9 + "," + highTemp9 + "°," + lowTemp9 + "," + lowTemp9 + "°," + precip9 + "\n" +
day10 + "," + highTemp10 + "," + highTemp10 + "°," + lowTemp10 + "," + lowTemp10 + "°," + precip10)
csvFile.write(element)
csvFile.close()
system('/opt/local/bin/gnuplot /Library/Application\ Support/Perceptive\ Automation/Indigo\ 6/Scripts/10DayForecast.gp')
#! /usr/bin/env gnuplot
reset
set terminal pngcairo enhanced background "#000000" font "Lato-Light,9" linewidth 1 rounded size 600,200
set output "/Users/TV/10DayForecast.png"
dataFileForecast = "/Users/TV/10DayForecast.csv"
set datafile separator ','
set timefmt "%Y-%m-%d"
stats dataFileForecast using 2:4 nooutput
freezeWarning = 32.
Yhigh = STATS_max_x + 10.
Ylow = STATS_min_y - 10.
freezeLabel = ((freezeWarning-Ylow) / (Yhigh-Ylow))
unset key
set border linetype rgb "#666666"
set boxwidth 0.25 relative
set style fill transparent solid 0.4
set style line 1 linetype rgb "#0066CC"
set style line 2 linetype rgb "#FFFFFF" pointtype 7 pointsize .5
set style line 3 linetype rgb "#666666"
set style line 4 linetype rgb "#FFFF00"
set style line 5 linetype rgb "#333333"
set label "°" right
unset mxtics
set tics textcolor rgb "#666666"
# X Axis
set xdata time
set xtics format "%a" nomirror
set autoscale xfix
set offsets 12*60*60,12*60*60,0,0
# Y Axis
set ytics format "%2f°" nomirror
set yrange [Ylow:Yhigh]
unset ytics
if (32 > Ylow) set label "32°" at graph 0.01,freezeLabel tc rgb "#FFFFFF" font ",8"
# Y2 Axis
set y2tics format "%2.0f%%" nomirror
set y2range [0:100]
plot dataFileForecast using 1:4 with lines
#! /usr/bin/env gnuplot
# -*- coding: utf-8 -*-
reset
set terminal pngcairo enhanced background "#000000" font "Lato-Light,9" linewidth 1 rounded size 600,200
set output "/Users/TV/10DayForecast.png"
dataFileForecast = "/Users/TV/10DayForecast.csv"
set datafile separator ','
set timefmt "%Y-%m-%d"
stats dataFileForecast using 2:4 nooutput
freezeWarning = 32.
Yhigh = STATS_max_x + 10.
Ylow = STATS_min_y - 10.
freezeLabel = ((freezeWarning-Ylow) / (Yhigh-Ylow))
unset key
set border linetype rgb "#666666"
set boxwidth 0.25 relative
set style fill transparent solid 0.4
set style line 1 linetype rgb "#0066CC"
set style line 2 linetype rgb "#FFFFFF" pointtype 7 pointsize .5
set style line 3 linetype rgb "#666666"
set style line 4 linetype rgb "#FFFF00"
set style line 5 linetype rgb "#333333"
set label "°" right
unset mxtics
set tics textcolor rgb "#666666"
# X Axis
set xdata time
set xtics format "%a" nomirror
set autoscale xfix
set offsets 12*60*60,12*60*60,0,0
# Y Axis
set ytics format "%2f°" nomirror
set yrange [Ylow:Yhigh]
unset ytics
if (32 > Ylow) set label "32°" at graph 0.01,freezeLabel tc rgb "#FFFFFF" font ",8"
# Y2 Axis
set y2tics format "%2.0f%%" nomirror
set y2range [0:100]
plot dataFileForecast using 1:2 with lines,\
dataFileForecast using 1:4 with lines,\
freezeWarning with lines
#! /usr/bin/env gnuplot
# -*- coding: utf-8 -*-
reset
set terminal pngcairo enhanced background "#000000" font "Lato-Light,9" linewidth 1 rounded size 600,200
set output "/Users/TV/10DayForecast.png"
dataFileForecast = "/Users/TV/10DayForecast.csv"
set datafile separator ','
set timefmt "%Y-%m-%d"
stats dataFileForecast using 2:4 nooutput
freezeWarning = 32.
Yhigh = STATS_max_x + 10.
Ylow = STATS_min_y - 10.
freezeLabel = ((freezeWarning-Ylow) / (Yhigh-Ylow))
unset key
set border linetype rgb "#666666"
set boxwidth 0.25 relative
set style fill transparent solid 0.4
set style line 1 linetype rgb "#0066CC"
set style line 2 linetype rgb "#FFFFFF" pointtype 7 pointsize .5
set style line 3 linetype rgb "#666666"
set style line 4 linetype rgb "#FFFF00"
set style line 5 linetype rgb "#333333"
set label "°" right
unset mxtics
set tics textcolor rgb "#666666"
# X Axis
set xdata time
set xtics format "%a" nomirror
set autoscale xfix
set offsets 12*60*60,12*60*60,0,0
# Y Axis
set ytics format "%2f°" nomirror
set yrange [Ylow:Yhigh]
unset ytics
if (32 > Ylow) set label "32°" at graph 0.01,freezeLabel tc rgb "#FFFFFF" font ",8"
# Y2 Axis
set y2tics format "%2.0f%%" nomirror
set y2range [0:100]
plot dataFileForecast using 1:2 with lines,\
dataFileForecast using 1:2:3 with labels,\
dataFileForecast using 1:4 with lines,\
dataFileForecast using 1:2:5 with labels
freezeWarning with lines
Users browsing this forum: No registered users and 5 guests