Page 1 of 1

Tellstick DUO & WINDOOR or MOTION sensor/detector

Posted: Fri Mar 17, 2023 9:45 am
by nt21k
Hi all,

I would like to know how I can catch a message or event or a value when the door is opened (windoor sensor) or a person passes in front of motion sensor with the telldus core API ? Because when I looked at telldus-core, only temperature or humidity are supported as sensors at this moment.

Thanks for your helps.

Regards,

NT

Re: Tellstick DUO & WINDOOR or MOTION sensor/detector

Posted: Fri Mar 17, 2023 9:45 am
by micke.prag
Yes, it is possible. Read more under "Events": http://developer.telldus.com/doxygen/

Re: Tellstick DUO & WINDOOR or MOTION sensor/detector

Posted: Fri Mar 17, 2023 9:45 am
by nt21k
Thanks for your reply. You mean that to catch a message sent by windoor/motion sensor, I need register the device with tdRegisterSensorEvent() ? I only saw that the API supports only 2 datatype for sensor TEMPERATURE and HUMIDITY.

Does tellstick transmitter classic support this ?

Thanks for your helps.

Re: Tellstick DUO & WINDOOR or MOTION sensor/detector

Posted: Fri Mar 17, 2023 9:45 am
by micke.prag
No, you must first define a device for your motion sensor and then listen for changes using tdRegisterDeviceEvent().

Re: Tellstick DUO & WINDOOR or MOTION sensor/detector

Posted: Fri Mar 17, 2023 9:45 am
by nt21k
How I can define my sensor ? Because, normally, a sensor can not be learned.

Re: Tellstick DUO & WINDOOR or MOTION sensor/detector

Posted: Fri Mar 17, 2023 9:45 am
by micke.prag
What kind of motion detector do you have? Without that information it is really hard to guess how you should configure it!

Re: Tellstick DUO & WINDOOR or MOTION sensor/detector

Posted: Fri Mar 17, 2023 9:45 am
by nt21k
DOOR detector

Re: Tellstick DUO & WINDOOR or MOTION sensor/detector

Posted: Fri Mar 17, 2023 9:45 am
by micke.prag
Brand? Please provide a link to the one you have.

Tellstick DUO & WINDOOR or MOTION sensor/detector

Posted: Fri Mar 17, 2023 9:45 am
by marbo
I have Duo and Nexa lmst-606. I can receive data to TelldusCenter when i open Nexa. So thats workig but if i open Nexa how i can send email, start lights etc?

So i need to do some scripts witch collect that openin or closing data and do then what i want.

Is this solution? http://developer.telldus.se/blog/2012/1 ... om-signals

If yes then please help me little.

Re: Tellstick DUO & WINDOOR or MOTION sensor/detector

Posted: Fri Mar 17, 2023 9:45 am
by marbo
Ok, no help so i do little python script which use pytelldus.
My script needs from pytelldus both tdtool.py and td.py.

Code: Select all

#!/usr/bin/env python

import td
import time
import os


def myDeviceEvent(deviceId, method, data, callbackId):
    content = '%s' %( td.getName(deviceId) )+' - %s' %(td.methodsReadable.get(method, 'Unknown' ))	
    if 'Door - ON' in content:  			                               #### When device named Door is open
		os.system('python tdtool.py --on "Livingroom 1"')        #### it run script which open Livingroom 1 lights. 
						     
td.registerDeviceEvent(myDeviceEvent)

try:
	while(1):
		time.sleep(1)			
except KeyboardInterrupt:
            print 'KeyboardInterrupt received, exiting'
            os.system('rm *.pyc')
I named this script SignalReceiver.py and then i run it on Terminal 'python SignalReceiver.py'. This must run all the time to check signals.

Re: Tellstick DUO & WINDOOR or MOTION sensor/detector

Posted: Fri Mar 17, 2023 9:45 am
by nebuchad
Hi.
Tried the above script (with some minor adjustment, livingrom 1 to one existing in my system) but I really cannot get it to work. I have the SignalReceiver.py in the same folder as td.py and tdtool.py and all are chmoded with +x.
My magnet sensor is configged as brytare2 and this is my output if i run tdtool.py --event and triggers the magnet.

Code: Select all

1383082044: RawDeviceEvent: class:command;protocol:arctech;model:selflearning;house:3712562;unit:10;group:0;method:turnon;
  controllerId: -1
1383082044: RawDeviceEvent: class:command;protocol:arctech;model:selflearning;house:3712562;unit:10;group:0;method:turnon;
  controllerId: -1
1383082044: DeviceEvent Device: 13 - 2brytare
  method: 1 - ON, data: 
But if i run SignalReceiver.py and triggers the magnet nothing happens.

Can this have something to do with that it is a RawDeviceEvent and not a registerDeviceEvent?
If so, how would the script need adjustment?

BR
Nebuchad