73 Billion Errors.... 'actionControlSensor'

Posted on
Wed Nov 14, 2018 7:19 pm
DPattee offline
Posts: 453
Joined: Jan 14, 2004
Location: Redmond, WA

73 Billion Errors.... 'actionControlSensor'

My log just got flooded with like 50 of these:
uniFiAP Error plugin does not define method actionControlSensor

I was running version .145, I just saw a .146 was released a couple days ago so I updated to that and it didn't help - more errors appeared.

Then all of a sudden the errors just stopped?

Posted on
Wed Nov 14, 2018 9:28 pm
kw123 offline
User avatar
Posts: 8360
Joined: May 12, 2013
Location: Dallas, TX

Re: 73 Billion Errors.... 'actionControlSensor'

that statement is correct: "uniFiAP Error plugin does not define method actionControlSensor"... I checked .. in the last 2 months and that method was never in the plugin .. neither in .plugin.py nor in actions nor in menu..

Is there any other error with line# etc ==> first error after you start plugin

This might be indigo calling the plugin in an action .. don't know what this is ..

anything else that was changed?

Karl

Posted on
Thu Nov 15, 2018 11:04 am
kw123 offline
User avatar
Posts: 8360
Joined: May 12, 2013
Location: Dallas, TX

Re: 73 Billion Errors.... 'actionControlSensor'

actionControlSensor is actually an action that indigo uses.. and the plugin does not have that method.

it is an action that indigo initiates.

put a dummy method in for the time being until I understand what that does ... have not found any description besides that it was introduced some time in indigo 6.x
see v .147 posted

Karl

Posted on
Thu Nov 15, 2018 12:07 pm
jay (support) offline
Site Admin
User avatar
Posts: 18212
Joined: Mar 19, 2008
Location: Austin, Texas

Re: 73 Billion Errors.... 'actionControlSensor'

From the plugin.py file in the Example Device - Sensor.indigoPlugin:

Code: Select all
   ########################################
   # Sensor Action callback
   ######################
   def actionControlSensor(self, action, dev):
      ###### TURN ON ######
      # Ignore turn on/off/toggle requests from clients since this is a read-only sensor.
      if action.sensorAction == indigo.kSensorAction.TurnOn:
         indigo.server.log(u"ignored \"%s\" %s request (sensor is read-only)" % (dev.name, "on"))
         # But we could request a sensor state update if we wanted like this:
         # dev.updateStateOnServer("onOffState", True)

      ###### TURN OFF ######
      # Ignore turn on/off/toggle requests from clients since this is a read-only sensor.
      elif action.sensorAction == indigo.kSensorAction.TurnOff:
         indigo.server.log(u"ignored \"%s\" %s request (sensor is read-only)" % (dev.name, "off"))
         # But we could request a sensor state update if we wanted like this:
         # dev.updateStateOnServer("onOffState", False)

      ###### TOGGLE ######
      # Ignore turn on/off/toggle requests from clients since this is a read-only sensor.
      elif action.sensorAction == indigo.kSensorAction.Toggle:
         indigo.server.log(u"ignored \"%s\" %s request (sensor is read-only)" % (dev.name, "toggle"))
         # But we could request a sensor state update if we wanted like this:
         # dev.updateStateOnServer("onOffState", not dev.onState)


Some sensor devices (like motion sensors) allow you to turn on/off in Indigo. If you can't perform any actions on them, you could just as easily:

Code: Select all
   def actionControlSensor(self, action, dev):
        pass


Not sure what he had that was trying to turn on/off/toggle the device, but something did somehow.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Nov 15, 2018 12:46 pm
kw123 offline
User avatar
Posts: 8360
Joined: May 12, 2013
Location: Dallas, TX

Re: 73 Billion Errors.... 'actionControlSensor'

Ok thanks. Have added hat roughly.


Sent from my iPhone using Tapatalk

Posted on
Thu Nov 15, 2018 3:30 pm
DPattee offline
Posts: 453
Joined: Jan 14, 2004
Location: Redmond, WA

Re: 73 Billion Errors.... 'actionControlSensor'

Ah! It was one of my super old scripts :lol:

I have a few 'startup actions' that run normally just once a week at 3 in the morning when my server does a scheduled reboot. But I'd accidentally power-cycled that machine when I was doing maintenance on another one, so those scripts all ran in the middle of the day.

My 'Status Poll' action is just an embedded AppleScript that is delayed 45 seconds after 'startup' and then runs through every device to get its current state, with the intention of getting Indigo's understanding of the world up-to-date with any changes that occurred while it was offline. (Since it would run after a power failure, or after a server reboot, or any number of other events where switches might be toggled without Indigo running). A side effect is it also finds dying switches for me if I pay attention to the log (there will be red 'no acknowledgement' lines for dying switches)

Code: Select all
with timeout of 120 seconds
   try
      repeat with curDevice in devices
         status request (curDevice)
         delay 3
      end repeat
   end try
end timeout

Posted on
Thu Nov 15, 2018 10:40 pm
kw123 offline
User avatar
Posts: 8360
Joined: May 12, 2013
Location: Dallas, TX

Re: 73 Billion Errors.... 'actionControlSensor'

you know that this apple script will stop all other indigo activities while it is running?

any command like dev = indigo.devices[devID] will likely timeout and create havoc!! :evil: :evil: :evil:

Code: Select all
for dev in indigo.devices:
   lastchange = dev.lastChanged
   if "status" in dev.states:
      indigo.server.log(dev.name+"  has status: "+ unicode(dev.states["status"])+"  last changed:" + unicode(lastchange)  )
   else:
      try:
         indigo.server.log(dev.name+"  has onState: "+unicode(dev.onState)+"  last changed:" + unicode(lastchange))
      except: pass

this should do roughly the same in python:
Code: Select all
Script                          UniFi_sw_3_1_kons  has status: up  last changed:2018-10-14 01:11:43
   Script                          UniFi_sw_3_2_kons  has status: up  last changed:2018-10-14 01:11:43
   Script                          windowDinning  has onState: True  last changed:2018-11-15 17:17:04
   Script                          WindowDownstairs1  has onState: False  last changed:2018-09-12 09:29:27
   Script                          windowDownstairs2  has onState: False  last changed:2013-12-07 16:15:17
   Script                          WindowsKons  has onState: False  last changed:2018-09-28 11:49:04
   
   


Karl

Posted on
Fri Nov 16, 2018 12:50 pm
jay (support) offline
Site Admin
User avatar
Posts: 18212
Joined: Mar 19, 2008
Location: Austin, Texas

Re: 73 Billion Errors.... 'actionControlSensor'

Actually, his AppleScript will force all devices to update their state (thus causing tons of traffic on whatever technology he's using: Insteon, Z-Wave, etc). The equivalent Python script is:

Code: Select all
for dev in indigo.devices:
    try:
        indigo.device.statusRequest(dev)
    except:
        pass


But, I would highly recommend that you NOT do this. Status requests can be expensive, particularly in Insteon networks, and will likely do more harm than good because of all the extra traffic that it'll generate (potentially causing even more failures). If you have specific devices that somehow get out of sync, then you can do those, but going through every device in the system is not advised.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sat Nov 17, 2018 10:26 am
kw123 offline
User avatar
Posts: 8360
Joined: May 12, 2013
Location: Dallas, TX

Re: 73 Billion Errors.... 'actionControlSensor'

Jay,

it looks like "indigo.device.statusRequest(dev)"
does not call "actionControlSensor" but should call "actionControlUniversal"
that one has a status request. ?

Added actionControlUniversal also to avoid issues to the unifi plugin,
BUT was not able to call it with indigo.device.statusRequest(dev)
Is this only enabled for certain types of devices?

Karl
Code: Select all
   ########################################
   # General Action callback
   ######################
   def actionControlUniversal(self, action, dev):
      ###### BEEP ######
      if action.deviceAction == indigo.kUniversalAction.Beep:
         # Beep the hardware module (dev) here:
         # ** IMPLEMENT ME **
         indigo.server.log(u"sent \"%s\" %s" % (dev.name, "beep request"))

      ###### STATUS REQUEST ######
      elif action.deviceAction == indigo.kUniversalAction.RequestStatus: #####<<<<<<=======
         # Query hardware module (dev) for its current status here:
         # ** IMPLEMENT ME **
         indigo.server.log(u"sent \"%s\" %s" % (dev.name, "status request"))


Posted on
Sat Nov 17, 2018 1:53 pm
jay (support) offline
Site Admin
User avatar
Posts: 18212
Joined: Mar 19, 2008
Location: Austin, Texas

Re: 73 Billion Errors.... 'actionControlSensor'

Yeah, his errors weren't from a status request given the name of the missing method in the errors.

I think a device has to set supportsStatusRequest property to True in order for that method to get called.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests