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 »

Don't worry, no such feelings in this community, we all started from scratch at a certain time and there are many skilled users here that have helped out during the years
Fumes
Posts: 24
Joined: Wed Feb 12, 2014 3:46 pm

Re: TellStick Duo

Post by Fumes »

The eg.plugins.TellStickDuo.plugin.dimDeviceData doesn't seem to remove devices from the list if they are removed from the TelldusCenter.
Is that by design or a 'bug'?


/Bjarne
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: TellStick Duo

Post by krambriw »

Where do you mean?

When I test and delete a dim device in Telldus Center, it is no more available in the drop list in the config for the device, without restart of EG.

The configuration as such stays however in EG but you have to select another dim device from the drop down to update the configuration when you delete a device...
Fumes
Posts: 24
Joined: Wed Feb 12, 2014 3:46 pm

Re: TellStick Duo

Post by Fumes »

Hmm...
You're right about the droplist, but my eg.plugins.TellStickDuo.plugin.dimDeviceData still contains the removed devices. Even after i selected a new device in the droplist and then 'dimmed' once with that.

However,If i enumerate a devicelist by opening the library, as in your code example above, the deleted devices are gone. But not when printing eg.plugins.TellStickDuo.plugin.dimDeviceData.

/Bjarne
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: TellStick Duo

Post by krambriw »

Now I got your point...

Yes, the dimDeviceData is a persistent dictionary that just keeps track of latest known dim levels. And yes, it is not synchronized if you delete a device in Telldus Center.

Maybe one solution could be to align the dictionary when the plugin starts and only keep the data for existing devices?

Tell me why and how you need it to be in sync like that?

BR
Fumes
Posts: 24
Joined: Wed Feb 12, 2014 3:46 pm

Re: TellStick Duo

Post by Fumes »

Aha!

It is for keeping track of the l dim levels. When I use your plugin it is mostly togheter with a mediacenter such as XBMC or Mediaportal.
The lights dim up a little bit when we press pause and back to previous levels when continuing the movie and so forth.
The dictionary is used when switching between the different states, stoped - playing - paused and so on.

I guess i have to work out a way to use the enumrated list that could be created on startup of the plugin/EG and then just use the values from the dictionary when needed.

/Bjarne
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: TellStick Duo

Post by krambriw »

Well, it is not so difficult for me to add this to the plugin if it would help (there is nothing else that could break).

So if it helps, I can make so

1) When the plugin starts, it is synchronizing the dimDeviceData with existing devices in Telldus Center (TC)

2) If the device is not existing in TC anymore, the dimDevice data for that device, if any, will be deleted

I think I have also found out how to handle the following situations:

- If you delete or add devices while you have the plugin running, the sync will also happen
- for new devices added while the plugin is running, dimDevice data for those will be captured without restart of the plugin
Fumes
Posts: 24
Joined: Wed Feb 12, 2014 3:46 pm

Re: TellStick Duo

Post by Fumes »

That would be great!

The latter functions with discovery of devices being added/removed while EG is running isn't that important, for me at least, but a nice feature indeed!

/Bjarne
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: TellStick Duo

Post by krambriw »

This version should work the expected way (including the feature that you can delete/add devices from TC as you prefer , also during the plugin run time, no need to restart the plugin)

Please check if you think it works ok

BR
__init__.py
(85.85 KiB) Downloaded 198 times
leothlon
Experienced User
Posts: 59
Joined: Tue Dec 17, 2013 6:29 pm

Re: TellStick Duo

Post by leothlon »

the event: "lights.LampLivingroom1 u"70" "
followed by python command action:
"eg.plugins.TellStickDuo.Dim(4, int(eg.event.payload))"

gives me the error:

Code: Select all

         Error in Action: "eg.plugins.TellStickDuo.Dim(4, int(eg.event.payload))"
         Traceback (most recent call last) (1640):
           File "<string>", line 1, in <module>
           File "C:\Program Files\EventGhost\plugins\TellStickDuo\__init__.py", line 1276, in __call__
             id = self.plugin.getId(deviceName.encode('utf-8'), self.method)
         AttributeError: 'int' object has no attribute 'encode'
anyone know why? or is this the wrong way? i want to dim device to value of payload...
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: TellStick Duo

Post by krambriw »

If you simply create a standard macro with an action to dim and then 'Copy As Python' you would get something like this

Code: Select all

eg.plugins.TellStickDuo.Dim(u'Front row', 50)
So you should use the name of the device, not the id
Fumes
Posts: 24
Joined: Wed Feb 12, 2014 3:46 pm

Re: TellStick Duo

Post by Fumes »

It seems like it works as intended!
We still need to 'use' a new device once, for it to populate the dictionary, right?


/Bjarne
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: TellStick Duo

Post by krambriw »

We still need to 'use' a new device once, for it to populate the dictionary, right?
Yes, correct, just adding a new device does not necessarily set a dim level....
leothlon
Experienced User
Posts: 59
Joined: Tue Dec 17, 2013 6:29 pm

Re: TellStick Duo

Post by leothlon »

krambriw wrote:If you simply create a standard macro with an action to dim and then 'Copy As Python' you would get something like this

Code: Select all

eg.plugins.TellStickDuo.Dim(u'Front row', 50)
So you should use the name of the device, not the id
Awsome, i didn't know about copy as python :O! that made things ALOT easier, not just for using the tellstick but other plugins and making custom scripts!

Many thanks to you good sir
Telorast
Posts: 46
Joined: Wed Feb 27, 2013 2:44 pm

Re: TellStick Duo

Post by Telorast »

Anyone else have problems with the new Telldus Center 2.1.2? My Tellstick stops working after resuming from Sleep. It doesn't seem to be a problem with the plugin since not even TelldusCenter works.
Post Reply