I write out the info as a Json and the external py program continuously reads that json ( every 10 secs) and if anything new : make new plots
Sent from my iPhone using Tapatalk
Busta999 wrote:At the risk of over reporting
If I use a Scatter Chart and select Pixel for entries then I get the following Critical Error on trying to Redraw Graph
- Code: Select all
Matplotlib Critical Error Chart - Test - scatter: Check path to CSV file (Unrecognized marker style PIX)
Matplotlib Critical Error ValueError: ordinal must be >= 1
By the way discovering some really useful info on power usage around the house and how to reduce it.
kw123 wrote:I write out the info as a Json and the external py program continuously reads that json ( every 10 secs) and if anything new : make new plots
Sent from my iPhone using Tapatalk
Busta999 wrote:Now feel free to say if I am getting greedy/over ambitious.
The historical data graphing is great and allows for some very useful analysis, loving what i can do with it.
But, is there a way I can also just capture the last 3 or 5 readings and create a very small little graph to indicate trend - i.e.
20 º C / or 20 º C\ or 20 º C -- for trending up, down or staying static
So instead of the / , \ -- actually have a small graph with the trend.
This could then be inserted into overview Control Page
I have tried creating a second CSV Engine with just retain last 5 entries but not sure how to plug into it, if you can.
DaveL17 wrote:Busta999 wrote:Now feel free to say if I am getting greedy/over ambitious.
The historical data graphing is great and allows for some very useful analysis, loving what i can do with it.
But, is there a way I can also just capture the last 3 or 5 readings and create a very small little graph to indicate trend - i.e.
20 º C / or 20 º C\ or 20 º C -- for trending up, down or staying static
So instead of the / , \ -- actually have a small graph with the trend.
This could then be inserted into overview Control Page
I have tried creating a second CSV Engine with just retain last 5 entries but not sure how to plug into it, if you can.
Not greedy at all, but it's getting a bit wide of the original intent of the plugin (to create simple, uniform graphical charts for control pages). Probably the simplest approach to create what you're after is to create the CSV data outside the plugin and save that data to the same folder that the plugin uses. In that way, the "smaller" CSV files will be available within the plugin for charting just like the rest. I hope that makes sense!
I'll add a TODO list item to consider ways to make variable CSV data file lengths or user settings to vary the number of observations shown.
Please keep the ideas and bug reports coming. I really do appreciate it.
Dave
Busta999 wrote:Makes sense
At the moment I am using the graphs as interim diagnostic tools to identify energy usage around the house and look closer at things that are draining a disproportionate amount of energy on standby.
i.e. swapped out a 42" TV that was using 200W in use and 40W in standby with a 32" TV that uses 41W in use and 5W in standby - as it is the screen I just have a fake fire burning in the fireplace managed to make a significant dent in it's running costs.
Actually the fake fire really makes you feel much warmer - the warm glows and gentle crackle in the background has a real affect.
Since putting it in the thermostat is set permanently to 19.5 C for the house and no longer keeps getting turned up when I am not looking
Reloading plugin "Matplotlib 0.4.02"
Stopping plugin "Matplotlib 0.4.02" (pid 9048)
Stopped plugin "Matplotlib 0.4.02"
Starting plugin "Matplotlib 0.4.02" (pid 9879)
Started plugin "Matplotlib 0.4.02"
Matplotlib Warning Found CSV Data element with missing source ID. Please check to ensure all CSV sources are properly configured.
Matplotlib Warning Invalid CSV definition. local variable 'state_to_write' referenced before assignment
Matplotlib Warning Found CSV Data element with missing source ID. Please check to ensure all CSV sources are properly configured.
Matplotlib Warning Invalid CSV definition. local variable 'state_to_write' referenced before assignment
Matplotlib Warning Chart - Daily Power Usage: X axis label is suppressed to make room for the chart legend.
Matplotlib Warning Chart - Daily Power Usage Mac Mini and Internet: X axis label is suppressed to make room for the chart legend.
Started plugin "Matplotlib 0.4.02"
Matplotlib
Matplotlib ======================= Initializing New Plugin Session ========================
Matplotlib Indigo version: 7.0.3
Matplotlib Matplotlib version: 1.3.1
Matplotlib Numpy version: 1.8.0rc1
Matplotlib Matplotlib Plugin version: 0.4.02
Matplotlib Matplotlib RC Path: /Library/Application Support/Perceptive Automation/Indigo 7/Plugins/matplotlib.indigoPlugin/Contents/Server Plugin/matplotlibrc
Matplotlib Matplotlib Plugin log location: /Library/Application Support/Perceptive Automation/Indigo 7/Logs/com.fogbert.indigoplugin.matplotlib
Matplotlib Debug Log Level = 10
Matplotlib Updating device properties.
Matplotlib Debug Starting device: Chart - Daily Power Usage
Matplotlib Debug Starting device: Chart - Daily Power Usage Mac Mini and Internet
Matplotlib Debug Starting device: Chart - Freezer Power and Temperature
Matplotlib Debug Starting device: Chart - Fridge Power and Temperature
Matplotlib Debug Starting device: Chart - Total Daily Power Usage
Matplotlib Debug Starting device: Chart - Upstairs Temperature
Matplotlib Debug Starting device: CSV Engine
Matplotlib ======================== Initializing Concurrent Thread ========================
Matplotlib Debug *********** Refresh the CSV ************
Matplotlib Warning Found CSV Data element with missing source ID. Please check to ensure all CSV sources are properly configured.
Matplotlib Warning Invalid CSV definition. local variable 'state_to_write' referenced before assignment
Matplotlib Warning Found CSV Data element with missing source ID. Please check to ensure all CSV sources are properly configured.
Matplotlib Warning Invalid CSV definition. local variable 'state_to_write' referenced before assignment
Matplotlib CSV data updated successfully.
Matplotlib Debug
Timestamp Kitchen - Fridge Temperature
23:07.1 5.5
27:09.8 5.6
27:09.9 5.6
29:12.8 5.6
29:12.8 5.6
44:14.3 5.2
59:16.0 5.2
14:17.5 5.7
29:19.0 5
44:20.8 5.3
58:45.8 5.7
13:47.2 4.9
20:03.7 4.8
35:05.2 6
50:06.5 6.5
05:07.8 4.2
20:09.2 4.4
dev = indigo.devices[CSV Engine Device ID Goes Here]
indigo.server.log(unicode(dev))
DaveL17 wrote:Hi Busta999 - sorry that you're having trouble. Unless I'm mistaken, I haven't made a change to that part of the code in a long time. The error you're seeing is because there appears to be something amiss in the CSV Engine definition for one or two of your devices. Please do me a favor and run the following code in an Indigo script window (or via the Indigo scripting shell) and post the result.
- Code: Select all
dev = indigo.devices[CSV Engine Device ID Goes Here]
indigo.server.log(unicode(dev))
Be sure to enter the ID of your CSV Engine device in the code above.
Dave
Interactive Shell address :
batteryLevel : None
buttonGroupCount : 0
configured : True
description :
deviceTypeId : csvEngine
displayStateId : onOffState
displayStateImageSel : SensorOn
displayStateValRaw : True
displayStateValUi : Updated
enabled : True
energyAccumBaseTime : None
energyAccumTimeDelta : None
energyAccumTotal : None
energyCurLevel : None
errorState :
folderId : 1131037178
globalProps : MetaProps : (dict)
com.fogbert.indigoplugin.matplotlib : (dict)
addItemFieldsCompleted : false (bool)
addKey : (string)
addSource : (string)
addState : (string)
addValue : (string)
bar1Color : #FFFFFF (string)
bar1ColorOther : #FFFFFF (string)
bar1Source : None (string)
bar2Color : #FFFFFF (string)
bar2ColorOther : #FFFFFF (string)
bar2Source : None (string)
bar3Color : #FFFFFF (string)
bar3ColorOther : #FFFFFF (string)
bar3Source : None (string)
bar4Color : #FFFFFF (string)
bar4ColorOther : #FFFFFF (string)
bar4Source : None (string)
chartTitle : Test (string)
columnDict : {u'k12': (u'Oregon 3', u'131776949', u'temperature'), u'k11': (u'', u'', u''), u'k10': (u'', u'', u''), u'k17': (u'Fridge Daily Power Usage', u'499925431', u'accumEnergyTotal'), u'k16': (u'Freezer Daily Power Usage', u'503227130', u'accumEnergyTotal'), u'k15': (u'Netatmo Remote Sensor', u'1590917963', u'Temperature'), u'k14': (u'Oregon 4', u'1141290228', u'temperature'), u'k19': (u'Lounge Fireplace', u'1021086169', u'accumEnergyTotal'), u'k18': (u'AV Daily Power Usage', u'1793706057', u'accumEnergyTotal'), u'k2': (u'Freezer Power', u'503227130', u'curEnergyLevel'), u'k7': (u'Kitchen Freezer Temperature', u'1758125628', u'sensorValue'), u'k4': (u'Oregon1', u'181303829', u'temperature'), u'k9': (u'Oregon 2', u'1286868394', u'temperature'), u'k8': (u'Freezer Ambient Temperature', u'449027158', u'sensorValue'), u'k22': (u'Kitchen - Fridge Temperature', u'1572626410', u'sensorValue'), u'k23': (u'Power Monitor - Breadmaker', u'21851346', u'curEnergyLevel'), u'k20': (u'FirePlace TV Power Monitor', u'720368130', u'accumEnergyTotal'), u'k21': (u'Fridge Current Power', u'499925431', u'curEnergyLevel'), u'k26': (u'Outdoors Temp Sensor 4', u'1748344969', u'sensorValue'), u'k27': (u'Study Temp Sensor 3', u'971616575', u'sensorValue'), u'k24': (u'Daily Total Power Monitor - Breadmaker', u'21851346', u'accumEnergyTotal'), u'k25': (u'Mac Mini and Internet', u'794988578', u'accumEnergyTotal')} (string)
columnList : (string)
customAxisLabelX : X Axis (string)
customAxisLabelY : Y Axis (string)
customLineSegments : None (string)
customLineStyle : - (string)
customSizeChart : false (bool)
customSizeFont : false (bool)
customSizeHeight : None (string)
customSizeWidth : None (string)
customTickFontSize : (string)
customTicksLabelY : (string)
customTicksY : (string)
customTitleFontSize : (string)
editKey : (string)
editSource : (string)
editState : (string)
editValue : (string)
enableCustomLineSegmentsSetting : false (bool)
fileName : Test1.png (string)
isColumnSelected : true (bool)
line1Annotate : false (bool)
line1Color : #FFFFFF (string)
line1ColorOther : #FFFFFF (string)
line1Fill : false (bool)
line1Legend : (string)
line1Marker : None (string)
line1MarkerColor : #FFFFFF (string)
line1MarkerColorOther : #FFFFFF (string)
line1Source : None (string)
line1Style : None (string)
line2Annotate : false (bool)
line2Color : #FFFFFF (string)
line2ColorOther : #FFFFFF (string)
line2Fill : false (bool)
line2Legend : (string)
line2Marker : None (string)
line2MarkerColor : #FFFFFF (string)
line2MarkerColorOther : #FFFFFF (string)
line2Source : None (string)
line2Style : None (string)
line3Annotate : false (bool)
line3Color : #FFFFFF (string)
line3ColorOther : #FFFFFF (string)
line3Fill : false (bool)
line3Legend : (string)
line3Marker : None (string)
line3MarkerColor : #FFFFFF (string)
line3MarkerColorOther : #FFFFFF (string)
line3Source : None (string)
line3Style : None (string)
line4Annotate : false (bool)
line4Color : #FFFFFF (string)
line4ColorOther : #FFFFFF (string)
line4Fill : false (bool)
line4Legend : (string)
line4Marker : None (string)
line4MarkerColor : #FFFFFF (string)
line4MarkerColorOther : #FFFFFF (string)
line4Source : None (string)
line4Style : None (string)
lineLabel1 : true (bool)
lineLabel2 : true (bool)
lineLabel3 : false (bool)
lineLabel4 : false (bool)
numLinesToKeep : 10000 (string)
plotLine1Max : true (bool)
plotLine1Min : true (bool)
plotLine2Max : false (bool)
plotLine2Min : false (bool)
plotLine3Max : false (bool)
plotLine3Min : false (bool)
plotLine4Max : false (bool)
plotLine4Min : false (bool)
previousKey : k27 (string)
rectWide : false (bool)
showLegend : false (bool)
showxAxisGrid : true (bool)
showyAxisGrid : false (bool)
xAxisBins : daily (string)
xAxisLabel : true (bool)
xAxisLabelFormat : %A (string)
yAxisLabel : true (bool)
yAxisMax : None (string)
yAxisMin : None (string)
yAxisPrecision : 0 (string)
yMirrorValues : false (bool)
id : 393909832
lastChanged : 2017-03-03 14:14:55
lastSuccessfulComm : 2017-03-03 14:14:55
model : CSV Engine
name : CSV Engine
ownerProps : com.fogbert.indigoplugin.matplotlib : (dict)
addItemFieldsCompleted : false (bool)
addKey : (string)
addSource : (string)
addState : (string)
addValue : (string)
bar1Color : #FFFFFF (string)
bar1ColorOther : #FFFFFF (string)
bar1Source : None (string)
bar2Color : #FFFFFF (string)
bar2ColorOther : #FFFFFF (string)
bar2Source : None (string)
bar3Color : #FFFFFF (string)
bar3ColorOther : #FFFFFF (string)
bar3Source : None (string)
bar4Color : #FFFFFF (string)
bar4ColorOther : #FFFFFF (string)
bar4Source : None (string)
chartTitle : Test (string)
columnDict : {u'k12': (u'Oregon 3', u'131776949', u'temperature'), u'k11': (u'', u'', u''), u'k10': (u'', u'', u''), u'k17': (u'Fridge Daily Power Usage', u'499925431', u'accumEnergyTotal'), u'k16': (u'Freezer Daily Power Usage', u'503227130', u'accumEnergyTotal'), u'k15': (u'Netatmo Remote Sensor', u'1590917963', u'Temperature'), u'k14': (u'Oregon 4', u'1141290228', u'temperature'), u'k19': (u'Lounge Fireplace', u'1021086169', u'accumEnergyTotal'), u'k18': (u'AV Daily Power Usage', u'1793706057', u'accumEnergyTotal'), u'k2': (u'Freezer Power', u'503227130', u'curEnergyLevel'), u'k7': (u'Kitchen Freezer Temperature', u'1758125628', u'sensorValue'), u'k4': (u'Oregon1', u'181303829', u'temperature'), u'k9': (u'Oregon 2', u'1286868394', u'temperature'), u'k8': (u'Freezer Ambient Temperature', u'449027158', u'sensorValue'), u'k22': (u'Kitchen - Fridge Temperature', u'1572626410', u'sensorValue'), u'k23': (u'Power Monitor - Breadmaker', u'21851346', u'curEnergyLevel'), u'k20': (u'FirePlace TV Power Monitor', u'720368130', u'accumEnergyTotal'), u'k21': (u'Fridge Current Power', u'499925431', u'curEnergyLevel'), u'k26': (u'Outdoors Temp Sensor 4', u'1748344969', u'sensorValue'), u'k27': (u'Study Temp Sensor 3', u'971616575', u'sensorValue'), u'k24': (u'Daily Total Power Monitor - Breadmaker', u'21851346', u'accumEnergyTotal'), u'k25': (u'Mac Mini and Internet', u'794988578', u'accumEnergyTotal')} (string)
columnList : (string)
customAxisLabelX : X Axis (string)
customAxisLabelY : Y Axis (string)
customLineSegments : None (string)
customLineStyle : - (string)
customSizeChart : false (bool)
customSizeFont : false (bool)
customSizeHeight : None (string)
customSizeWidth : None (string)
customTickFontSize : (string)
customTicksLabelY : (string)
customTicksY : (string)
customTitleFontSize : (string)
editKey : (string)
editSource : (string)
editState : (string)
editValue : (string)
enableCustomLineSegmentsSetting : false (bool)
fileName : Test1.png (string)
isColumnSelected : true (bool)
line1Annotate : false (bool)
line1Color : #FFFFFF (string)
line1ColorOther : #FFFFFF (string)
line1Fill : false (bool)
line1Legend : (string)
line1Marker : None (string)
line1MarkerColor : #FFFFFF (string)
line1MarkerColorOther : #FFFFFF (string)
line1Source : None (string)
line1Style : None (string)
line2Annotate : false (bool)
line2Color : #FFFFFF (string)
line2ColorOther : #FFFFFF (string)
line2Fill : false (bool)
line2Legend : (string)
line2Marker : None (string)
line2MarkerColor : #FFFFFF (string)
line2MarkerColorOther : #FFFFFF (string)
line2Source : None (string)
line2Style : None (string)
line3Annotate : false (bool)
line3Color : #FFFFFF (string)
line3ColorOther : #FFFFFF (string)
line3Fill : false (bool)
line3Legend : (string)
line3Marker : None (string)
line3MarkerColor : #FFFFFF (string)
line3MarkerColorOther : #FFFFFF (string)
line3Source : None (string)
line3Style : None (string)
line4Annotate : false (bool)
line4Color : #FFFFFF (string)
line4ColorOther : #FFFFFF (string)
line4Fill : false (bool)
line4Legend : (string)
line4Marker : None (string)
line4MarkerColor : #FFFFFF (string)
line4MarkerColorOther : #FFFFFF (string)
line4Source : None (string)
line4Style : None (string)
lineLabel1 : true (bool)
lineLabel2 : true (bool)
lineLabel3 : false (bool)
lineLabel4 : false (bool)
numLinesToKeep : 10000 (string)
plotLine1Max : true (bool)
plotLine1Min : true (bool)
plotLine2Max : false (bool)
plotLine2Min : false (bool)
plotLine3Max : false (bool)
plotLine3Min : false (bool)
plotLine4Max : false (bool)
plotLine4Min : false (bool)
previousKey : k27 (string)
rectWide : false (bool)
showLegend : false (bool)
showxAxisGrid : true (bool)
showyAxisGrid : false (bool)
xAxisBins : daily (string)
xAxisLabel : true (bool)
xAxisLabelFormat : %A (string)
yAxisLabel : true (bool)
yAxisMax : None (string)
yAxisMin : None (string)
yAxisPrecision : 0 (string)
yMirrorValues : false (bool)
pluginId : com.fogbert.indigoplugin.matplotlib
pluginProps : emptyDict : (dict)
protocol : Plugin
remoteDisplay : True
states : States : (dict)
csvLastUpdated : 2017-03-03 14:14:55.446466 (string)
onOffState : true (bool)
onOffState.ui : Updated (string)
subModel :
supportsAllLightsOnOff : False
supportsAllOff : False
supportsStatusRequest : False
version : None
columnDict :
{
u'k12': (u'Oregon 3', u'131776949', u'temperature'),
u'k11': (u'', u'', u''),
u'k10': (u'', u'', u''),
u'k17': (u'Fridge Daily Power Usage', u'499925431', u'accumEnergyTotal'),
u'k16': (u'Freezer Daily Power Usage', u'503227130', u'accumEnergyTotal'),
u'k15': (u'Netatmo Remote Sensor', u'1590917963', u'Temperature'),
u'k14': (u'Oregon 4', u'1141290228', u'temperature'),
u'k19': (u'Lounge Fireplace', u'1021086169', u'accumEnergyTotal'),
u'k18': (u'AV Daily Power Usage', u'1793706057', u'accumEnergyTotal'),
u'k2': (u'Freezer Power', u'503227130', u'curEnergyLevel'),
u'k7': (u'Kitchen Freezer Temperature', u'1758125628', u'sensorValue'),
u'k4': (u'Oregon1', u'181303829', u'temperature'),
u'k9': (u'Oregon 2', u'1286868394', u'temperature'),
u'k8': (u'Freezer Ambient Temperature', u'449027158', u'sensorValue'),
u'k22': (u'Kitchen - Fridge Temperature', u'1572626410', u'sensorValue'),
u'k23': (u'Power Monitor - Breadmaker', u'21851346', u'curEnergyLevel'),
u'k20': (u'FirePlace TV Power Monitor', u'720368130', u'accumEnergyTotal'),
u'k21': (u'Fridge Current Power', u'499925431', u'curEnergyLevel'),
u'k26': (u'Outdoors Temp Sensor 4', u'1748344969', u'sensorValue'),
u'k27': (u'Study Temp Sensor 3', u'971616575', u'sensorValue'),
u'k24': (u'Daily Total Power Monitor - Breadmaker', u'21851346', u'accumEnergyTotal'),
u'k25': (u'Mac Mini and Internet', u'794988578', u'accumEnergyTotal')
}
DaveL17 wrote:I'm glad that solved it. I will definitely do some work to tighten that up so that it won't happen going forward (and probably add some internal logic to automatically delete these empty entries).
I'm also glad that the plugin helped you to find a way to save some money. I'm hearing more and more stories like that, which is fantastic. Maybe I should start charging a commission!
Matplotlib Plugin for Indigo -- it's great for the planet!™
Busta999 wrote:Thanks for the update 0.4.03 and the six notifications in 3 hours reminding me of it.
Users browsing this forum: No registered users and 1 guest