Ticket #114 (new enhancement)

Opened 8 years ago

Last modified 10 months ago

Use a TellStick Net from TelldusCenter

Reported by: micke prag <micke.prag@…> Owned by: micke prag <micke.prag@…>
Priority: critical Milestone: Some future release / Patches welcome
Component: telldus-core Version: 2.1.0
Keywords: Cc:
Blocked By: #108 Blocking:
Platform: All Sensitive: no
Verified by Telldus: no

Description

If TellStick Net has an interface for local control, without Telldus Live! it will be possible to use the device as a TellStick Duo.

Attachments

tdtool-with-sensors.py Download (9.3 KB) - added by tatu wikman <tatu.wikman@…> 7 years ago.
tdtool with sensors options. Adds --list-sensors and --sensor-data
TellStickNet.hex Download (98.7 KB) - added by claes nordmark <nordmarkclaes@…> 4 years ago.
Hex file for supporting local access via telldusd
d40bd6a41276ebb3795cb50422975481.jpg Download (67.3 KB) - added by bob foster <smartmil888@…> 4 years ago.
 http://smartmiltoys.com/kidkraft-dollhouse/

Change History

comment:1 Changed 8 years ago by stefan persson <stefan.persson@…>

Supported use via telldus-core, and documentation for own user solutions from devices without telldus-core, for example from phones and pads.

comment:2 Changed 8 years ago by micke prag <micke.prag@…>

  • Verified by Telldus unset
  • Milestone set to Some future release

comment:3 follow-up: ↓ 28 Changed 8 years ago by micke prag <micke.prag@…>

How should this interface be designed?
TCP or UDP?
How could a typical session be?

comment:4 Changed 8 years ago by tomas eriksson <tomas@…>

I would like to see a TCP protocol!

comment:5 Changed 8 years ago by micke prag <micke.prag@…>

Please motivate why a TCP protocol is to prefer over UDP.

comment:6 Changed 8 years ago by tomas eriksson <tomas@…>

Easer to develop against, nice to have "guaranteed delivery" in the protocol.

comment:7 Changed 8 years ago by micke prag <micke.prag@…>

I must say it is the contrary. UDP is much much simpler and much more light-weight.
For implementing in other embedded products UDP will also save a lot of code space.

Receipts of packages is quite simple to implement.

comment:8 Changed 8 years ago by markus ferlitsch <m.ferlitsch@…>

Oh now I can answer. :-)

I also would prefer the UDP protocol.

A small JavaScript HTML site shows you your receiver and it generates the right codes for that receivers you want to switch on or off. I think this would be the easiest way.

Moreover, a small webif would be fine where it should be possible also to generate several codes but without graphical support.

comment:9 Changed 8 years ago by micke prag <micke.prag@…>

Having all the protocols in TellStick Net will unfortunately not be possible. They need to be generated elsewhere and sent to the device similar to the TellStick protocol. Please see here: http://developer.telldus.com/doxygen/TellStick.html

comment:10 Changed 8 years ago by runar lie <runar.lie@…>

I think I could live with both a UDP or a TCP connection. Perhaps it should simply be raw, and we can offload the protocols to the client instead. If we could both send and recieve bitstreams, it would be easier to implement new devices as well.

Receving raw events would also make it easier to make smart actions based on remotes. IE. click once to turn on one set of lights and click twice to turn them all off..

comment:11 Changed 8 years ago by markus ferlitsch <m.ferlitsch@…>

I also think that the protocol is not so important.

I want to run a server which gets input from some IR wireless sensors (Intertechno PIR-5000). So the Telldus Net must receive signals. Then when the server recognizes that noone is inside the house the simulation that people are inside begins (sending different signals via Telldus Net adpater). If the server recognizes that people are inside the simulation will be interrupted.

I want to realize it on my OpenWrt based router.

Also I think the Telldus Net adapter must be able to receive commands in a simple way

Whats about receiving commands via HTTP-Request with GET or POST parameter?

How does it work now? Some people bought the adapter yet.
How does it now work?

Is the Telldus Net adapter permanently logged in to the live portal (does it also work via http or socks proxy)?

UDP can't be tunneled with SocksCap via SOCKS proxy.
TCP prototol can be tunneled!

comment:12 follow-up: ↓ 13 Changed 8 years ago by micke prag <micke.prag@…>

  • Blocked By 108 added

comment:13 in reply to: ↑ 12 Changed 8 years ago by stephane dierick <sdierick@…>

I would suggest to develop a specific driver that could:

  • From one side, emulate a viruel USB/COM port so it could be used by the several existing home automation softwares (homeseer,...)
  • At the other side, convert the instruction sent to virtual COM port into TCP requests for the Telldus Net. That could be implemented in SOAP or RAW TCP or UDP depending what the telldusnet device is supporting easyly.

What do you think about this idea?
By this way, the telldusnet can be used exactly as a telldus duo or stick.

PS: is it possible to get the sources or technical specification of telldus net? Is it possible to contribute?

comment:14 follow-up: ↓ 15 Changed 8 years ago by micke prag <micke.prag@…>

stephane: I think you have great ideas.

"By this way, the telldusnet can be used exactly as a telldus duo or stick."
This is exactly the plan. We will support TellStick Net using our current API telldus-core. In this way all exisiting thirdpart applications will be able to send through TellStick Net.

"is it possible to get the sources or technical specification of telldus net? Is it possible to contribute?"
Yes, we are currently making a draft of the communication. The source will be able when this ticket is finished: #156

One thing we really need help with is how to emulate a virtual com-port. Any code/help there will be very much appreciated.

comment:15 in reply to: ↑ 14 Changed 8 years ago by stephane dierick <sdierick@…>

Replying to micke prag <micke.prag@…>:

stephane: I think you have great ideas.

Thanks :)

One thing we really need help with is how to emulate a virtual com-port. Any code/help there will be very much appreciated.

Check that GPL project:
 http://com0com.sourceforge.net/doc/UsingCom0com.pdf

Part of this master project based on virtual com port pairing:
 http://sourceforge.net/projects/com0com/

Problems:

  • Windows based software
  • Need to be adapted because we don't want to connect like This

PC.A--virtualCOM------tcp------virtualCOM--PC.B

but

PC.A--virtualCOM------tcp (or UDP??)------TelldusNet

  • TCP Only?

Anyway, even with this kind of interface, I think that providing also a SOAP based interface directly on the telldusNet could be usefull.
For exemple, third party Internet based application could interract with the tellsud in SOAP (or REST).
Can the TelldusNet Handle mini HTTP server? How is the communication implemented with telldus Live ?

I'll be pleased to help the project, Home automation has an growing development and I like the open way you're contributing to it in Telldus!

Regards

comment:16 follow-up: ↓ 17 Changed 8 years ago by micke prag <micke.prag@…>

I created another ticket (#185) for the COM-port idea to keep this ticket more focused. Hope you don't mind.

comment:17 in reply to: ↑ 16 Changed 8 years ago by stephane dierick <sdierick@…>

Replying to micke prag <micke.prag@…>:

I created another ticket (#185) for the COM-port idea to keep this ticket more focused. Hope you don't mind.

no pb of course ;)

comment:18 follow-up: ↓ 20 Changed 8 years ago by micke prag <micke.prag@…>

First draft of TellStick Net protocol available here: http://developer.telldus.com/doxygen/TellStickNet.html

comment:19 Changed 8 years ago by markus ferlitsch <m.ferlitsch@…>

A Mini HTTP Server on Telldus Net would be the best solution (I wrote it in one of my posts).
The tunneling over a proxy (http, socks) or tunneling via virtual COM-port is easy ( http://www.eltima.com).

The Mini HTTP-server also would allow to make some PHP or Python applications --> "remote control" of the Telldus net.

comment:20 in reply to: ↑ 18 Changed 8 years ago by stephane dierick <sdierick@…>

Replying to micke prag <micke.prag@…>:

First draft of TellStick Net protocol available here: http://developer.telldus.com/doxygen/TellStickNet.html

Hi Mike,

I'm not sure to understand this first draft.

  • is it a specification of what should be developped in the future
  • is it the way the tellstick net works now?

I tried to push UDP packets in python to my tellstick IP adresse but nothing happends (I tried the two exemples you mentionned in the tuto)...

Moreover, trying to sniff the network traffic on my Linksys router (via TCPDUMP) didn't give me any chance to see a packet to or from the IP of the tellstick! Strange...

I think I have to stop the workaround for the moment :(

comment:21 Changed 8 years ago by micke prag <micke.prag@…>

This is a discussion about an upcoming feature. If this was already in the released firmware this ticket should have been closed.
We are currently in the state of finding out how this can be implemented. Nothing ready yet for testing.

comment:22 Changed 8 years ago by micke prag <micke.prag@…>

Btw, the auto discovery feature is already working since firmware version 2.

comment:23 follow-up: ↓ 25 Changed 8 years ago by markus ferlitsch <m.ferlitsch@…>

But now the Telldus Net adapter is nowehere in Europe in stock or can be bought. :-(

Can the Telldus Net be used as Telldus Duo or Telldus Stick NOW?

comment:24 Changed 8 years ago by markus ferlitsch <m.ferlitsch@…>

Auto Discovery is already documented here:

http://developer.telldus.com/doxygen/TellStickNet.html

comment:25 in reply to: ↑ 23 Changed 8 years ago by micke prag <micke.prag@…>

Replying to markus ferlitsch <m.ferlitsch@…>:

Can the Telldus Net be used as Telldus Duo or Telldus Stick NOW?

No, that is what this ticket is all about!

comment:26 Changed 8 years ago by micke prag <micke.prag@…>

We have now released the source for the TellStick Net used for local access. Read more here 2012/03/02/help-us-develop-local-access-using-tellstick-net-build-your-own-firmware.

comment:27 Changed 7 years ago by micke prag <micke.prag@…>

This ticket has been referenced in ticket #224:

Please see #114

comment:28 in reply to: ↑ 3 Changed 7 years ago by anders engblom <anders@…>

I would say that this is not the best way to go about it.

Instead I propose that you should allow users to setup a "local cloud". The users can then configure their Tellstick Net boxes to connect to a local server and use the existing Net api.
You could even allow for the local cloud to synchronize to your servers allowing for both extra- and intranet access.

This would give users privacy and speed from local access and accessibility and ease of setup from using live.telldus.com

comment:29 Changed 7 years ago by richard trouve <richard.trouve@…>

In local way, does this mean that tellstick-net is accessible by telldus-center ?

comment:30 Changed 7 years ago by manne björkhagen <manne@…>

Any news on this one? Is it moving forward or is in a halted mode?

comment:31 Changed 7 years ago by tatu wikman <tatu.wikman@…>

Also interested in this, any update on the status?

comment:32 follow-up: ↓ 33 Changed 7 years ago by odd arne roll <jobbemann@…>

Im trying to find a way to trigger my switches from a temperature sensor. Does not look like there is any work done on making this work via tellstick live.. =(
I realy should have read through the web-page better before i bought all the sensors and switches for controlling temperature in my house.

Do anyone have a tip for me on how to get my tellstick net work as a thermostat as i planed? Im willing to tinker a bit, and compile some simple stuff, but im no programmer. Aslo a solution would be if i could use a laptop to control my tellstick net (witch this ticket is all about).

Could anyone give me a guestimate on when this ticket will ok and i can connect my tellstick net to my computer?

comment:33 in reply to: ↑ 32 ; follow-up: ↓ 35 Changed 7 years ago by tatu wikman <tatu.wikman@…>

Replying to odd arne roll <jobbemann@…>:

Do anyone have a tip for me on how to get my tellstick net work as a thermostat as i planed? Im willing to tinker a bit, and compile some simple stuff, but im no programmer.

I did this with some coding :)

I already had a nice zabbix server ( http://www.zabbix.com/) running that now also sees the temperatures by using the python example provided here (http://developer.telldus.com/browser/examples/python/live/tdtool) I did have to add some extra code to get the sensor values (should probably release my changes somewhere).

And then in zabbix you can cofigure triggers for different values (and even a hysteresis) to run commands (again with tdtool).

My solution is not yet complete (and not planning on working it right now, just wanted to get nice graphs from the terrarium so that I know that my Iguana is feeling nice and warm :)

comment:34 Changed 7 years ago by odd arne roll <jobbemann@…>

Super cool =)
Thank you for sharing, and yes, it would be nice to see what you have done posted somewhere. If and when you do, please give me a heads up!

Thanks again!

comment:35 in reply to: ↑ 33 Changed 7 years ago by jouni renfors <jouni.renfors@…>

Replying to tatu wikman <tatu.wikman@…>:

Replying to odd arne roll <jobbemann@…>:

Do anyone have a tip for me on how to get my tellstick net work as a thermostat as i planed? Im willing to tinker a bit, and compile some simple stuff, but im no programmer.

I did this with some coding :)

I already had a nice zabbix server ( http://www.zabbix.com/) running that now also sees the temperatures by using the python example provided here (http://developer.telldus.com/browser/examples/python/live/tdtool) I did have to add some extra code to get the sensor values (should probably release my changes somewhere).

And then in zabbix you can cofigure triggers for different values (and even a hysteresis) to run commands (again with tdtool).

My solution is not yet complete (and not planning on working it right now, just wanted to get nice graphs from the terrarium so that I know that my Iguana is feeling nice and warm :)

Could you please attach the changes you made to tdtool.py here. I would also like to setup temperature monitoring using teltstick net. No need to code the changes multiple times :).

Changed 7 years ago by tatu wikman <tatu.wikman@…>

tdtool with sensors options. Adds --list-sensors and --sensor-data

comment:36 Changed 7 years ago by tatu wikman <tatu.wikman@…>

Cleaned up my version a bit and uploaded it just now.

I wont take any responsibility on it working for you or anyone else.

The changes are simple, just adds two new parameters --list-sensors and --sensor-data.

comment:37 Changed 7 years ago by micke prag <micke.prag@…>

  • Sensitive unset

Please keep this ticket on topic! For contributions follow the preffered methods or use the forum for generic discussions.

comment:38 Changed 6 years ago by carl angervall <carl.angervall@…>

is there any new reagarding getting the telldus core to work with Tellstick NET???
Carl

comment:39 Changed 5 years ago by per thomas jahr <perja@…>

I have tested tdtool-with-sensors.py that is attached to this ticket on my Raspberry Pi and it works very well against TellStick Net. But is there a way to subscribe to events so that I don't have to poll the device?

comment:40 Changed 5 years ago by bjørn ruberg <bruberg@…>

This ticket has been referenced in ticket #378:

I see that this topic has been somewhat discussed in #114 already.

comment:41 follow-ups: ↓ 44 ↓ 45 Changed 5 years ago by julien burnet <julien.burnet@…>

Hi everyone,

I have been able to submit commands (on and off) locally to my updated tellstick net, making a python web server based on the example here :
 https://github.com/telldus/tellstick-net/blob/master/client/send.py

However, this is only a part of what I would like to do locally. I have been reading the protocol documentation, but I can not make it alone.
What I miss is :

  • How to learn / sync a new module
  • How to get sensors values
  • How to list already synced modules

Right now, I hardcoded the different values of my modules, extracted from telldus live.
I was thinking of using the telldus live API to get this information, just in order to go on with my dev, but my preference would be to go fully locally.

Can anyone help me with the protocol ? Give me the different UDP commands I can send to tellstick net ? Is there any documentation / example that I have missed ?

I will be happy to share my code on github, when it is "showable".

Thank you

comment:42 Changed 5 years ago by magnus knutas <magnusknutas@…>

Is this ever going to get sorted? I've watched this issue for 3 years and still nothing?

comment:43 Changed 5 years ago by stefan persson <stefan.persson@…>

There is no active development on this ticket.

comment:44 in reply to: ↑ 41 Changed 5 years ago by terri paju <terri@…>

Replying to julien burnet <julien.burnet@…>:

Hi everyone,

I have been able to submit commands (on and off) locally to my updated tellstick net, making a python web server based on the example here :
[...]
I will be happy to share my code on github, when it is "showable".

I'd love to see your code.

comment:45 in reply to: ↑ 41 Changed 5 years ago by terri paju <terri@…>

Replying to julien burnet <julien.burnet@…>:

  • How to get sensors values

So far; I have found that there are UDP broadcasts from Tellstick's IP like these:
7:RawDatah5:class6:sensor8:protocol8:mandolyn5:model13:temperaturehumidity4:datai274334D1ss
7:RawDatah5:class6:sensor8:protocolA:fineoffset4:datai487105FF4Ess

comment:46 Changed 5 years ago by micke prag <micke.prag@…>

Please keep on topic. For general discussion please use the forum.

comment:47 follow-ups: ↓ 48 ↓ 49 Changed 4 years ago by claes nordmark <nordmarkclaes@…>

Ive made some updates to telldus-core and tellstick-net firmware in order to support tellstick net. So far I got on/off and recieve sensor values working. Anyone that would like to test them?

comment:48 in reply to: ↑ 47 Changed 4 years ago by måns rynningsjö <mans.malmberg@…>

Replying to claes nordmark <nordmarkclaes@…>:

Anyone that would like to test them?

Yes, please!

comment:49 in reply to: ↑ 47 Changed 4 years ago by carlos xerach cruz lorenzo <xerachcruz@…>

Replying to claes nordmark <nordmarkclaes@…>:

Ive made some updates to telldus-core and tellstick-net firmware in order to support tellstick net. So far I got on/off and recieve sensor values working. Anyone that would like to test them?

Yes please. I would like to try it!.

In my home I only have switch devices, no sensors. That would be util to leave of the dependence of internet connection/Telldus Live and his seconds of delay.

I've been following this ticket for more than a year ago, but I have not decided to prove the modifications by fear to destroy my tellstick.net for not find a simple guide or explanation for how to install it.

comment:50 follow-up: ↓ 52 Changed 4 years ago by claes nordmark <nordmarkclaes@…>

Okay, then give me a couple of days to set it up, I will see if I can write a guide or something also.

comment:51 Changed 4 years ago by carl angervall <carl.angervall@…>

I'am interested but I wonder if the new firmware till pick up my thermo sensors?

Best regards
Carl

comment:52 in reply to: ↑ 50 Changed 4 years ago by carlos xerach cruz lorenzo <xerachcruz@…>

Replying to claes nordmark <nordmarkclaes@…>:

Okay, then give me a couple of days to set it up, I will see if I can write a guide or something also.

Thank you very much!!

comment:53 Changed 4 years ago by claes nordmark <nordmarkclaes@…>

Okay I have now forked the telldus and tellstick-net so you can download and build it by yourself.

Its at the moment a bit of static setup in telldus core, as it only works for linux, also it will not work for telldus with usb(duo/previous).
 https://github.com/konsulten/telldus/
link to tellstick-net firmware source fork:
 https://github.com/konsulten/tellstick-net

I have a built hex file for the tellstick net and put is an attachment, for telldusd you have to try it by building it from github.

I have verified it to work with Nexa selflearning switches/dimmers, magnetic sensor lmst-606, mandolyn and fineoffset humidity/temp sensors.

Later I will try to "finilize" so it could be put as patches towards the main repo. This state of the code is currently not 100% inline with the structure.

Last edited 4 years ago by claes nordmark <nordmarkclaes@…> (previous) (diff)

Changed 4 years ago by claes nordmark <nordmarkclaes@…>

Hex file for supporting local access via telldusd

Changed 4 years ago by bob foster <smartmil888@…>

comment:54 Changed 4 years ago by erik eriksson <error.errorsson@…>

Can we assume this will never be implemented?

comment:55 Changed 4 years ago by onar olsen <onar.olsen@…>

I have tested your fork today, and it works very well. Great work!
I had to read the telldus-core code, before I figured out the format of the tellstick.conf file (/etc/tellstick.conf) :-)
The following file works:

user = "nobody"
group = "plugdev"
deviceNode = "/dev/tellstick"
ignoreControllerConfirmation = "false"

controller {

name = "Hemma"
id = 1
type = 3
serial = "XXXXXXXXXX"

}

device {

id = 1
name = "Anslut dosa"
controller = 1
protocol = "arctech"
model = "selflearning-switch"
parameters {

# devices = ""
house = "1"
unit = "1"
}

}

The device above is just an example device. Replace house, unit, name, model etc. to match your 433MHz device.

I used the previously attached TellStickNet.hex file, but I also compiled my own. The only compiler that works for me is the 9.63PL3 Hitech picc18 compiler. You can download it from here:  ftp://ftp.microchip.com/

I have some Oregon Scientific temperature sensors that did't not work, but I might not have waited long enough for them to show up.

No problem to flash back the original firmware after playing around.

It would be great it we could get official support for this patch.
Having support for local access gives much faster "switching" times, independence of an internet connection (a LAN is of course needed) and it also gives us the possibility to use open source alternatives to control the tellstick.

comment:56 Changed 3 years ago by teemu suikki <zuikkis@…>

Thanks for this. :)

This is an old ticket and probably already forgotten by Telldus, but I landed here from google and thought I'd give it a try. With some tweaking it's working fine, telldusd running on Raspberry Pi 3.

Here's some extra info for the steps needed, because there is really no documentation. Remember though that you are doing this on your own risk!

git clone both of the above repos. You don't need to compile the firmware, if you are using the prebuilt .hex file.

Use python script "client/send.py" to find out the IP of your TellStick Net. It will complain on the
incorrect firmware, but show you the ip.

The hex file can be flashed with command:

atftp -p -l TellStickNet.hex --tftp-timeout 1 192.168.0.xxx

Give it a few tries if it doesn't seem to work. Check with send.py if the firmware is correct..

atftp is included in ubuntu at least, just apt-get it..

Telldusd compiles and installs with no worries on Raspbian. Above example config works, once you find out the serial number "XXXXXXXXX".. Is it printed somewhere on the device itself, or where is this supposed to be found? :)

I added some extra debug to the telldus-core/service/TellStick_libnet.cpp file, near line 330:

               td.address = std::string(ipstr);
               tellstick.push_back(td);

+              Log::notice("Found TellStick (%X/%X) with serial %s", td.vid, td.pid, td.serial.c_str());

That shows the serial on the log, then just copypaste to tellstick.conf. :)

comment:57 Changed 10 months ago by teemu suikki <zuikkis@…>

(Content removed by admin)

Last edited 10 months ago by micke prag <micke.prag@…> (previous) (diff)
Note: See TracTickets for help on using tickets.