Python wrapper of libtelldus

Moderator: Telldus

UglyBob
Posts: 15
Joined: Fri Mar 17, 2023 9:45 am

Re: Python wrapper of libtelldus

Post by UglyBob »

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: Fri Mar 17, 2023 9:45 am

Re: Python wrapper of libtelldus

Post by UglyBob »

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: Fri Mar 17, 2023 9:45 am

Re: Python wrapper of libtelldus

Post by UglyBob »

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?
MartinV
Posts: 277
Joined: Fri Mar 17, 2023 9:45 am
Contact:

Re: Python wrapper of libtelldus

Post by MartinV »

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
UglyBob
Posts: 15
Joined: Fri Mar 17, 2023 9:45 am

Re: Python wrapper of libtelldus

Post by UglyBob »

Ah, that's true! I will try to renumber them in my config and see if it helps.
UglyBob
Posts: 15
Joined: Fri Mar 17, 2023 9:45 am

Re: Python wrapper of libtelldus

Post by UglyBob »

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.
davka003
Posts: 187
Joined: Fri Mar 17, 2023 9:45 am
Location: Sweden
Contact:

Re: Python wrapper of libtelldus

Post by davka003 »

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
evertsson
Posts: 8
Joined: Fri Mar 17, 2023 9:45 am

Re: Python wrapper of libtelldus

Post by evertsson »

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
davka003
Posts: 187
Joined: Fri Mar 17, 2023 9:45 am
Location: Sweden
Contact:

Re: Python wrapper of libtelldus

Post by davka003 »

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
evertsson
Posts: 8
Joined: Fri Mar 17, 2023 9:45 am

Re: Python wrapper of libtelldus

Post by evertsson »

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.
davka003
Posts: 187
Joined: Fri Mar 17, 2023 9:45 am
Location: Sweden
Contact:

Re: Python wrapper of libtelldus

Post by davka003 »

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
evertsson
Posts: 8
Joined: Fri Mar 17, 2023 9:45 am

Python wrapper of libtelldus

Post by evertsson »

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...
davka003
Posts: 187
Joined: Fri Mar 17, 2023 9:45 am
Location: Sweden
Contact:

Re: Python wrapper of libtelldus

Post by davka003 »

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
UglyBob
Posts: 15
Joined: Fri Mar 17, 2023 9:45 am

Re: Python wrapper of libtelldus

Post by UglyBob »

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...
evertsson
Posts: 8
Joined: Fri Mar 17, 2023 9:45 am

Python wrapper of libtelldus

Post by evertsson »

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?
Post Reply