INDIGO plot --> see new version INDIGOplotD

Posted on
Wed Feb 19, 2014 8:59 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: INDIGO plot

..good to hear.. that it works.. Tomorrow I will release a new version some bugs and enhancements (multiplier for e.g. Watt to kWatt i.e. /1000)


in order to support these devices, I need the device properties, here is how to get them:
create a new action group / server action /script and file action/ embedded script
enter command:
indigo.server.log(str(indigo.devices["xxx"].states.keys())) replace "xxx" with your device names one at a time, click on <run>

Then get the log file output
it should look like (this one is for a thermostat):
[u'hvacCoolerIsOn', u'hvacDehumidifierIsOn', u'hvacFanIsOn', u'hvacFanMode', u'hvacFanMode.ui', u'hvacFanModeIsAlwaysOn', u'hvacFanModeIsAuto', u'hvacHeaterIsOn', u'hvacHumidifierIsOn', u'hvacOperationMode', u'hvacOperationMode.ui', u'hvacOperationModeIsAuto', u'hvacOperationModeIsCool', u'hvacOperationModeIsHeat', u'hvacOperationModeIsOff', u'hvacOperationModeIsProgramAuto', u'hvacOperationModeIsProgramCool', u'hvacOperationModeIsProgramHeat', u'setpointCool', u'setpointCool.ui', u'setpointHeat', u'setpointHeat.ui', u'temperatureInput1', u'temperatureInput1.ui', u'temperatureInputsAll']

do this for all your device properties you like to add, what they mean and also what they should be called. don't bother with xxxx.ui types.
eg i replaced hvacFanIsOn with FAN-ON to be presented to the users.

so at the end I need a list that looks like:

"property" : "property-niceName"


If you could do it in this format I save some typing

here the list I currently have:
"hvacHeaterIsOn": "Heat-ON"
,"hvacCoolerIsOn": "AC-ON"
,"hvacFanIsOn": "FAN-ON"
,"setpointHeat": "SetPointHeat"
,"setpointCool": "SetPointCool"
,"temperatureInput1": "Temperature"
,"temperature": "Temperature"
,"temperatureF": "Temperature[F]"
,"temperatureC": "Temperature[C]"
,"humidity": "Humidity"
,"accumEnergyTimeDelta": "EnergyMeasuremtTime"
,"accumEnergyTotal": "Energy[Watt-Hour]Total"
,"curEnergyLevel": "Power[Watt]"
,"hvacDehumidifierIsOn": "Dehumidifier-ON"
,"hvacHumidifierIsOn": "Humidifier-ON"
,"rainrate": "Rain-Rate"
,"currentDayTotal": "Rain-Today"
Last edited by kw123 on Fri Feb 28, 2014 9:59 pm, edited 1 time in total.

Posted on
Wed Feb 19, 2014 11:10 pm
bob.banks offline
Posts: 27
Joined: Feb 27, 2012

Re: INDIGO plot

One thing that REALLY confused me is the "Data-Source for Line X" shows up when "setup Plots" is checked but not when "setup Lines" was checked. When I checked all three, the relationships made more sense. I also noticed the "X" in "Data-Source..." doesn't change when the selected number changes.

The setup may be tough at first (being a plugin developer I understand why it's not easy) but this has a ton of promise. I've been pushing data to Pachube/Cosm/Xively and was about to switch to Nimbits but that's on hold for now.

Keep up the great work and looking forward to seeing what else we can do.

Posted on
Wed Feb 19, 2014 11:44 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: INDIGO plot

https://www.dropbox.com/s/ev3pqvwafv87g9k/indigoplot-0-6-1.zip version 0-6-1

bugs:
1. some bugs with index, bad ones but they did not screw things up.. ;-)
2. save / restore config was not working properly

additions:
1. added multiplier option e.g. when the data in in watts and you like to display kwatts (i.e. without the 000) add 0.001 into the multiplier.
2. is checking for double entries, and rejects them i.e. when a device/property is already in you will get an error message when you click on confirm..
3. the gnu output information is better understandable now.

Karl
Last edited by kw123 on Thu Feb 20, 2014 12:48 am, edited 1 time in total.

Posted on
Wed Feb 19, 2014 11:56 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: INDIGO plot

(bob.banks):

the config management is somewhat tricky. You can use callbacks and dynamic methods to fill the fields. They all come with restrictions.. (i.e. dymanic methods do not have access to valuesDict - they return a list of tuples, while callbacks can only return valuesDict)

so LINES only works AFTER you <confirm> the PLOT. That button fills the LINES fields.

this config has ~10 dynamic methods and ~10 callbacks.. it is getting complex..

Thats at least my level of understanding..

If anyone would like to critique the code PLEASE do so. I am still on a steep learning curve..

Karl

Posted on
Thu Feb 20, 2014 6:19 am
Vaillant offline
Posts: 105
Joined: Nov 06, 2011
Location: Belgium

Re: INDIGO plot

Hi,

Happy to see this plugin. Testing now.

Feedback for the moment: in addition to the multiplier I like to see an addition as well.
I need to correct the measured temperature bij adding a fixed value.
Alternatively I could get the same effect if I was able to use variables to plot.

Great plugin.

Adrian

Posted on
Thu Feb 20, 2014 7:31 am
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: INDIGO plot

you are taking about an offset? i.e. temp*scale +offset

ok
give me a day ..
I was planning to move the multiplier to the line definition i.e. leave the "raw" data alone and do any math at the time when it is plotted.

and also add 2 data points to be +-/* . Eg if you have 2 energy devices this is how to get the total energy consumption

Karl.

ps you can do it yourself already now:
first do a regular setup i.e. select your data plot and line including confirm line.
Then copy the text from "resulting gnuplot command" at the bottom of the line section into the "gnuplot raw cmd" field and change 1:($5*10) to 1:($5*10+3.5) where$5 is the data column (source data) number you selected, 10 was your multiplier and 3.5 will be your offset. then <confirm>

Posted on
Thu Feb 20, 2014 10:34 am
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: INDIGO plot

https://www.dropbox.com/s/d05gtfpes0tpoiz/indigopolt-0-6-2.zip version 0.6.2

New:
added OFFSET in LINE section: if you like to move a curve up or down add a number /= 0
moved the multiplier into line section next to offset
added some messages to the config menu

no bugs fixed.. !!

Karl

Posted on
Thu Feb 20, 2014 10:39 am
bob.banks offline
Posts: 27
Joined: Feb 27, 2012

Re: INDIGO plot

Thanks Karl.

Any chance of automatic axis scaling based on values? I'm not familiar enough with gnuplot to know if it's feasible. Also, would it be possible to clean up the end of the line where it tails back down to 0?

Posted on
Thu Feb 20, 2014 10:58 am
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: INDIGO plot

auto scale: yes .. will have it in 0.6.3 in a day ..

solution: leave scale range etc blank then gnu plot scales automatically

Posted on
Thu Feb 20, 2014 2:48 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: INDIGO plot

https://www.dropbox.com/s/w2v5zjya6riowp3/indigoplot-0-6-3.zip version 0.6.3

added:
- auto scaling enabled: leave range/sclae and tics empty it will automatically scale.
- some more help text in configuration window.

Karl

ps attached a plot with the total energy info from 2 z wave home energy monitor
Attachments
energy-minute-S1.tiff
energy-minute-S1.tiff (15.6 KiB) Viewed 4061 times

Posted on
Thu Feb 20, 2014 3:37 pm
Vaillant offline
Posts: 105
Joined: Nov 06, 2011
Location: Belgium

Re: INDIGO plot

Hi,

Plugin is working fine.
Thanks for the offset.

By adding the offset the baseline - when no data is available - displays the value of the offset.
Any idea how to prevent this?

Also the plot starts and ends with 0.
Is it possible to start and end with the first and last actual value so getting a peaking plot is prevented?
Maybe this is not possible with GNUPlot.

Awesome work.

Greetings,
Adrian

Posted on
Thu Feb 20, 2014 3:51 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: INDIGO plot

solution is to plot a line in the background color AFTER the line. That will simply overwrite the line.
But currently there is no "0" line available in indigoplot. adding to the wish list..


so the gnuplot code looks like:
Code: Select all
set object 1 rectangle from screen 0,0 to screen 1,1 fillcolor  rgb "#00A000"  behind
plot '/Users/karlwachs/Documents/INDIGOPlot/minute.dat'\
  using 1:($18*0.001+0.0) with  lines       linetype 6    linewidth 1    linecolor  rgb "#FF0000"   title "left"  axis x1y1\
 ,''   using 1:($16*0.001+0.0) with  lines       linetype 6    linewidth 1    linecolor  rgb "#FFA500"   title "right"  axis x1y1\
 ,''   using 1:($16*0.001+0.0) with  lines       linetype 6    linewidth 1    linecolor  rgb "#00A000"     axis x1y1

as you can see the last(third) one is the same as the 2. but with the background color.. (the rectangle command)
Have to think about how to automat this.

Karl..

ps any one with a bug?

Posted on
Thu Feb 20, 2014 3:55 pm
artpics offline
Posts: 232
Joined: Feb 24, 2009
Location: Calabasas CA

Re: INDIGO plot

here is the info for my nest thermostat. Can you Add it please so i can graph more info.

Code: Select all
                      [u'away', u'humidityInput1', u'humidityInputsAll', u'hvacCoolerIsOn', u'hvacDehumidifierIsOn', u'hvacFanIsOn', u'hvacFanMode', u'hvacFanMode.ui', u'hvacFanModeIsAlwaysOn', u'hvacFanModeIsAuto', u'hvacHeaterIsOn', u'hvacHumidifierIsOn', u'hvacOperationMode', u'hvacOperationMode.ui', u'hvacOperationModeIsAuto', u'hvacOperationModeIsCool', u'hvacOperationModeIsHeat', u'hvacOperationModeIsOff', u'hvacOperationModeIsProgramAuto', u'hvacOperationModeIsProgramCool', u'hvacOperationModeIsProgramHeat', u'setpointCool', u'setpointHeat', u'temperatureInput1', u'temperatureInputsAll']


as for the aoetec multi sensor i get this for the main unit.
Code: Select all
[u'batteryLevel', u'batteryLevel.ui', u'onOffState']

as for the aoetec multi sensor i get this for the Humidity,Temp, Luminance, device.
Code: Select all
 [u'sensorValue', u'sensorValue.ui']


my log shows this when the multi sensor reports
Code: Select all
Z-Wave                          received "Motion Sensor Multi Luminance" sensor update to 128 lux
  Trigger                         Multilux
  Z-Wave                          received "Motion Sensor Multi Humidity" sensor update to 23%
  Z-Wave                          received "Motion Sensor Multi Temperature" sensor update to 69.9 °F
  Trigger                         Multi sensor temp


Hope this helps thanks.

BTW how can i change the time span on the bottom of the graph i.e.:24hrs or 12hrs or 3 hrs etc...
Last edited by artpics on Thu Feb 20, 2014 4:11 pm, edited 1 time in total.

Posted on
Thu Feb 20, 2014 3:57 pm
colinpartridge offline
Posts: 373
Joined: Jan 13, 2014
Location: London, UK

Re: INDIGO plot

Have tried unsuccessfully to get this plugin to work, I get the following in the log..
Enabling plugin "indigoplot 0.6.1"
Starting plugin "indigoplot 0.6.1" (pid 51829)
Started plugin "indigoplot 0.6.1"
indigoplot plotTemp initializing ... 0-6-1
indigoplot Error Error in plugin execution startup:

Traceback (most recent call last):
File "plugin.py", line 103, in startup
File "plugin.py", line 1434, in redolineDataSource
<type 'exceptions.KeyError'>: key id 1350376756 not found in database


with the interface open I do not get a list of my devices as I was expecting, just a blank entry in the device field. any ideas?

Colin

Posted on
Thu Feb 20, 2014 4:18 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: INDIGO plot

[edit]
a quick way to draw a line:

Code: Select all
set arrow from graph 0,first 0.5 to graph 1,first 0.5 nohead lc rgb "#00A000" front


that will draw a line at Y= 0.5 in color 00A000 which is green

you can add that string to the PLOT gnuplot field(expert mode). It should appear in your plot.
Now you have to get the color of the background right.. see the bottom of the readme.

I hope this is not too complicated..


still think about how to automate this..

Karl

Who is online

Users browsing this forum: No registered users and 4 guests