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
Cheers