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.

TellStick Duo

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: TellStick Duo

Post by krambriw »

Yeah, that's maybe the only reason. On the other hand, sending every time (minute) the event arrives might not be so dramatic, the transmission is rather short. It is also a kind of safe guarding by synchronizing if for instance the device has been turned off or on manually.
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: TellStick Duo

Post by Mastiff »

Yeah, I like it exactly as a safeguard. If it isn't picked up the once time it for instance turns off, I may come to a room with 35 degrees because EG thinks it's already turned it off! :mrgreen: So that's why I prefer to send on every sensor reading.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: TellStick Duo

Post by krambriw »

Yes, you are right, in such a use case it gets critical so then it is better with repeats like that
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: TellStick Duo

Post by krambriw »

@Mastiff
Does that give me the right to call you "young man"?

How you feel and what you are...I'm a bit ahead of you, already sixty this year!

Anyway, I did add another feature to the NetHome (NH) plug, you can now also control lamps defined in NH. In the attached version there is a new action 'SendCommand'. If you add it to the EG configuration it checks with NH for available controls (in this case the category 'Lamps' is so far the only relevant) and depending on which one you select, the available commands for that object is selectable. During the initial tests I think that the operation now is very fast. Let's see what you think.
__init__.py
(58.53 KiB) Downloaded 96 times
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: TellStick Duo

Post by Mastiff »

OK, I bow to your seniority! :) Me, I'm 16 years in my head and very shocked that they let me ride a motorcycle that can go over 300 kmh! ;)

Wow, you're starting to read my mind! Just yesterday I thought "maybe I could ask Krambriw to implement send as well". I haven't defined any real items yet, I only have the three lights in the standard setup. And I can't get them to work. Silliest thing is that I messed around with the ports in NetHomeServer and managed to loose the NHS to EG that was running! Tried to recreate it, but didn't get it back. Shouldn't the correct setup be a port 8020 in NetHomeServer? I edited the IP address in the new python file to 192.168.2.100, which is the localhost for this setup. No way. :(

But there may be a more serious problem there. I created an action, and tested it. But I wanted to edit it and double clicked on the action. EG locked up and had to be killed. This happens every time.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: TellStick Duo

Post by krambriw »

I have a TCP and a UDP Command port on 8005. Port 8020 is default for the webserver and the REST interface so if you have changed the previus ports to the same, I think it will be a bit messed up.
I created an action, and tested it. But I wanted to edit it and double clicked on the action. EG locked up and had to be killed. This happens every time.
Well it is not fool proof at this stage...if you have messed up with the port settings above, it will not work since every time you open the configuration for the action, the code is trying to retrieve the current config from NetHome so that you always have the latest
srki76
Posts: 9
Joined: Sat Feb 07, 2015 10:14 am

Re: TellStick Duo

Post by srki76 »

krambriw wrote: 3) Eventually consider to build in a status memory in the scripts to avoid that the commands are repeated every minute when the event arrives (this is a second step we can discuss when you have the first part)
BestR
First,

thank You so much for the script, I dont know anything about python. I just C/P it under event (picture attached) and wait what will happens when the values are reached.
Regarding quoted part, if I dont want macro to repaeat itself i do the following:
P.S. Should I erase values ('63' and '58' from the events?)
Attachments
vlaga.png
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: TellStick Duo

Post by krambriw »

The event you have there is edited right? You should not do that, you should just drag the event from log first time it happens (and you will then not see the payload on the right side) otherwise you might mess it up and it will not match later and the macro will not start. How does your scripts look inside now?

The way you are preventing repeats are fine but will the current status 'survive' a restart of EG?

As last thing in each macro, you can add a python command with this content:

Code: Select all

eg.document.Save()
srki76
Posts: 9
Joined: Sat Feb 07, 2015 10:14 am

Re: TellStick Duo

Post by srki76 »

Yes, its edited,
because when I just just drag and drop event form left to right, it does not contain values and macroes exexutes itself every time the log is updated (no matter what humidity is). Its just turn ofF and on every 40s.
There is something wrong with the script?
I just C/P in the macors..

Best Regards
P.S.
Tnx for the SAVE XML python script, I will put it at the end of macros.
srki76
Posts: 9
Joined: Sat Feb 07, 2015 10:14 am

Re: TellStick Duo

Post by srki76 »

krambriw wrote: How does your scripts look inside now?]
Here is waht my macroes looks now. I also opened a TSDUO plugin so You can see is if there is everything alright?
I have to disable macros, because they will execute every 30-40s..no matter what humidity is.
Attachments
TSDUOplugin.png
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: TellStick Duo

Post by krambriw »

they will execute every 30-40s..no matter what humidity is
Yes, this will happen since the event is coming every 40 seconds,,,,but that is why the python scripts where added. They where supposed to stop the macro execution if the humidity level was out of the range. Is this not working?
srki76
Posts: 9
Joined: Sat Feb 07, 2015 10:14 am

Re: TellStick Duo

Post by srki76 »

No, its not working/stopping. As I said before, macroes will execute no matter what the humidity level is.. :(
srki76
Posts: 9
Joined: Sat Feb 07, 2015 10:14 am

Re: TellStick Duo

Post by srki76 »

krambriw wrote:
they will execute every 30-40s..no matter what humidity is
And here is ScreenShots of the scripts.
Just to make myself clear, I want to first macro (and upper script) execute the payload when humidity reach 63.
And the last macro (lower script) to execute when humidity reach 56.
Are the scripts OK?
Attachments
Scripts-ON-and-OFF-fans.png
Last edited by srki76 on Sun Feb 08, 2015 2:15 pm, edited 1 time in total.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: TellStick Duo

Post by krambriw »

Okay, then the scripts are not ok, try these ones instead (the ShowOSd lines you can remove when you got everything working)

Code: Select all

def eventHandler(pload):
    hum_level = int(pload)
    if hum_level == 63:
        pass
    else: 
        eg.StopMacro()
        eg.plugins.EventGhost.ShowOSD(u'Stopped macro', u'0;-24;0;0;0;700;0;0;0;1;0;0;2;32;Arial', (255, 255, 255), (0, 0, 0), 0, (0, 0), 0, 3.0, False)

eventHandler(eg.event.payload)

Code: Select all

def eventHandler(pload):
    hum_level = int(pload)
    if hum_level == 58:
        pass
    else: 
        eg.StopMacro()
        eg.plugins.EventGhost.ShowOSD(u'Stopped macro', u'0;-24;0;0;0;700;0;0;0;1;0;0;2;32;Arial', (255, 255, 255), (0, 0, 0), 0, (0, 0), 0, 3.0, False)

eventHandler(eg.event.payload)
srki76
Posts: 9
Joined: Sat Feb 07, 2015 10:14 am

Re: TellStick Duo

Post by srki76 »

krambriw wrote:Okay, then the scripts are not ok, try these ones instead (the ShowOSd lines you can remove when you got everything working)
Works like a charm!!! :D
Thank You very much!
Post Reply