Python wrapper of libtelldus

Moderator: Telldus

Re: Python wrapper of libtelldus

Postby UglyBob » Mon Aug 13, 2012 2:20 pm

Ah ok, I see. But I can't get anything out from tdtool.py anyway. Either with -t or with --event. It's just quiet. And my Tellstick Duo is flashing whenever I trigger the motion sensor. Am I missing some library that your script needs? Are there any way to get out debug when running it?
UglyBob
 
Posts: 15
Joined: Wed Aug 25, 2010 1:43 pm

Re: Python wrapper of libtelldus

Postby UglyBob » Mon Aug 13, 2012 2:26 pm

Ah, I found out my problem now. I made the script executable, but there is no "#!/usr/bin/python" in the beginning of the script. Now it seem to work! :) Thanks for your help!
UglyBob
 
Posts: 15
Joined: Wed Aug 25, 2010 1:43 pm

Re: Python wrapper of libtelldus

Postby UglyBob » Mon Aug 13, 2012 2:54 pm

Still can't get it quite right though. I get events like this:
Code: Select all
1344869498: RawDeviceEvent: class:command;protocol:arctech;model:selflearning;house:8043318;unit:10;group:0;method:turnon;
  controllerId: -1


So I modified my /etc/tellstick.conf and added the last device like this:
Code: Select all
user = "nobody"
group = "plugdev"
ignoreControllerConfirmation = "false"
device {
  id = 1
  name = "Nexa 1 ON/OFF"
  protocol = "Arctech"
  model = "selflearning-switch:nexa"
  parameters {
    house = "16277963"
    unit = "1"
  }
}
device {
  id = 2
  name = "Nexa 2 ON/OFF"
  protocol = "Arctech"
  model = "selflearning-switch:nexa"
  parameters {
    house = "16277963"
    unit = "2"
  }
}
device {
  id = 3
  name = "Nexa 3 Dimmer"
  protocol = "Arctech"
  model = "selflearning-dimmer:nexa"

  parameters {
    house = "16277963"
    unit = "3"
  }
}
device {
  id = 4
  name = "Nexa Motion"
  protocol = "Arctech"
  model = "selflearning"
  parameters {
    house = "8043318"
    unit = "10"
  }
}


If i try tdtool --list I will see:
1 Nexa 1 ON/OFF OFF
2 Nexa 2 ON/OFF OFF
3 Nexa 3 Dimmer OFF
4 Nexa Motion OFF

If I run tdtool.py --list I will see:
1 UNKNOWN UNKNOWN
2 Nexa 1 ON/OFF OFF
3 Nexa 2 ON/OFF OFF
4 Nexa 3 Dimmer OFF

And I'm guessing that if configured right, I would see events (not raw) when running it with the --event option, right? I still get raw events though... Any clue what I am doing wrong?
UglyBob
 
Posts: 15
Joined: Wed Aug 25, 2010 1:43 pm

Re: Python wrapper of libtelldus

Postby MartinV » Mon Aug 13, 2012 3:12 pm

By just looking at it, it looks like there is a problem with the indexes...

Arrays start with zero indexes, but you are off by "1".

I guess that the wrapper calls the devices by their index in an array rather than the id set in the configuration file.
Martin | http://www.switchking.se
Testa Switch King Pro i din Android/iPhone/iPod: http://www.switchking.se/sv/demo
MartinV
 
Posts: 276
Joined: Sun Jan 25, 2009 10:41 pm

Re: Python wrapper of libtelldus

Postby UglyBob » Mon Aug 13, 2012 5:03 pm

Ah, that's true! I will try to renumber them in my config and see if it helps.
UglyBob
 
Posts: 15
Joined: Wed Aug 25, 2010 1:43 pm

Re: Python wrapper of libtelldus

Postby UglyBob » Mon Aug 13, 2012 5:06 pm

Now it looks better in the list, but still raw events, don't know if that's the way it suppose to be or not.
UglyBob
 
Posts: 15
Joined: Wed Aug 25, 2010 1:43 pm

Re: Python wrapper of libtelldus

Postby davka003 » Mon Aug 13, 2012 6:35 pm

Hi
I still might have bugs in the device-id/list printout but I made some fixes to problem in the following commit:

92270b1c9fd5 Fixing some deviceid-related bugs and adding the rawdeviceevent 2012-07-13

Could it be that you downloaded your copy of tdtool.py before 13:th of July?
If new version doesnt fix your problem could you please send me your complete tellstick.conf for tracing the problem?
My home automation software: Automagically @ Raspberry Pi http://automagically.weebly.com
davka003
 
Posts: 126
Joined: Sat Oct 29, 2011 8:56 am
Location: Sweden

Re: Python wrapper of libtelldus

Postby evertsson » Thu Aug 23, 2012 7:38 am

davka003 wrote:I think there is a clarification needed.

Sensors in the tellstick world are not Nexa motion detectors or light sensor. It is only temperature and humidity that is sensors. All others are deviceevent or rawdeviceevent.
If you see the duo flashes you should see a rawDeviceEvent (or many) if you run python tdtool.py --event

To make it device event you need to create a device entry in /etc/tellstick.conf matching the protocol/house/unit code reported in the rawdeviceevent.


Can you clarify this a bit more?

If I run your image, do I need something else to use a DUO and find a motion detector?
How do I find the house/unit code used by the motion detector so I can add such a device in the admin gui.

/Daniel
evertsson
 
Posts: 8
Joined: Tue Dec 06, 2011 6:43 pm

Re: Python wrapper of libtelldus

Postby davka003 » Thu Aug 23, 2012 9:50 am

If you run the latest version of my image and have run the update.sh script you have the possibility to turn on signal debug to file in the settings values area o the admin interface. When to file is activated you can view signals on the URL /signals/dump/ there you will see printouts similar tho those from tdtool.py.

I want to create a better interface for this but there are so many things I want to do.
My home automation software: Automagically @ Raspberry Pi http://automagically.weebly.com
davka003
 
Posts: 126
Joined: Sat Oct 29, 2011 8:56 am
Location: Sweden

Re: Python wrapper of libtelldus

Postby evertsson » Thu Aug 23, 2012 1:43 pm

davka003 wrote:If you run the latest version of my image and have run the update.sh script you have the possibility to turn on signal debug to file in the settings values area o the admin interface. When to file is activated you can view signals on the URL /signals/dump/ there you will see printouts similar tho those from tdtool.py.

I want to create a better interface for this but there are so many things I want to do.



I installed and updated it yesterday but I cant find any option to turn on debug to file in the admin interface.
evertsson
 
Posts: 8
Joined: Tue Dec 06, 2011 6:43 pm

Re: Python wrapper of libtelldus

Postby davka003 » Thu Aug 23, 2012 2:06 pm

Use the following URL to get to the settings interface: /admin/settings/settingsvalue/
You should change signaldebug - Debug to file and set it to true. (and press save)

Hopefully that works for you. I don't have access before Saturday to verify the latest image actually have it available. If not I will commit changes so that it do during the weekend.

Please let me know if you have any other problems.
My home automation software: Automagically @ Raspberry Pi http://automagically.weebly.com
davka003
 
Posts: 126
Joined: Sat Oct 29, 2011 8:56 am
Location: Sweden

Python wrapper of libtelldus

Postby evertsson » Thu Aug 23, 2012 3:16 pm

davka003 wrote:Use the following URL to get to the settings interface: /admin/settings/settingsvalue/
You should change signaldebug - Debug to file and set it to true. (and press save)

Hopefully that works for you. I don't have access before Saturday to verify the latest image actually have it available. If not I will commit changes so that it do during the weekend.

Please let me know if you have any other problems.


When I turn that option on and go to ip/signals/dump/ I get "http error 500". If I remove last / I get a page saying "signal sent: dump".

What do I do wrong? I want to find my motion detector...
evertsson
 
Posts: 8
Joined: Tue Dec 06, 2011 6:43 pm

Re: Python wrapper of libtelldus

Postby davka003 » Thu Aug 23, 2012 4:54 pm

That functionality was put together some days ago for helping a guy working on usbuirt support in the system. It is not exposed with links in the system because it is not done and quality assured :-)

I don't have access to the source right now but trying to debug in my head. Perhaps the URL works after at least one signal has been recieved by the system otherwise the functionality is not better than it is - sorry!
My home automation software: Automagically @ Raspberry Pi http://automagically.weebly.com
davka003
 
Posts: 126
Joined: Sat Oct 29, 2011 8:56 am
Location: Sweden

Re: Python wrapper of libtelldus

Postby UglyBob » Thu Aug 23, 2012 6:02 pm

No one that has written a config for a Nexa motion detector? I really can't get it to work. Get raw events whatever I do...
UglyBob
 
Posts: 15
Joined: Wed Aug 25, 2010 1:43 pm

Python wrapper of libtelldus

Postby evertsson » Fri Aug 24, 2012 2:47 pm

I used pytelldus to find house and unit codes.

Now when I have a raw device with motion sensor and one with a light.

How do I turn on the light with the motion sensor?
evertsson
 
Posts: 8
Joined: Tue Dec 06, 2011 6:43 pm

PreviousNext

Return to Linux

Who is online

Users browsing this forum: No registered users and 3 guests

cron