Thingspeak Plugin

Posted on
Mon Mar 10, 2014 12:03 pm
DaveL17 offline
User avatar
Posts: 5854
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Thingspeak Plugin

Thanks to all for the discussion. I was led to believe in my research that it wasn't currently possible to load a dynamic list of states. Maybe there is now?

The nice thing about Karl's method in this instance, is that it returns a nice list of only those states that are worthy of charting--namely numerics and bools.

Karl - I'm in the process of trying to weave your device method into the plugin. I am to the point that I get a combined list of variables and devices, but that's as far as I've been able to get. Need to get to the next step of showing the relevant states for each device. What I hope to get is a dropdown that looks like this:

...
Dev - Upstairs Thermostat (temperatureInput1)
Dev - Upstairs Thermostat (setpointCool)
Dev - Upstairs Thermostat (setpointHeat)
...
Var - Foo1
Var - Foo2
...

Will have more time to spend later today.
Dave

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Mon Mar 10, 2014 1:37 pm
DaveL17 offline
User avatar
Posts: 5854
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Thingspeak Plugin

Not precisely this, but it drives the point home:

Code: Select all
list = []
for dev in indigo.devices:
    for state in dev.states:
        if 'ui' not in state and 'Mode' not in state and 'All' not in state:
            foo = (dev.id, dev.name, state)
            list.append(foo)
        else:
            pass

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Mon Mar 10, 2014 2:06 pm
kw123 offline
User avatar
Posts: 7565
Joined: May 12, 2013
Location: Dallas, TX

Re: Thingspeak Plugin

you need to create a list with 2 items, a number and the text to be presented to the user
either you do a preselection of a device and then create the list for the property or you concatenate the devname-propname as text:

here a high-level onestep solution
retList =[]
rememberList =[]
sequentialnumber =0

for dev in devices
for props in dev
test if property value is number
if yes
increment sequentialnumber
retList.append((sequentialNumber, devname-propname)
rememberList.append(sequentialNumber,devID,PropName) # <== this will be needed when the user selects the device/property so that you know which one it is, you get the seq# and then can get the dev and prop

return retList

[edit] you need to add the self. etc naturally.. look at the indigo plot code. If you like I can walk you through... it took me 10 days to understand the flow and how to make it work..
there are ~14 of these dynamic lists in config
device *2 (modify: list of existing, add new--> show available devices not selected)
property *8 (user can select 8 properties per device + mode, average, count, min/max +expert fields)
plot *2 (modify existing, add ..)
line*2 (modify existing, add ..)
fields for math between lines (add 2 lines, diff 2 lines, */ 2 lines, offset, multiply..)
10+ regular fields for names, colors, size, dashed dotted text ...
+ some buttons to confirm/ delete etc
and some dependencies for what is visible when

Posted on
Mon Mar 10, 2014 3:58 pm
kw123 offline
User avatar
Posts: 7565
Joined: May 12, 2013
Location: Dallas, TX

Re: Thingspeak Plugin

Vae,

here the part of the code that does
1. preselect devices that have a property that is a number
2. present that list or show existing - already used in previous selections(for editing)
3. confirm device selection button
4. preselect props for selected device
5. present list (8 times)
6. confirm props selection.

then tracking will start of the data from these devices/properties, that will be used later in the plots - defined in a similar way


sounds complicated and I believe it is. may be I have done it really complicated and there is an easy way to do this, but I have not found it.

Karl



Code: Select all


   def getNumber(self,val):
      x = ""
      try:
         x = float(val)
         return x
      except:
         xx = ''.join([c for c in val if c in '1234567890.'])
         if len( ''.join([c for c in xx if c in '.']) )           >1: return ""  # remove strings that have 2 or more dots " 5.5 6.6"
         if len( ''.join([c for c in xx if c in '1234567890']) ) !=0: return xx  # remove strings that have letters and dots eg "abc.xyz"
         if len(xx) ==0:
            val = str(val).upper()
            if val== "TRUE"  or val =="ON"  :  x= 1.                                                      # true --> 1,  false --> 0
            if val== "FALSE" or val =="OFF" :  x= 0.
      return x

   ########################################
   
   def preSelectDevices(self):            # Select only device/properties that are supported:  numbers, bool, but not props that have "words"
      self.listOfPreselectedDevices=[]
      self.devIdToTypeandName={}
      self.logMessage(u" listOfPreselectedDevices 1 "+ str(self.listOfPreselectedDevices))

      for dev in indigo.devices.iter():
         theStates = dev.states.keys()
         count =0
         for test in theStates:
            try:
               if "Mode" in test or "All" in test or ".ui" in test:
                  skip= True
               else:
                  skip= False
            except:
               skip=False
            if not skip:   
               val= dev.states[test]
               x = self.getNumber(val)
            if x !="":
               count +=1
         if count>0:                                       # add to the selection list
            try:
               self.listOfPreselectedDevices.append((dev.id, dev.name))            ## give all id's and names of  devices that have at least one of the keys we can track
               self.devIdToTypeandName[dev.id]="Dev-",dev.name
            except:
               self.logMessage(u" listOfPreselectedDevices 2-1 error id, name "+ str(dev.id) + " " +str(dev.id)+" " + str(self.listOfPreselectedDevices),0)


      for theVar in indigo.variables:
         val = theVar.value
         x = self.getNumber(val)
         if x!="":
            try:
               self.listOfPreselectedDevices.append((theVar.id, "Var-"+str(theVar.name)))
               self.devIdToTypeandName[theVar.id]= "Var-",theVar.name
            except:
               self.logMessage(u" listOfPreselectedDevices 2-2 error id, name "+ str(theVar.id) + " " +str(theVar.id)+" " +  str(self.listOfPreselectedDevices),0)

      return

   ########################################
   def pickExistingOrNewDevice(self, valuesDict):

      self.addNewDevice=False

      devNo = valuesDict["selectedExistingOrNewDevice"]
      try:
         devNo= int(devNo)
      except:
         devNo=0
         
      if devNo == 0:
         self.addNewDevice=True
         for ii in range (1,self.numberOfDevices+1):
            if self.deviceNumberIsUsed[ii] ==0:
               self.sequentialDevNo = ii
               break
      else:
         self.sequentialDevNo = devNo


      devID= int(self.deviceId[self.sequentialDevNo])
      if devID !=0:
         valuesDict["selectedDeviceID"] = devID
      else:
         valuesDict["selectedDeviceID"] = 0

      self.logMessage(u" DefineDevices "+ str(valuesDict["DefineDevices"]),"pickExistingOrNewDevice")

      if self.addNewDevice and valuesDict["DefineDevices"]:
         valuesDict["DefineDevicesAndNew"] = True
         valuesDict["DefineDevicesAndOld"] = False
      else:
         valuesDict["DefineDevicesAndNew"] = False
         valuesDict["DefineDevicesAndOld"] = True

      if not self.addNewDevice:            self.buttonConfirmDevice(valuesDict, 0, 0)
      if not self.addNewDevice:            self.buttonConfirmDevice(valuesDict, 0, 0)


      self.logMessage(u" sequentialDevNo "+ str(self.sequentialDevNo),"pickExistingOrNewDevice")
      return valuesDict
   ########################################
   def filterExistingDevice(self, valuesDict,xxx,yyy):

      retList = []

      for devNo in range (1, self.numberOfDevices+1):
         if self.deviceId[devNo] >0:
            retList.append((devNo, self.deviceType[devNo]+self.deviceName[devNo]))
      retList.append((0,"Add New Device to Selection List"))
      self.logMessage(u" retList "+ str(retList),"filterExistingDevice")

      return retList

   ########################################
   def filterDevicesThatQualify(self, valuesDict, xxx, yyy):# Select only device/properties that are supported

      if len(self.listOfPreselectedDevices)==0: return [(0,0)]         # nothing there yet
       
      retList=self.listOfPreselectedDevices[:]                     #  make a copy
       
      if self.sequentialDevNo !=0:                           # just making sure
         devID= int(self.deviceId[self.sequentialDevNo])             # less typing
         if devID != 0:                                    # we have a device id already from indigo use that one as first
            defaultName= self.deviceName[self.sequentialDevNo]
            retList.append((0,defaultName))

      self.logMessage(u" retList "+ str(retList),"filterDevicesThatQualify")
      return retList
   ########################################
   def buttonConfirmDevice(self, valuesDict, xxx, yyy):
      if self.addNewDevice:
         try:
   #         self.sequentialDevNo = int(valuesDict["sequentialDevNo"])
            self.deviceIdNew   = int(valuesDict["selectedDeviceID"])
            self.deviceNameNew  = self.devIdToTypeandName[self.deviceIdNew][1]
            self.deviceTypeNew  = self.devIdToTypeandName[self.deviceIdNew][0]   # "Dev-" or "Var-"
            self.deviceId[self.sequentialDevNo]      = self.deviceIdNew
            self.deviceType[self.sequentialDevNo]   = self.deviceTypeNew
            self.deviceName[self.sequentialDevNo]   = self.deviceNameNew
         except:
            self.logMessage("bad input, no device selected ",0)
            valuesDict["text1-1"] = " no device selected"      # restore to the old one
            return valuesDict
      else:
         if valuesDict["DeleteDevice"]:
            self.DeleteDevice(self.sequentialDevNo,valuesDict)
            valuesDict["text1-1"] = "device deleted"
            valuesDict["DeleteDevice"] = False
            self.sequentialDevNo =0
            return valuesDict

         self.deviceIdNew   = self.deviceId[self.sequentialDevNo]
         self.deviceTypeNew   = self.deviceType[self.sequentialDevNo]
         self.deviceNameNew   = self.deviceName[self.sequentialDevNo]
      


      self.selectablePropertiesInDevice = self.preSelectProps(self.deviceIdNew)
         

      for propNo in range(1,self.numberOfPropertiesPerDevice+1):
         if self.DevicePropsIndex[self.sequentialDevNo][propNo]> 0:
            theResponseGnu      = "... using 1:"+str(int(self.DevicePropsIndex[self.sequentialDevNo][propNo])+2)+" with ..."      # +2:  data starts at columm 3, col1 = timestamp, col2 =
            theResponseDType   = self.DevicePropsDType[self.sequentialDevNo][propNo]
            theResponseProp      = self.DevicePropsName[self.sequentialDevNo][propNo]
         else:
            theResponseGnu      = " "                                                            # if empty dont show any text
            theResponseDType   = "average"                                                                           # if empty dont show any text
            theResponseProp      = 0

         self.logMessage(u"theResponseProp " + str(theResponseProp)  ,"buttonConfirmDevice ")
         valuesDict["selDevicePropertiesa"+str(propNo)] = theResponseProp                                        # by putting a 0 here we enable the default to show up later.. tricky
         valuesDict["selDevicePropsIndex"+str(propNo)]   = theResponseGnu
         valuesDict["selDevicePropsDType"+str(propNo)]   = theResponseDType
         valuesDict["text1-2"] = "  and then confirm !"      # restore to the old one
         valuesDict["text1-1"] = " CONFIRMED/SAVED"      # restore to the old one
         self.logMessage(u"no, id name " + str(self.sequentialDevNo) + " " + str(self.deviceIdNew) + " " + str(self.deviceNameNew)+ " " +str(self.deviceTypeNew) ,"buttonConfirmDevice ")


      return valuesDict
   ########################################
   def preSelectProps(self,devID):            # Select only device/properties that are supported
      retList=[]
#      retList.append((0,"None"))

      if self.deviceTypeNew =="Var-":
         retList.append((self.deviceNameNew, self.deviceNameNew))


      if self.deviceTypeNew =="Dev-":
         dev =  indigo.devices[devID]
         theStates = dev.states.keys()
         for test in theStates:
            try:
               if "Mode" in test or "All" in test or ".ui" in test:
                  skip= True         # reject fanMode etc
               else:
                  skip= False
            except:
               skip=False
            if not skip:   
               val= dev.states[test]
               x = self.getNumber(val)
               if x !="":    retList.append((test, self.tryNiceProperty(test)))


      self.logMessage(u"retList" + str(retList) ,"preSelectProps ")

      return retList

   ########################################
   def tryNiceProperty (self, inProp):
      try:
         return  self.propertyNiceWords[inProp]      # replace property with nice list if available
      except:
         return inProp

   ########################################
   def selDeviceProperties1 (self, filter="", valuesDict=None, xxx="", targetId=0):
      return self.selectDevicePropertiesAll(valuesDict,1)
   def selDeviceProperties2 (self, filter="", valuesDict=None, xxx="", targetId=0):
      return self.selectDevicePropertiesAll(valuesDict,2)
   def selDeviceProperties3 (self, filter="", valuesDict=None, xxx="", targetId=0):
      return self.selectDevicePropertiesAll(valuesDict,3)
   def selDeviceProperties4 (self, filter="", valuesDict=None, xxx="", targetId=0):
      return self.selectDevicePropertiesAll(valuesDict,4)
   def selDeviceProperties5 (self, filter="", valuesDict=None, xxx="", targetId=0):
      return self.selectDevicePropertiesAll(valuesDict,5)
   def selDeviceProperties6 (self, filter="", valuesDict=None, xxx="", targetId=0):
      return self.selectDevicePropertiesAll(valuesDict,6)
   def selDeviceProperties7 (self, filter="", valuesDict=None, xxx="", targetId=0):
      return self.selectDevicePropertiesAll(valuesDict,7)
   def selDeviceProperties8 (self, filter="", valuesDict=None, xxx="", targetId=0):
      return self.selectDevicePropertiesAll(valuesDict,8)

   ########################################
   def selectDevicePropertiesAll (self, valuesDict, propNo):
      if self.sequentialDevNo ==0: return [(0,0)]
      propPreviouslySelected=  self.DevicePropsName[self.sequentialDevNo][propNo]                                 # is there a previously selected dev/property, if yes use it

      retList = self.selectablePropertiesInDevice[:]                                             # make a copy for this property
      if propPreviouslySelected !="None":                                                         # use the old one if there
         retList.append( (0,self.tryNiceProperty(propPreviouslySelected)) )                                             # make it the fist to show up (the 0)
      self.logMessage(u"retList" + str(retList) ,"selectDevicePropertiesAll ")

      return retList
   ########################################
   def buttonConfirmDeviceProps(self, valuesDict, xxx, yyy):                                       # thsi will store the selected dev/props
      error = 0
      devNo= self.sequentialDevNo
      oldlineDataSourceCount = self.lineDataSourceCount

      if self.deviceName[devNo] !="":

         for propNo in range (1, self.numberOfPropertiesPerDevice+1):
            theDeviceProp = valuesDict["selDevicePropertiesa"+str(propNo)]
            theDeviceDType = valuesDict["selDevicePropsDType"+str(propNo)]
            self.logMessage(u" propNo theDeviceProp theDeviceDType " + str(propNo) +" " + str(theDeviceProp) +" " + str(theDeviceDType),"buttonConfirmDeviceProps")

            if theDeviceProp!=0:                                                            # if = 0 now change, keep what we have.
                  
               if theDeviceProp !="" and theDeviceProp!="None":                                    # anything meaing full returned or not selected
                  skip = 0
                  for ii in range(1,self.lineDataSourceCount+1):
                        
                     devNo2= self.devPropUsedIndex[ii][0]                              # devNo of already stored device numbers
                     propNo2= self.devPropUsedIndex[ii][1]                              # propNo of already stored device numbers
                     if devNo2 == devNo and propNo ==propNo2 and theDeviceDType == self.DevicePropsDType[devNo2][propNo2]:
                        skip =2                                                   # this is "me"
                     else:
                        if devNo2 == devNo and self.DevicePropsName[devNo2][propNo2] == theDeviceProp and theDeviceDType == self.DevicePropsDType[devNo2][propNo2]:   # already in list? then skip it!
                           skip = 1
                           valuesDict["selDevicePropertiesa"+str(propNo)] = self.DevicePropsName[devNo][propNo]      # restore to the old one
                           valuesDict["selDevicePropsDType"+str(propNo)] = self.DevicePropsDType[devNo][propNo]         # restore to the old one
                           error = propNo
                           break
                        
                  if skip == 0:
                     self.deviceNumberIsUsed[devNo]=1      # at least one accepcted property
                        ### this is the selction menue touple for the plot lines to choose data from:
                     self.lineDataSourceCount+=1
                     self.sqlUpdateList[self.lineDataSourceCount]=True
                     if self.deviceType[devNo] =="Var-":
                        self.lineDataSource.append((str(self.lineDataSourceCount),"Var-"+theDeviceDType+"-"+self.deviceName[devNo]))
                     if self.deviceType[devNo] =="Dev-":
                        self.lineDataSource.append((str(self.lineDataSourceCount),theDeviceDType+"-"+self.deviceName[devNo]+"-"+self.tryNiceProperty(theDeviceProp)))
                     self.logMessage(u"lineDataSource" + str(self.lineDataSourceCount)+" " +theDeviceDType+"-"+self.deviceName[devNo]+"-"+self.tryNiceProperty(theDeviceProp),"buttonConfirmDeviceProps")
                        
                     ### this is the list of combinations that are active:  dev,prop
                     self.devPropUsedIndex[self.lineDataSourceCount]= [int(devNo),int(propNo)]                     # used later by plot/line slection to pick the index
                     self.DevicePropsName[devNo][propNo]= theDeviceProp                              # = "property value"
                     self.DevicePropsDType[devNo][propNo]= theDeviceDType                           # = "average/sum/count/min/max"
                     self.DevicePropsIndex[devNo][propNo]= self.lineDataSourceCount                     # = "line index"

               if self.DevicePropsIndex[devNo][propNo]> 0:
                  theResponse = "... using 1:($"+str(int(self.DevicePropsIndex[devNo][propNo])+2)+"*Multiplier +Offset) with ..."      # +2:  data starts at columm 3, col1 = timestamp, col2 =
               else:
                  theResponse = " "                                                            # if empty dont show any text
               valuesDict["selDevicePropsIndex"+str(propNo)] = theResponse
      if error > 0:
         valuesDict["text1-2"] = "..property "+str(error)+" already used.."      # restore to the old one
      else:
         valuesDict["text1-2"] = "CONFIRMED & SAVED"      # restore to the old one
      if self.lineDataSourceCount > oldlineDataSourceCount: self.devicesAdded =1

      self.logMessage(u"DevicePropsName " + str(self.DevicePropsName) ,"buttonConfirmDeviceProps")
      self.logMessage(u"DevicePropsDType" + str(self.DevicePropsDType),"buttonConfirmDeviceProps")
      self.logMessage(u"lineDataSource" + str(self.lineDataSource),"buttonConfirmDeviceProps")

      return valuesDict



Posted on
Mon Mar 10, 2014 8:27 pm
DaveL17 offline
User avatar
Posts: 5854
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Thingspeak Plugin

Plugin version 0.5.2 is now available in the library. Version 0.5.2 fixes two bugs:
(1) a change in the upload interval now takes effect without having to reload the plugin (takes effect the on the next upload cycle.)
(2) the plugin no longer scrapes decimal points from variable values when scraping alpha characters.

Dave

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Tue Mar 11, 2014 6:39 pm
DaveL17 offline
User avatar
Posts: 5854
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Thingspeak Plugin

It took some time for me to figure out, but I've got the dynamic states reloading only the relevant states for a selected device using the dynamic reload prop. The key was to add a button to trigger the dynamic reloads. I still need to figure out how to do more than one state list on the same config dialog, but I'm on my way. Please forgive if this doesn't format properly as I'm doing it on my mobile...

plugin.py:
Code: Select all
# ===============================================================
# List generators for device config menus.
# ===============================================================
def deviceListGenerator(self, filter="", valuesDict=None, typeId="", targetId=0):
   
   returnList = list()
   if not valuesDict:
      valuesDict = {}
   for devId in indigo.devices.iterkeys():
      returnList.append((str(devId),indigo.devices.get(devId).name))
   return returnList
         
# ===============================================================
# List generators for device config menus.
# ===============================================================
def deviceStateGenerator(self, filter="", valuesDict=None, typeId="", targetId=0):

   stateList = list()
   if valuesDict and "thing1Dev" in valuesDict:
      deviceString = int(valuesDict["thing1Dev"])
      for state in indigo.devices[deviceString].states:
         stateList.append(state)
   return stateList

And devices.xml:
Code: Select all
<Field id="thing1Dev" type="menu" defaultValue="None">
   <Label>Device 1:</Label>
   <List class="self" filter="" method="deviceListGenerator" dynamicReload="true"/>
</Field>

<Field id="thing1DevState" type="menu" defaultValue="None">
   <Label>Device 1 State:</Label>
   <List class="self" filter="" method="deviceStateGenerator" dynamicReload="true"/>
</Field>

<Field id="thing1Button" type="button" defaultValue="None">
   <Label>Refresh States:</Label>
   <Title>Refresh</Title>
   <CallbackMethod>deviceListGenerator</CallbackMethod>
</Field>

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Tue Mar 11, 2014 7:07 pm
kw123 offline
User avatar
Posts: 7565
Joined: May 12, 2013
Location: Dallas, TX

Re: Thingspeak Plugin

yes you are on your way ..

Posted on
Thu Mar 13, 2014 10:03 am
jay (support) offline
Site Admin
User avatar
Posts: 16674
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Thingspeak Plugin

You don't build a single list of all possible states - you build a list of devices, then when the user selects the device, you build the list of states.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Mar 13, 2014 11:08 am
DaveL17 offline
User avatar
Posts: 5854
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Thingspeak Plugin

Thanks Jay. I'm am now much further along now than I was a couple days ago.

I now have two custom device types. One for variables and one for devices. The variable type allows the user to select up to 8 variables. The device type allows the user to select up to 8 devices, and then only the relevant states are shown for each device. I wound up constructing individual callback methods for each choice, but I'm not sure that this is the most efficient way. Also, it would be nice if a user could have variables and devices together; I need to think through whether that's possible.

- I need to do some clean up to handle empty "no selection" menus and to allow the user to delete prior choices.

- I need to build in the state selection criteria to limit the states list to only chartable states (thanks to Karl, I have this).

- I would like to be able to use visible bindings for the device state list menu items, but I'm not sure it's possible (the docs say you need to tie to menu options chosen, but I won't know those ahead of time.)

- I rewrote the code used to build the upload URLs by iterating through the choices and constructing dicts directly--eliminating a couple hundred lines of code.

- Still need to button down some error handling (source device deleted, etc.)

But I am able--albeit at a basic level right now--to be able to handle both variables and devices and for that I'm very grateful.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Thu Mar 13, 2014 11:56 am
jay (support) offline
Site Admin
User avatar
Posts: 16674
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Thingspeak Plugin

Yeah, sorry I was late on that one (and I didn't follow the thread to the next page). It does look like you've got a handle on it.

Some suggestions:

  • Object IDs are unique across the entire database so you can just combine all devices and variables into a single list if you want - then in the callback just try to get the device with that id and if it fails then try to get a variable instead
  • Not sure how you're showing the 8 variables and 8 devices, but if you looked at the custom device example plugin in the SDK it shows how you can implement a way for a user to manage a basically infinite list of objects by adding/removing them. Not sure if that's helpful in your UI though.
  • Visibile bindings can happen against any type (though in practice some are kinda silly). If none of your visible UI elements are appropriate to bind against, you can always add hidden elements (like a checkbox or something) that you manage yourself in your callbacks that can help.

Just some things to think about. You can actually build some pretty complex UIs though of course it does require some roundabout thinking sometimes.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue Mar 25, 2014 7:01 pm
DaveL17 offline
User avatar
Posts: 5854
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Thingspeak Plugin

UPDATE: Development continues on the Thingspeak plugin. The next version will have one type of device -- a combination device -- which allows for a mixture of both device states and variable values on one consolidated UI. The UI itself still needs work, and I still need to do a fair bit of QA, but the results have been promising.

Unfortunately, in order to avoid potential problems and unnecessary complexity on the back end, it was necessary to drop the separate [variable value] and [device state] device types. As a result, it will be necessary to recreate any devices when moving to the next version. While a small hassle to be sure, I think that it's totally worth it. Devices can be recreated in just a minute or two. Of course, the prior version of the plugin will still work.

The new version isn't available yet--I'll post here when it is.
Dave

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Tue Mar 25, 2014 7:28 pm
durosity offline
User avatar
Posts: 4031
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Thingspeak Plugin

Looking forward to it! Having devices and variables mixed together will be a major improvement!

Computer says no.

Posted on
Wed Mar 26, 2014 9:20 am
DaveL17 offline
User avatar
Posts: 5854
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Thingspeak Plugin

durosity wrote:
Looking forward to it! Having devices and variables mixed together will be a major improvement!

Thanks! Getting there...
Attachments
thing combined.png
thing combined.png (104.67 KiB) Viewed 3826 times

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Sun Mar 30, 2014 9:02 pm
DaveL17 offline
User avatar
Posts: 5854
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Thingspeak Plugin

Available Now: Thingspeak Plugin v0.7.1

The newest version of the Thingspeak plugin allows for device states and variable values in the same Thingspeak device. It also includes a lot of under-the-hood improvements and refinements.

With the extensive changes that have been made to the plugin, it is very important to delete existing Thingspeak devices before installing the upgraded plugin. Hopefully, this will be the last time that step will be needed.

Once the plugin upgrade is installed, for each device:
- select a device or variable that you want to chart.
- click on the checkbox to show the settings and then click the refresh button.
- in the second drop-down, select the device state or the variable value that you want to chart.

Please post here if you have any problems, questions or bugs to report.

Cheers,
Dave

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Sat Feb 21, 2015 2:11 pm
BassMint offline
Posts: 105
Joined: Dec 24, 2013

Re: Thingspeak Plugin

I'm running my own thingspeak server on the same host as Indigo.
I had to modify the plugin.py file in the plugin to change the address.

Perhaps you can make that a option if others want to point to another server
Or another option to be able to set it on a per device basis. Would make for truly Public and Private Channels.

Who is online

Users browsing this forum: No registered users and 1 guest