Page 11 of 23

Re: OpenNetHomeServer

Posted: Wed Feb 03, 2016 4:01 pm
by krambriw
Sorry, logging of those additional things will go to the EG log view

Re: OpenNetHomeServer

Posted: Wed Feb 03, 2016 4:05 pm
by Mastiff
OK, no problem. I use Log redirector, so I have file logging. :mrgreen:

Re: OpenNetHomeServer

Posted: Wed Feb 03, 2016 4:08 pm
by Mastiff
And here we go. I have attached the log so far, and it already has lost stuff. :mrgreen:

Re: OpenNetHomeServer

Posted: Wed Feb 03, 2016 7:12 pm
by krambriw
I see the problem (but I do not yet know why)

Your system is for some reason not able to cancel scheduled tasks so it is just adding new ones for every sensor signal that is incoming. After 20 minutes they all begin kicking in and you get hammered by the 'lost sensor' events from then on.

If you look at a sample from my log, you can see how it should work

Code: Select all

19:47:21   NHS.Oregon|112|4| 'Temp|5.0|Hum|58|Batt|0|'
19:47:21   Successfully cancelled task:  (1454525798.612, <bound method Scheduler.LongTask of <Scheduler(SchedulerThread, started 16700)>>, ('Lost contact with sensor: Oregon|112|4|', <bound method NetHomeServer.sensorLost of <eg.CorePluginModule.NetHomeServer.NetHomeServer object at 0x04ADCED0>>), {})
19:47:21   Successfully scheduled task:  (1454525841.4920001, <bound method Scheduler.LongTask of <Scheduler(SchedulerThread, started 16700)>>, ('Lost contact with sensor: Oregon|112|4|', <bound method NetHomeServer.sensorLost of <eg.CorePluginModule.NetHomeServer.NetHomeServer object at 0x04ADCED0>>), {})
Attached a new version trying to track this cancelling problem
__init__.py
(82.57 KiB) Downloaded 115 times

Re: OpenNetHomeServer

Posted: Wed Feb 03, 2016 8:33 pm
by Mastiff
And here's the results. :mrgreen:

Re: OpenNetHomeServer

Posted: Wed Feb 03, 2016 9:16 pm
by krambriw
Sorry, my fault, need to retry with this version instead
__init__.py
(82.57 KiB) Downloaded 76 times

Re: OpenNetHomeServer

Posted: Thu Feb 04, 2016 7:43 am
by Mastiff
Retried for half an hour. :mrgreen:

Re: OpenNetHomeServer

Posted: Thu Feb 04, 2016 9:25 am
by krambriw
OK, it looks like there is a problem with cancelling scheduled tasks (we get this INFO: <p>Error: <type 'exceptions.ValueError'></p> all the time, means the schedule cannot be found)

Just to check if I have a problem inside the plugin or if there is a general problem, can you try to run the following script and see what happens? If it works as expected you should see that the scheduled task is cancelled right away

Code: Select all


def sensorLost(prm):
    print 'Sensor lost', prm

monitored = eg.scheduler.AddTask(
        5,
        sensorLost,
        'Testing'
)
if monitored <> None:
    print 'Successfully scheduled task: ', monitored

eg.scheduler.CancelTask(monitored)
print 'Successfully cancelled task: ', monitored


Re: OpenNetHomeServer

Posted: Thu Feb 04, 2016 9:30 am
by Mastiff
Seems like it's in the plug-in, I'm afraid:

Code: Select all

10:29:34      Successfully scheduled task:  (1454578179.6619999, <bound method Scheduler.LongTask of <Scheduler(SchedulerThread, started 3448)>>, ('Testing', <function sensorLost at 0x0AA35630>), {})
10:29:34      Successfully cancelled task:  (1454578179.6619999, <bound method Scheduler.LongTask of <Scheduler(SchedulerThread, started 3448)>>, ('Testing', <function sensorLost at 0x0AA35630>), {})

Re: OpenNetHomeServer

Posted: Thu Feb 04, 2016 10:17 am
by krambriw
OK, that is anyway better, now I know it is inside the plugin :D

Can you try the following:

- use the attached version and check what is being printed when a sensor event is coming in

- run this python script and copy & paste the result -> so I can study what is actually scheduled

Code: Select all

print eg.plugins.NetHomeServer.plugin.monitor_fineoffset_mem

Best regards, sorry for the inconvenience

PS A pity I do not have a Viking sensor, might be the next to fix
__init__.py
(82.62 KiB) Downloaded 70 times

Re: OpenNetHomeServer

Posted: Thu Feb 04, 2016 10:27 am
by Mastiff
Hey, you make nice stuff that is very useful to me! So I'm glad I can at least do something. :mrgreen:

Sensor input:

Code: Select all

11:25:52   Error: <type 'exceptions.ValueError'>
And all I get from the print is an emtpy set of curling brackets. {}

Re: OpenNetHomeServer

Posted: Thu Feb 04, 2016 10:45 am
by krambriw
OK, thanks,
And if you run this script:

Code: Select all

print eg.plugins.NetHomeServer.plugin.decode_fineoffset_mem

Re: OpenNetHomeServer

Posted: Thu Feb 04, 2016 10:48 am
by Mastiff
Same result. I take it you had expected something else?

Oh, about the Viking: They sell them quite cheaply at Teknikmagasinet. :) I just sendt the new version of it Bert for the RFXtrx (wrote about it in your RFX plug-in thread), since the RFX didn't play nice with it. He was hoping to add support for it. So when he has a firmware that does that, maybe you could be so kind to update the plug-in? :mrgreen:

Re: OpenNetHomeServer

Posted: Thu Feb 04, 2016 11:14 am
by krambriw
Oh, now I am getting worried

When I run a similar script

Code: Select all

print eg.plugins.NetHomeServer.plugin.decode_oregon_mem
I get

Code: Select all

{'Oregon|112|4|': 'Temp|4.4|Hum|54|Batt|0|', 'Oregon|2|2|': 'Temp|-2.1|Hum|84|Batt|0|'}
I think there is a problem in adding sensors to the dictionaries

Finally, before I go a get a Viking, can you try this attached version? It will most likely crash but hopefully give a clue where it fails
__init__.py
(83.49 KiB) Downloaded 74 times

Re: OpenNetHomeServer

Posted: Thu Feb 04, 2016 11:18 am
by Mastiff
You know how to instil confidence! "It will most likely crash." Just the thing I want to hear! :mrgreen: :mrgreen: :mrgreen:

Code: Select all

12:17:53         Exception in thread Tellstick:
12:17:53         Traceback (most recent call last):
12:17:53           File "threading.pyc", line 532, in __bootstrap_inner
12:17:53           File "C:\Program Files (x86)\EventGhost\plugins\NetHomeServer\__init__.py", line 451, in run
12:17:53             self.FineOffsetMessage(fineOffsetMsg)
12:17:53           File "C:\Program Files (x86)\EventGhost\plugins\NetHomeServer\__init__.py", line 581, in FineOffsetMessage
12:17:53             decode_param = self.plugin.decode_fineOffset_mem[s_lst]
12:17:53         AttributeError: 'NetHomeServer' object has no attribute 'decode_fineOffset_mem'
12:17:53         
12:17:56         Exception in thread Tellstick:
12:17:56         Traceback (most recent call last):
12:17:56           File "threading.pyc", line 532, in __bootstrap_inner
12:17:56           File "C:\Program Files (x86)\EventGhost\plugins\NetHomeServer\__init__.py", line 451, in run
12:17:56             self.FineOffsetMessage(fineOffsetMsg)
12:17:56           File "C:\Program Files (x86)\EventGhost\plugins\NetHomeServer\__init__.py", line 581, in FineOffsetMessage
12:17:56             decode_param = self.plugin.decode_fineOffset_mem[s_lst]
12:17:56         AttributeError: 'NetHomeServer' object has no attribute 'decode_fineOffset_mem'
12:17:56