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.
User1306
Experienced User
Posts: 53
Joined: Sat Oct 13, 2012 4:37 pm

Re: Plugin: TellStick Duo

Post by User1306 »

first thanks for the quick feedback.
Not displaying the message (restart Eg...) helped a lot, in that Eg does back to functioning and i can Trigger a restart of EG. However; EG hangs until the 30 seconds are over then triggers all the events that came in during the 30 seconds.


here's the log after a new star of EG and a system sleep

Code: Select all

11:43:09   System.Suspend
11:43:09   Suspending... None
11:43:09   Closing library
11:43:09   Disables TellStick Duo...
11:43:31   Resuming... None
11:43:31   Please wait 30 seconds, drivers and services are recovering...
11:44:01   Loading library
11:44:01   Restart of EG needed
11:44:01   Initiating TellStick Duo...
11:44:01   Starting TellStick Duo...
If i don't restart EG and system goes into another sleep again, there's a different error

Code: Select all

11:44:36   System.Suspend
11:44:36   Suspending... None
11:44:36   Traceback (most recent call last) (1600):
11:44:36     File "C:\Program Files\EventGhost\eg\Classes\ActionThread.py", line 101, in OnComputerSuspend
11:44:36       plugin.OnComputerSuspend(None)
11:44:36     File "C:\Program Files\EventGhost\plugins\TellStickDuo\__init__.py", line 344, in OnComputerSuspend
11:44:36       self.__stop__()
11:44:36     File "C:\Program Files\EventGhost\plugins\TellStickDuo\__init__.py", line 328, in __stop__
11:44:36       self.unregisterCallbacks()
11:44:36     File "C:\Program Files\EventGhost\plugins\TellStickDuo\__init__.py", line 501, in unregisterCallbacks
11:44:36       self.dll.tdUnregisterCallback( self.callbackId_0 )
11:44:36   WindowsError: exception: access violation reading 0x000000A4
11:44:46   Resuming... None
11:44:46   Please wait 30 seconds, drivers and services are recovering...
11:45:18   Loading library
11:45:18   Restart of EG needed
11:45:18   Initiating TellStick Duo...
11:45:18   Starting TellStick Duo...
Even if i don't do a restart of EG when asked, TellStickDuo still functions fine and all lights work after system resume.

if it's too complicated to pin down the error, no worries i think the solution of not displaying the "Restart message" works fine and i can trigger an auto restart of EG after it resumes using "system.Resume". but would it be possible to cut the 30 second to 10 or 5.

thanks again for the support

Update: Tellstick does not receive events until you restart but it can send.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Plugin: TellStick Duo

Post by krambriw »

would it be possible to cut the 30 second to 10 or 5
Sure, we could set it as default to 5. You may in the meantime change yourself in the code, it is very simple.
Look for line 354 in the py file, change it, save it as belwo and restart EG (the time.sleep(5.0)

Code: Select all

    def OnComputerResume(self, suspendType):
        """
        Prepares the plugin for resumption of the computer.
        """
        print "Resuming...", suspendType
        print "Please wait 5 seconds, drivers and services are recovering..."
        time.sleep(5.0)
        self.__start__(
            self.bDeviceEvents,
            self.bChangeEvents,
            self.bRawEvents,
            self.beepOnEvent,
            self.bDebug,
            self.delayRepeat,
            self.bSensorEvents
        )
Tellstick does not receive events until you restart but it can send
Yes, this is the main problem, we are not able to re-subscribe to event callbacks, this is a problem of the Telldus Service and I cannot do much else, just wait for Telldus to release a newer better version. Eventually you might still have an older dll version somewhere on your system because in my system, I can re-subscribe from EG as many times as I like without problems.

Could do another test: without stopping EG, just try to disable/enable the TellStickDuo plugin and see how many times you can do that without getting problems? When I do this, events are always coming after I have enabled the plugin.

Best regards, Walter
User1306
Experienced User
Posts: 53
Joined: Sat Oct 13, 2012 4:37 pm

Re: Plugin: TellStick Duo

Post by User1306 »

Thanks, 5 seconds is better, i can now just trigger a restart of EG after.

i dont have any older dll since i switch to Duo just recently. i'll just wait until Telldus fix this issue.

about how many time i can disable/enable TellStick Duo before i get the error, is only once. as soon as i enable it i get the restart message in the log.

thanks for the support
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Plugin: TellStick Duo

Post by krambriw »

is only once
Yes, thank you, this is the problem!!!. This works in all 3 of my test systems as many times as I like, strange. Why this is hard to tell, I have currently no more ideas. As you say, lets see what Telldus will do about it.

And you are sure the driver you have for the TellStickDuo is version 2.8.14.0 dated 2011-03-18?

Be aware that if you happen to change the usb port for it, it will re-install the driver and if it finds more than one, it might be that you get and old one instead...

Best regards, Walter
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Plugin: TellStick Duo

Post by krambriw »

@User1306,

Check out this demo (in Swedish), this is how you should be able to disable/enable the plugin without problem. If you can't, there is another problem you have, double check drivers, change to a usb-port for better power supply etc but I believe there is nothing wrong with the plugin.

BestR

http://youtu.be/kqiUpifGkxQ
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Plugin: TellStick Duo

Post by krambriw »

Latest version now uploaded and published in first post
Scope
Posts: 28
Joined: Tue Feb 22, 2011 5:19 pm

Re: Plugin: TellStick Duo

Post by Scope »

Hello again Walter!

I am back again for a new feature request :P
Since you now store the previous value of a device, maybe you can add a ToggleDevice-function?
That would make it possible to toggle a light with a single button on a remote control.
What do you think?

Kind regards,
Torbj├Ârn Westerlund.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Plugin: TellStick Duo

Post by krambriw »

Hello,
It's a good idea, attached (removed, new version in progress) is a test version with a new action that allows that (toggling on/off).

Add a new macro and select the device you like to toggle. You can try to run it first a couple of times and it should work as expected.

Next is to add a trigger to the macro. Eventually an 'on' button on a remote. Then first create a new device for this button in Telldus center (even if it would be possible to use a raw event, try to avoid this because you will get the log filled up with this if you activate logging of raw events).

Click the 'on' and 'off' button until you get the event in the log, then drag it to the macro. From now on, it should work that every time you press the 'on' button, the device will toggle it's state.
Image2.png
Image2.png (3.19 KiB) Viewed 9647 times
Last edited by krambriw on Mon Jan 14, 2013 2:55 pm, edited 2 times in total.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Plugin: TellStick Duo

Post by krambriw »

I just tested a bit more myself and found that it was not failsafe...working on a new test version...

And here it is
__init__.py
(54.25 KiB) Downloaded 362 times
Redrum
Posts: 2
Joined: Mon Jan 02, 2012 5:11 pm

Re: Plugin: TellStick Duo

Post by Redrum »

Hi there, I have a small problem with the "new" feature that stores the previous value and only trigger an event if the value is different.
The magnetic door switch (LMST-606) sends the open / close signal using different ID:s
So I entered two items in the TelldusCenter, one for the ÔÇ£onÔÇØ and another one for the ÔÇ£offÔÇØ signal, and here is the problem this device never change value and there fore only triggers once.

So my question is would it be possible to specify an exclusion list like the sensors_supported.py list.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Plugin: TellStick Duo

Post by krambriw »

This is such a special case and is actually due to a bad designed device, the seller should take it back and your payment should be refunded. But I guess this will not help you very much so with the power of EventGhost available, we will make a little trick!

Instead of updating the plugin, I offer you a solution that I believe will solve your problem just like that.

Create a new macro for a pythonscript like the one in the picture below.

- edit the python script and paste the content from the sample below
- add / drag the device events from your magnet contacts to the macro

Please note: Do only use device events, do not raw events

Every time the event happens from now, they can be repeated, their states will not be remebered

BestR

Image2.png
Image2.png (4.7 KiB) Viewed 9557 times

Code: Select all

m = str(eg.event.payload)
n = str(eg.event.suffix)
p = n.split('.')[0]+'|'+m.split('.')[1]
eg.Wait(0.1)
try:
    del eg.plugins.TellStickDuo.plugin.device_state_memory[p]
except:
    pass
Redrum
Posts: 2
Joined: Mon Jan 02, 2012 5:11 pm

Re: Plugin: TellStick Duo

Post by Redrum »

Thank you!
That little trick will absolutely work implementing it right away, the manufacturer is Nexa so there might be others having the same problem.
And since Im un patient i modified you plug in last night, I took the value from the beep on event check box for enable / disable the whole function, not so effective as yours.

Code: Select all

if self.beepOnEvent:
    tr_e = True
else:
    try:
        if msg != self.device_state_memory[m_key]:
            self.device_state_memory[m_key] = msg
            tr_e = True
    except KeyError:
        if self.bDebug:
            print self.text.keyAdded
        self.device_state_memory[m_key] = msg
        tr_e = True
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 made an experimental version that now supports gradually dimming...

Attached below, the first version that is supporting gradual dimming (of AC compatible dimming devices with set level support).

The function is like follows:

You select to create a macro and add the new action 'Dim gradually'. Then you will see the following configuration dialog:
Image2.png
Image2.png (6.88 KiB) Viewed 9478 times
If you set a dim level and run the macro, the dimming will happen in the required steps from the current dim level the device is set to. The step size (1-34) as well as the time between the dim commands will be as specified (0.10 -600.00 seconds). For a fast operation speed, I use 0.20.

If you prefer a longer operation you can of course set a longer time period.

Once it has executed, it will remember the latest setting (also after a restart of EG or the computer) so you can actually restore the state very easily. Currently I am not tracking if you are setting the device with a remote, I am assuming that that the actions 'owns' the device and will overrule any other change.

As example, assume the current dim level is set to 5% and you would like to dim up to level 40%. The dimming will then start with sending a command 'dim' 5% and then in steps (with the defined step size and specified time in between commands) until it reaches 40%. If you now would like to dim down, the sequence will be in the opposite direction.

Best regards, looking forward to your feedback
Walter
__init__.py
(62.08 KiB) Downloaded 343 times
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: TellStick Duo

Post by krambriw »

Released version updated in first post
Telorast
Posts: 46
Joined: Wed Feb 27, 2013 2:44 pm

Re: TellStick Duo

Post by Telorast »

I have a problem with the state memory. I use the remotes to control my computer, for example I use one channel to control the volume. Problem is that if I lower the volume once then the state is set to off and I can't lower the volume again.

I tried using your script when a command is received but it isn't working.
krambriw wrote:

Code: Select all

m = str(eg.event.payload)
n = str(eg.event.suffix)
p = n.split('.')[0]+'|'+m.split('.')[1]
eg.Wait(0.1)
try:
    del eg.plugins.TellStickDuo.plugin.device_state_memory[p]
except:
    pass
Is there any way to turn the state memory off or how do I make sure all events are seen?

My setup looks like this:
Image
Pressing once either turns the TV on or off depending on the previous state or play/pause the music. Holding a button either increase or lower the volume. This worked great before the state memory was introduced, how do I make it work now?
Post Reply