disabling but NOT deleting plotD devices

Posted on
Fri Oct 05, 2018 3:35 pm
bsp9493 offline
Posts: 153
Joined: Nov 30, 2017
Location: Kelowna, BC

disabling but NOT deleting plotD devices

Hi Karl...

plugin working awesome...

I am using ghostXML to pull data from an Autelis device for my pool.
now that summer is done, I have disabled the ghostxml devices and in turn this is causing a number of errors messages with INDIGOplotD. see below...

Code: Select all
Oct 5, 2018 at 2:24:59 PM
   INDIGOplotD                     ------------------------------------------------------------------------------
   INDIGOplotD                     Line '9953' has error=''key temp_pooltemp not found in dict''
   INDIGOplotD                     ------------------------------------------------------------------------------
   INDIGOplotD                      getIndigoData, device prop does not exist 1422876465 temp_pooltemp
   INDIGOplotD                     address :
batteryLevel : None
buttonGroupCount : 0
configured : True
description :
deviceTypeId : GhostXMLdevice
displayStateId : deviceIsOnline
displayStateImageSel : SensorOff
displayStateValRaw : False
displayStateValUi : Disabled
enabled : False
energyAccumBaseTime : None
energyAccumTimeDelta : None
energyAccumTotal : None
energyCurLevel : None
errorState :
folderId : 1506032743
globalProps : MetaProps : (dict)
     com.fogbert.indigoplugin.GhostXML : (dict)
          digestPass : admin (string)
          digestUser : admin (string)
          doSubs : false (bool)
          feedType : XML (string)
          refreshFreq : 0 (integer)
          sourceXML : http://admin:admin@192.168.x.xxx/status.xml (string)
          subA :  (string)
          subB :  (string)
          subC :  (string)
          subD :  (string)
          subE :  (string)
          timeout : 5 (string)
          tokenUrl :  (string)
          useAuth : false (bool)
          useDigest : None (string)
id : 1422876465
lastChanged : 2018-10-05 14:24:23
lastSuccessfulComm : 2018-10-05 14:24:23
model : GhostXML Device
name : Autelis - Status
ownerProps : com.fogbert.indigoplugin.GhostXML : (dict)
     digestPass : admin (string)
     digestUser : admin (string)
     doSubs : false (bool)
     feedType : XML (string)
     refreshFreq : 0 (integer)
     sourceXML : http://admin:admin@192.168.x.xxx/status.xml (string)
     subA :  (string)
     subB :  (string)
     subC :  (string)
     subD :  (string)
     subE :  (string)
     timeout : 5 (string)
     tokenUrl :  (string)
     useAuth : false (bool)
     useDigest : None (string)
pluginId : com.fogbert.indigoplugin.GhostXML
pluginProps : com.karlwachs.INDIGOplotD : (dict)
protocol : Plugin
remoteDisplay : True
states : States : (dict)
     deviceIsOnline : false (bool)
     deviceIsOnline.ui : Disabled (string)
     deviceLastUpdated : 10/05/2018 at 14:22 (string)
     deviceTimestamp : 1538774577.861554 (real)
subModel :
supportsAllLightsOnOff : False
supportsAllOff : False
supportsStatusRequest : False
version : None
   INDIGOplotD                     ------------------------------------------------------------------------------
   INDIGOplotD                     Line '9953' has error=''key temp_soltemp not found in dict''
   INDIGOplotD                     ------------------------------------------------------------------------------
   INDIGOplotD                      getIndigoData, device prop does not exist 1422876465 temp_soltemp
   INDIGOplotD                     address :
batteryLevel : None
buttonGroupCount : 0
configured : True
description :
deviceTypeId : GhostXMLdevice
displayStateId : deviceIsOnline
displayStateImageSel : SensorOff
displayStateValRaw : False
displayStateValUi : Disabled
enabled : False
energyAccumBaseTime : None
energyAccumTimeDelta : None
energyAccumTotal : None
energyCurLevel : None
errorState :
folderId : 1506032743
globalProps : MetaProps : (dict)
     com.fogbert.indigoplugin.GhostXML : (dict)
          digestPass : admin (string)
          digestUser : admin (string)
          doSubs : false (bool)
          feedType : XML (string)
          refreshFreq : 0 (integer)
          sourceXML : http://admin:admin@192.168.x.xxx/status.xml (string)
          subA :  (string)
          subB :  (string)
          subC :  (string)
          subD :  (string)
          subE :  (string)
          timeout : 5 (string)
          tokenUrl :  (string)
          useAuth : false (bool)
          useDigest : None (string)
     com.karlwachs.INDIGOplotD : (dict)
id : 1422876465
lastChanged : 2018-10-05 14:24:23
lastSuccessfulComm : 2018-10-05 14:24:23
model : GhostXML Device
name : Autelis - Status
ownerProps : com.fogbert.indigoplugin.GhostXML : (dict)
     digestPass : admin (string)
     digestUser : admin (string)
     doSubs : false (bool)
     feedType : XML (string)
     refreshFreq : 0 (integer)
     sourceXML : http://admin:admin@192.168.x.xxx/status.xml (string)
     subA :  (string)
     subB :  (string)
     subC :  (string)
     subD :  (string)
     subE :  (string)
     timeout : 5 (string)
     tokenUrl :  (string)
     useAuth : false (bool)
     useDigest : None (string)
pluginId : com.fogbert.indigoplugin.GhostXML
pluginProps : com.karlwachs.INDIGOplotD : (dict)
protocol : Plugin
remoteDisplay : True
states : States : (dict)
     deviceIsOnline : false (bool)
     deviceIsOnline.ui : Disabled (string)
     deviceLastUpdated : 10/05/2018 at 14:22 (string)
     deviceTimestamp : 1538774577.861554 (real)
subModel :
supportsAllLightsOnOff : False
supportsAllOff : False
supportsStatusRequest : False
version : None
   INDIGOplotD                     ------------------------------------------------------------------------------
   INDIGOplotD                     Line '9953' has error=''key equipment_feature2 not found in dict''
   INDIGOplotD                     ------------------------------------------------------------------------------
   INDIGOplotD                      getIndigoData, device prop does not exist 1422876465 equipment_feature2
   INDIGOplotD                     address :
batteryLevel : None
buttonGroupCount : 0
configured : True
description :
deviceTypeId : GhostXMLdevice
displayStateId : deviceIsOnline
displayStateImageSel : SensorOff
displayStateValRaw : False
displayStateValUi : Disabled
enabled : False
energyAccumBaseTime : None
energyAccumTimeDelta : None
energyAccumTotal : None
energyCurLevel : None
errorState :
folderId : 1506032743
globalProps : MetaProps : (dict)
     com.fogbert.indigoplugin.GhostXML : (dict)
          digestPass : admin (string)
          digestUser : admin (string)
          doSubs : false (bool)
          feedType : XML (string)
          refreshFreq : 0 (integer)
          sourceXML : http://admin:admin@192.168.x.xxx/status.xml (string)
          subA :  (string)
          subB :  (string)
          subC :  (string)
          subD :  (string)
          subE :  (string)
          timeout : 5 (string)
          tokenUrl :  (string)
          useAuth : false (bool)
          useDigest : None (string)
     com.karlwachs.INDIGOplotD : (dict)
id : 1422876465
lastChanged : 2018-10-05 14:24:23
lastSuccessfulComm : 2018-10-05 14:24:23
model : GhostXML Device
name : Autelis - Status
ownerProps : com.fogbert.indigoplugin.GhostXML : (dict)
     digestPass : admin (string)
     digestUser : admin (string)
     doSubs : false (bool)
     feedType : XML (string)
     refreshFreq : 0 (integer)
     sourceXML : http://admin:admin@192.168.x.xxx/status.xml (string)
     subA :  (string)
     subB :  (string)
     subC :  (string)
     subD :  (string)
     subE :  (string)
     timeout : 5 (string)
     tokenUrl :  (string)
     useAuth : false (bool)
     useDigest : None (string)
pluginId : com.fogbert.indigoplugin.GhostXML
pluginProps : com.karlwachs.INDIGOplotD : (dict)
protocol : Plugin
remoteDisplay : True
states : States : (dict)
     deviceIsOnline : false (bool)
     deviceIsOnline.ui : Disabled (string)
     deviceLastUpdated : 10/05/2018 at 14:22 (string)
     deviceTimestamp : 1538774577.861554 (real)
subModel :
supportsAllLightsOnOff : False
supportsAllOff : False
supportsStatusRequest : False
version : None


my question...
how do I get indigoplotD to ignore the PLOT devices related to my pool that are dependant on ghostXML. I don't want to delete the devices as I would just have to set them up again in the spring. I just want INDIGOplotD to IGNORE them for now.

I have tried disabling communication to those plot devices, but that doesn't seem to work. Is there another way?

I could disable INDIGOplotD, but I am using it for other plots that are still active.

Thanx

dave

Posted on
Fri Oct 05, 2018 9:33 pm
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: disabling but NOT deleting plotD devices

Will check it tomorrow.


Sent from my iPhone using Tapatalk

Posted on
Sat Oct 06, 2018 10:37 am
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: disabling but NOT deleting plotD devices

as I understand this: the device state "temp_pooltemp" does not exist in the device for some period of time.; then you like to re instate it later.

Now plotD complains that it does not find the state "temp_pooltemp" which is correct .

BUT ALSO INDIGO has deleted all references to that state in the sql database... when it will reappear later it will only have the data from when it was reinstated.

Do you just want to not plot that specific line? indigoPlotD does many things before it plots the line: it reads the current device[state] and adds it to the internal db. that process will always fail, as it will not find that device[state]

With current capabilities you would need to remove that device[state] from indigoplotD data source (in define /select datasource ...)

one way to keep the formatting etc: look at the indigoplotd/py directory. there you will find back up files that will restore all configs of the date it was created.

if you know some python you could select the section for that device and plot and save it and run it in an action window when you reinstate the device[state]

eg
Code: Select all
plug = indigo.server.getPlugin("com.karlwachs.INDIGOplotD")
if not plug.isEnabled(): return   #### INDIGOplotD must be enabled, otherwise nothing here works
ppp ={"deviceOrVariableName":u's-11-serverRoom-MAC-mini' # name of device or variable to be tracked
     ,"devOrVar":         u'Dev-' #  Dev- or Var-
     ,"state":            u'Temperature'  #  state that should be tracked
     ,"measurement":      u'average' #  measurement that should be recored average,min,max,..,eConsumption...
     ,"multiplier":       u'1.0'  # optional data is multiplied with this value
     ,"offset":           u'0.0'  # optional data is added with this value
     ,"minValue":         u'-200.0'  # optional lower cutoff value
     ,"maxValue":         u'50000.0'  # optional high cutoff value
     ,"fillGaps":         u'1'  # optional fill data gaps if no info available with last data point
     ,"resetType":        u'"0"'  # options: 0 Period day week month bin PeriodNoCost dayNoCost weekNoCost monthNoCost binNoCost  only for consumption data
     ,"nickName":         u'"s-11-serverRoom-GW-Temp-average"'
     ,"logLevel":         u'1'          ###  values:  blank =off  if debug mode on , 0 = error 1 = regular logging
     }
plug.executeAction("addDeviceAndStateToSelectionList" , props =ppp)
will recreate the settings for the source s-11-serverRoom-MAC-mini[Temperature]
and
Code: Select all
plot2={
  "deviceNameOfPlot"     : u'macminiü'
 ,"PlotType"             : u'dataFromTimeSeries'  ### dataFromTimeSeries  dataFromFile  dataFromVariable
 ,"XYvPolar"             : u'xy'  ### xy plot or polar plot
 ,"Grid"                 : u'0'                 ### options:  0=no 1=dashedBack 2=solidBack 3=thickSolidBack -1=thinFront -2... -3...
 ,"Border"               : u'1+2+4+8'              ### options:  1+2+4+8  0+0+0+0   on off for x,y,xTop,yRight border lines
 ,"PlotFileOrVariName"   : u''       ### Name of variable of filename if PlotType = dataFromFile or dataFromVariable 
 ,"TitleText"            : u'headlineä'     ### text that goes on the top of the plot
 ,"ExtraText"            : u''     ### Extra text
 ,"ExtraTextXPos"        : u'0.0'     ### x-pos of extra text
 ,"ExtraTextYPos"        : u'0.0'     ### y-pos of extra text
 ,"ExtraTextRotate"      : u'0.0'     ### rotate extra text counter clockwise 0..360 
 ,"ExtraTextFrontBack"   : u'front'     ### put extra text in "front" or "back" ground 
 ,"ExtraTextSize"        : u'8'     ### put extra text Size in points 
 ,"ExtraTextColorRGB"    : u'#000000'     ### extra text color #RRGGBB format 
 ,"TextSize"             : u'8'                       ### font size 
 ,"TextMATFont"          : u'sans-serif'             ### if MATPLOT font name:  sans-serif  serif  cursive  fantasy  monospace
 ,"TextFont"             : u'0'         ### if GNUPLOT name of font from  /Library/Fonts/  eg Arial Unicode.ttf
 ,"TextColor"            : u'#000000'              ## #FFFFFF ... #000000 or 255,255,255 format for RGB color intensities
 ,"LeftScaleRange"       : u'85:105'             ### min:max
 ,"LeftScaleTics"        : u'85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,102,105'                ### eg 10,20,30,100
 ,"LeftLog"              : u'linear'          # linear or log
 ,"LeftScaleDecPoints"   : u'0'                  ### number of 00 after .
 ,"LeftLabel"            : u''          ### text on left Y axis
 ,"RightScaleRange"      : u'70:85'
 ,"RightScaleTics"       : u'70,71,72,73,74,75,76,77,78,79,80'
 ,"RightLog"             : u'linear'
 ,"RightLabel"           : u''
 ,"RightScaleDecPoints"  : u'0'
 ,"XScaleRange"          : u''
 ,"XScaleTics"           : u''
 ,"XLog"                 : u'linear'
 ,"XLabel"               : u'x-axis Text'
 ,"XScaleDecPoints"      : u'0'
 ,"XScaleFormat"         : u''           ### python / c .. format string for x axis
 ,"resxy0"               : u'850,500'            ### x,y  number of dots in x and y  for plotsize 1
 ,"resxy1"               : u''            ### x,y  number of dots in x and y  for plotsize 2
 ,"MinuteBinNoOfDays"    : u'1'         # number of days for MINUTE size bins 0-14
 ,"HourBinNoOfDays"      : u'21'         ### number of days for HOUR size bins 0-39
 ,"DayBinNoOfDays"       : u'90'      ### number of days for DAY size bins 0-390
 ,"MinuteBinShift"       : u'-1'         # number of days for MINUTE to shift left
 ,"HourBinShift"         : u'0'      ### number of days for HOUR to shift left
 ,"DayBinShift"          : u'0'      ### number of days for DAY to shift left
 ,"MinuteXScaleFormat"   : u''     ### xscale format for min
 ,"HourXScaleFormat"     : u''     ### xscale format for hour
 ,"DayXScaleFormat"      : u''     ### xscale format for day
 ,"Background"           : u'#E0E0E0'            ### #FFFFFF ... #000000 or 255,255,255 format for RGB color intentities
 ,"TransparentBlocks"    : u'1.0'          ###  for histogram, set 0= fully transparent ... 1 = not transparent
 ,"TransparentBackground": u'1.0'           ### 1.0 = not transparent, 0.0 = transparent, No color is used for background; Default=1.0
 ,"dataSource"           : u'interactive'          ### who create this plot: interactive, import, mini
 ,"Raw"                  : u''          ### raw Gnuplot command
 ,"drawZeroLine"         : u''     ### draw invisible zero line
 ,"compressPNGfile"         : u'False'     ### compress png files futer  true/false
 ,"logLevel"             : u'1'          ###  values: ""=of if debug mode on , 0 = error 1 = regular logging
 }
plug.executeAction("createOrModifyPlot", props =plot2)

line1P2={
   "deviceNameOfPlot"                  : u'macminiü'
  ,"lineNumber"                        : u'1'      ### 1 2 3 4 5 ...
  ,"lineType"                          : u'LineSolid'        ###  LineSolid LineDashed DOT(* + v ^ s o .)  Histogram
  ,"lineKey"                           : u'mac'    ## text for line keys in plot
  ,"lineShift"                         : u'0'    ## text for line keys in plot
  ,"lineWidth"                         : u'1'       ###  0 1 2 3 4 5
  ,"lineColor"                         : u'#A00000'        ### #FFFFFF ... #000000 or 255,255,255 format for RGB color intentities
  ,"lineMultiplier"                    : u'1.0'         ### number to be multiplied with line
  ,"lineOffset"                        : u'0.0'        ###  off of data or shift line up or down
  ,"lineLeftRight"                     : u'Left'        ### use left or right Y scale
  ,"lineSmooth"                        : u'None'       ###  None strong medium week smmoth
  ,"lineEveryRepeat"                   : u'1'     
  ,"lineFromTo"                        : u''     ## if not 0 use as x range for THIS line  format= from:to
  ,"lineNumbersFormat"                 : u''     
  ,"lineNumbersOffset"                 : u''   
  ,"lineFunc"                          : u'None'            # the operation to be applied between lineA and lineB   + - * / S E C None
  ,"deviceOrVariableToBePlottedLineA"  : u's-11-serverRoom-mac'  # device name of data source
  ,"devOrVarA"                         : u'Dev-'  # "Dev-" or "Var-" of data source
  ,"StateToBePlottedLineA"             : u'Temperature'  # see "list available states" section to pick the right state
  ,"MeasurementLineA"                  : u'average'  # options: average sum min max count eConsumption
  ,"multiplierA"                       : u'1.0'  # optional multiply data with value
  ,"offsetA"                           : u'0.0'  # optional add data with value
  ,"minValueA"                         : u'-200.0'  # optional lower cutoff value
  ,"maxValueA"                         : u'50000.0'  # optional high cutoff value
  ,"fillGapsA"                         : u'1'  # optional fill data gaps if no info available with last data point
  ,"resetTypeA"                        : u'"0"'  #  options: 0 Period day week month bin PeriodNoCost dayNoCost weekNoCost monthNoCost binNoCost  only for consumption data
  ,"deviceOrVariableToBePlottedLineB"  : u''
  ,"StateToBePlottedLineB"             : u''
  ,"MeasurementLineB"                  : u''
 ,"logLevel"                           : u'1'          ###  values: ""=of if debug mode on , 0 = error 1 = regular logging
 }
plug.executeAction("createOrModifyLine", props =line1P2)
will recreate a plot with its lines


But anyway .. i could add an exception handler, that makes it 0 if the state is not there anymore, but need to think about the consequences of that, normally if a device state does not exist that is an error and the user should know about it .


Karl

Posted on
Sun Oct 07, 2018 9:44 am
bsp9493 offline
Posts: 153
Joined: Nov 30, 2017
Location: Kelowna, BC

Re: disabling but NOT deleting plotD devices

Thanx Karl...

Think what im going to try is the backup and restore of the config settings.

I have manually backed up my current profile (summer). Then removed the offending data sources and backed up the profile again (winter).

So as long as i dont make any changes until spring, i should just be able to restore the summer config and be good to go.

Thanx for the help

d

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 4 guests