Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

OpenNetHomeServer

Questions and comments specific to a particular plugin should go here.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: OpenNetHomeServer

Post by krambriw »

Sorry, logging of those additional things will go to the EG log view
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: OpenNetHomeServer

Post by Mastiff »

OK, no problem. I use Log redirector, so I have file logging. :mrgreen:
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: OpenNetHomeServer

Post by Mastiff »

And here we go. I have attached the log so far, and it already has lost stuff. :mrgreen:
Attachments
Lost contact log.txt
(160.89 KiB) Downloaded 90 times
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: OpenNetHomeServer

Post 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 114 times
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: OpenNetHomeServer

Post by Mastiff »

And here's the results. :mrgreen:
Attachments
NetHome error log 2.txt
(452.73 KiB) Downloaded 44 times
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: OpenNetHomeServer

Post by krambriw »

Sorry, my fault, need to retry with this version instead
__init__.py
(82.57 KiB) Downloaded 75 times
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: OpenNetHomeServer

Post by Mastiff »

Retried for half an hour. :mrgreen:
Attachments
EventGhost_Log.txt
(221.82 KiB) Downloaded 46 times
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: OpenNetHomeServer

Post 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

Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: OpenNetHomeServer

Post 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>), {})
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: OpenNetHomeServer

Post 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 69 times
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: OpenNetHomeServer

Post 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. {}
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: OpenNetHomeServer

Post by krambriw »

OK, thanks,
And if you run this script:

Code: Select all

print eg.plugins.NetHomeServer.plugin.decode_fineoffset_mem
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: OpenNetHomeServer

Post 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:
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: OpenNetHomeServer

Post 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 73 times
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: OpenNetHomeServer

Post 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         
Post Reply