Telldus Live Switch Updates

Hi,

Is there anyway to get the switch values from Telldus LIve any quicker, currently it takes HA 40s to determine a state change in any switches, this is not good when my door switches change state as I need a light to come on when a door is opened. ATM the light comes on after I’ve left the hall after taking off my shoes in the dark, not very user friendly :P, I’m kind of assuming that Telldus is polled but can we set a poll rate/scan rate that is a bit quicker?

I don’t think any push-mechanism or “long polling” is supported by the server using the free subscription.

The pro subscription seems to include some kind of push to a custom url, but that would require HA to expose an endpoint to the internet. I guess it would be possible to build something yourself that receives events from the server and then forwards them to HA over MQTT or something.

The polling interval is customizable but there is a limit to how often the server can be polled.

If your Tellstick Net is on the same network as your HA instance, it is possible to subscribe to events broadcasted on the local network. I think this would be a very nice addition to the current implementation, since it would allow for receiving “instant” events from door switches.

This, however is not currently not implemented. Python implementations of some of the relevant protocols seems to be found here: https://github.com/telldus/tellstick-server/tree/master/rf433/src/rf433 and a first attempt to build a library for receiving local events is here: https://github.com/molobrakos/tellsticknet

Hi @molobrakos,

Thanks for the reply. I thought it would not be possible to poll more often, but thought i would ask. I have a pro subscription so I might give a try to sending a message via mqtt, however I ultimately want to move away from cloud based services. I think that your idea of subscribing to events on the local network is exactly what I want :).

So I have tried your code (many thanks), however it seems to crash on receiving a packet although it does receive the correct information…

pi@raspberrypi3:~/tellsticknet $ ./script/listen
17-03-12 11:41.06 INFO (MainThread) [tellsticknet.discovery] Discovering tellstick devices …
17-03-12 11:41.06 INFO (MainThread) [tellsticknet.discovery] Found TellStickNet device with firmware 17 at 192.168.1.128
17-03-12 11:41.06 DEBUG (MainThread) [tellsticknet.controller] creating controller with address 192.168.1.128
17-03-12 11:41.06 DEBUG (MainThread) [tellsticknet.controller] Listening for signals from 192.168.1.128
17-03-12 11:41.06 INFO (MainThread) [tellsticknet.controller] Registering self as listener for device at 192.168.1.128
17-03-12 11:41.06 DEBUG (MainThread) [tellsticknet.controller] Sending packet to controller 192.168.1.128:42314 <b’b:reglistener’>
17-03-12 11:41.09 DEBUG (MainThread) [tellsticknet.controller] Got packet {‘method’: ‘turnon’, ‘model’: ‘selflearning’, ‘class’: ‘command’, ‘group’: 0, ‘unit’: 10, ‘protocol’: ‘arctech’, ‘lastUpdated’: 1489318869, ‘house’: 94292}
17-03-12 11:41.09 DEBUG (MainThread) [tellsticknet.controller] Updated state for contoller
17-03-12 11:41.09 INFO (MainThread) [tellsticknet.controller] Discovered new controller frozenset({(‘house’, 94292), (‘unit’, 10)})
17-03-12 11:41.09 DEBUG (MainThread) [tellsticknet.controller] Returning packet {‘method’: ‘turnon’, ‘model’: ‘selflearning’, ‘class’: ‘command’, ‘group’: 0, ‘unit’: 10, ‘protocol’: ‘arctech’, ‘lastUpdated’: 1489318869, ‘house’: 94292}
{‘method’: ‘turnon’, ‘model’: ‘selflearning’, ‘class’: ‘command’, ‘group’: 0, ‘unit’: 10, ‘protocol’: ‘arctech’, ‘lastUpdated’: 1489318869, ‘house’: 94292}
17-03-12 11:41.09 DEBUG (MainThread) [tellsticknet.protocols.everflourish] Not Everflourish (data=5c1519, house=5893, unit=2, method=9)
Traceback (most recent call last):
File “/usr/local/lib/python3.5/runpy.py”, line 184, in _run_module_as_main
main”, mod_spec)
File “/usr/local/lib/python3.5/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/home/pi/tellsticknet/tellsticknet/main.py”, line 103, in
print_event_stream()
File “/home/pi/tellsticknet/tellsticknet/main.py”, line 87, in print_event_stream
for packet in stream:
File “/home/pi/tellsticknet/tellsticknet/controller.py”, line 102, in events
packet.update(lastUpdated=int(time()))
AttributeError: ‘NoneType’ object has no attribute ‘update’

I will try some more experiments :slight_smile:
Cheers

Maybe this is of use for you: Tellstick Net / Telldus Live