Page 10 of 23
Re: OpenNetHomeServer
Posted: Tue Jul 14, 2015 8:48 am
by Mastiff
No, I wasn't that high up, fourth or fifth step (didn't count on the way up or the way down...). Not like two years ago, when I fell down around three meters from another ladder while on my way up to work on the roof of the cabin. That time the ladder slid on the terrace... Limped for a few days that time! So the cabin has cost me a bit of pain here and there!

No pain, no gain, I guess.
And OK, then I will simply use the lost messages to detect the loss of it, thanks! That message is generated when I start up EG with ONH running but without the Tellstick connected to ONH. Maybe it's a magic version I have?

Re: OpenNetHomeServer
Posted: Tue Jul 14, 2015 9:55 am
by krambriw
That message is generated when I start up EG with ONH running but without the Tellstick connected to ONH
If you say so, I will need to verify myself, but for sure, once ONH with Tellstick is up and running and you then remove the stick, this is not reported by ONH (Long time ago I complained to Stefan about this)
http://forum.opennethome.org/viewtopic.php?f=5&t=35
Re: OpenNetHomeServer
Posted: Tue Jul 14, 2015 11:16 am
by Mastiff
I put a message in the thread myself. Maybe he responds to group pressure!

Re: OpenNetHomeServer
Posted: Tue Aug 11, 2015 10:49 am
by Mastiff
Hi, man! Long summer (well, green winter is more like it), lots to do, but I'm slowly getting back to normal again now. Which means working on the system and trying to find ways to do stuff better. I just got an idea for finding out if the Tellstick is connected: Is it possible to use code against the web interface of ONH? When I open this page directly:
http://127.0.0.1:8020/home?page=settings&subpage=log
I get the log display. For my part (I'm only using it for the Tellstick, as you know) there isn't all that much in it. But there are a few interesting things:
Code: Select all
<tr>
<td><img src="web/home/warn.png" /></td>
<td>15.08.11 12:34:43</td>
<td>Tellstick</td>
<td>Error in serial communication, disconnecting</td>
</tr>
<tr>
<td><img src="web/home/info.png" /></td>
<td>15.08.11 12:34:43</td>
<td>Tellstick</td>
<td>Received from Tellstick: ERROR</td>
</tr>
<tr>
<td><img src="web/home/warn.png" /></td>
<td>15.08.11 12:34:43</td>
<td>TellstickPort</td>
<td>failed to read from Tellstick serial port: </td>
</tr>
So this table contains everything that's necessary to know, and since it's dynamic, wouldn't it be possible to check that code maybe once a minute (if it doesn't take too much resources, which I don't think it should), parse it and then fire an event if the result contains for instance "Tellstick: ERROR" or "Error in serial communication, disconnecting"? Then I could use that to restart ONH, and if it doesn't connect and give me a sensor reading within a minute or two then I'll do a reboot of the VM. Of course the it would be even better just to check the connection status of the Tellstick, in the page Hardware. The problem in that one is that when physically disconnecting the Tellstick it won't react, at least not for very long. I've waited 15 minutes, and still refreshing the Hardware page only gave me "Connected". But the log stuff appears at once if something happens.
Re: OpenNetHomeServer
Posted: Tue Aug 11, 2015 1:03 pm
by krambriw
Idea is good
However, it might be better and easier to use the REST interface (the plug is already doing that for other reasons)
If I use the url
http://192.168.10.253:8020/rest/items/Tellstick
I get this response:
Code: Select all
{"name":"Tellstick","id":"61","className":"TellstickDuo","category":"Hardware","actions":["reconnect"],"attributes":[{"name":"State","value":"Connected","readOnly":true,"default":true},{"name":"ReceivedProtocols","value":"Nexa,Oregon,NexaL","type":"Strings","valueList":["FineOffset","Nexa","Oregon","RollerTrol","UPM","NexaL"]},{"name":"TransmittedProtocols","value":"Pronto,Deltronic,Waveman,Nexa,NexaL,X10,Zhejiang,Emotiva,NexaFire,RisingSun,RollerTrol","type":"Strings","valueList":["Pronto","Deltronic","Waveman","Nexa","NexaL","X10","Zhejiang","Emotiva","NexaFire","RisingSun","RollerTrol"]},{"name":"PortName","value":"/dev/ttyUSB0","type":"StringList","valueList":["/dev/ttyUSB0"]},{"name":"FirmwareVersion","value":"12","readOnly":true},{"name":"ReceivedMessages","value":"167276","readOnly":true},{"name":"SentMessages","value":"0","readOnly":true}]}
As you have noted, it does not help to check the state value. Instead it could be possible to monitor that number of received messages has increased during a specified time interval (like at least one more in five minutes or so)
Best regards, Walter
PS still waiting for your wind data samples...
Re: OpenNetHomeServer
Posted: Tue Aug 11, 2015 1:14 pm
by Mastiff
Sounds like a better idea (which I of course should expect...). As for the wind I was a bit full of hot air...

I took it down from the new place where it was in the Tellstick's reach because of a less fortunate conflict with a power cable to the cabin when the wind was heavy!

So I just put it aside for the summer, but I will get it back up in a better place soon!
Btw do you know if it is possible to have an Oregon rain meter up during the winter, or will it freeze apart? If it's possible I can put my rain meter up on the same place.
Re: OpenNetHomeServer
Posted: Tue Aug 11, 2015 2:30 pm
by krambriw
will it freeze apart?
Don't think it is a problem since the water captured is not kept in a closed caption. I had mine outside for several years without problems (except changing batteries from time to time, using those expensive lithium variants)
Re: OpenNetHomeServer
Posted: Tue Aug 11, 2015 6:34 pm
by krambriw
I have made a modification that I believe is working, at least during my testing...
You will get an event
Code: Select all
20:33:24 OpenNetHome.TellstickDuo is disconnected
if the TellStick Duo hasn't received any messages during a time out period (the same as the socket connection timeout you have configured for the plugin). I am currently running this with 30 seconds time out.
Re: OpenNetHomeServer
Posted: Wed Aug 12, 2015 5:55 am
by krambriw
Just a minor mod this morning, to cover the use case that a TellStick Classic is connected. This one doesn't receive any signals but could potentially fool my logic to believe it was disconnected. Anyway, this version of the plugin does not monitor TellStick Classic devices, only Duo (to monitor the Classic would require to check number of messages being sent).
Version uploaded
Re: OpenNetHomeServer
Posted: Sat Sep 05, 2015 7:11 am
by krambriw
Made an improvement (I think) of the TellStick device monitoring function. New version uploaded.
Re: OpenNetHomeServer
Posted: Mon Sep 07, 2015 10:48 am
by krambriw
Further improvements (I think) of the TellStick device monitoring function. New version uploaded.
Re: OpenNetHomeServer
Posted: Tue Sep 22, 2015 6:53 am
by krambriw
Further improvements of the TellStick device monitoring function. New version uploaded.
Re: OpenNetHomeServer
Posted: Wed Feb 03, 2016 8:49 am
by Mastiff
Hi, Krambriw! I have a problem with many "Lost contact with sensor" on my system. I haven't really paid attention before, I thought it was sensors with a weak signal, but I just discovered that there's something else strange going on. Look at this logging output:
Code: Select all
09:42:35 Tellstick.FineOffset|1253 'Temp|21.2'
09:43:23 Tellstick.FineOffset|1253 'Temp|21.2'
09:43:23 OpenNetHome.'Lost contact with sensor: FineOffset|1253'
I have my plug-in set at 600 seconds for Time Out for socket connection, which should be ten minutes. And in the instance I call Tellstick I have time out for lost sensors to 1200 seconds, which should be 20 minutes. Delay of repeats 5, but that shouldn't matter at all.
Do you have any idea what this can be? I'm running the latest version of the plugin (upgraded today). This is my home system, where I have experimented less (I put new versions at the cabin system first for a while), so before I was running the version from March last year.

Re: OpenNetHomeServer
Posted: Wed Feb 03, 2016 3:13 pm
by krambriw
Well, could be a bug ; but when I look at the code it should work...at least it works for my oregon sensors.
The function is that every time a sensor sends a signal that is received, a current schedule is stopped and a new is started that eventually will give you the 'lost sensor' event when it fired.
At any time during run-time you can verify what schedules are pending using the following command in the python shell:
Code: Select all
eg.plugins.NetHomeServer.plugin.monitor_fineoffset_mem
I have added some code in the attached test version that will log more in details what is happening during this process to help us debug if things are working or not
Best regards
Re: OpenNetHomeServer
Posted: Wed Feb 03, 2016 3:55 pm
by Mastiff
OK, I have installed the new version. So I let it run for a few hours and check the log? It's set to log events to file.
