klattimer / LGWebOSRemote

Command line webOS remote for LGTVs
MIT License
498 stars 97 forks source link

Turning the tv off while its already off, actually turns the tv on again #19

Closed psy0rz closed 6 years ago

psy0rz commented 6 years ago

This is a big issue for home automation: I always want to send a "tv off" signal if my system detects i've left my house. Now this is not possible since it will turn on the tv when its already off :(

psy0rz commented 6 years ago

It seems this isnt always the case. Sometimes it takes a while for the network part to actually shut off. So long the network part of the tv is active this issue will occur. Maybe we could add a extra check or something?

klattimer commented 6 years ago

Hmm, this wasn’t the case in the past, to turn on you had to use wake on lan and off is an explicit command... I’ll experiment and see what I can do

Sent from my iPhone

On 6 Jan 2018, at 00:59, DatuX notifications@github.com wrote:

This is a big issue for home automation: I always want to send a "tv off" signal if my system detects i've left my house. Now this is not possible since it will turn on the tv when its already off :(

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

pquerner commented 6 years ago

For me the program kinda crashed and I had to force restart it. After I restarted it, I tried yet again to turn off the TV (which is still off at this moment) and the program froze again.

python alexa-tv.py 
DEBUG:root:Listening for UPnP broadcasts
DEBUG:root:got local address of 192.168.0.25
DEBUG:root:UPnP broadcast listener: new device registered
DEBUG:root:FauxMo device 'playstation' ready on 192.168.0.25:52008
DEBUG:root:UPnP broadcast listener: new device registered
DEBUG:root:FauxMo device 'receiver' ready on 192.168.0.25:52005
DEBUG:root:UPnP broadcast listener: new device registered
DEBUG:root:FauxMo device 'nintendo switch' ready on 192.168.0.25:52012
DEBUG:root:UPnP broadcast listener: new device registered
DEBUG:root:FauxMo device 'plex' ready on 192.168.0.25:52001
DEBUG:root:UPnP broadcast listener: new device registered
DEBUG:root:FauxMo device 'super nintendo' ready on 192.168.0.25:52010
DEBUG:root:UPnP broadcast listener: new device registered
DEBUG:root:FauxMo device 'gaming pc' ready on 192.168.0.25:52007
DEBUG:root:UPnP broadcast listener: new device registered
DEBUG:root:FauxMo device 'tv' ready on 192.168.0.25:52000
DEBUG:root:UPnP broadcast listener: new device registered
DEBUG:root:FauxMo device 'netflix' ready on 192.168.0.25:52003
DEBUG:root:UPnP broadcast listener: new device registered
DEBUG:root:FauxMo device 'youtube' ready on 192.168.0.25:52002
DEBUG:root:UPnP broadcast listener: new device registered
DEBUG:root:FauxMo device 'switch' ready on 192.168.0.25:52011
DEBUG:root:UPnP broadcast listener: new device registered
DEBUG:root:FauxMo device 'playback' ready on 192.168.0.25:52004
DEBUG:root:UPnP broadcast listener: new device registered
DEBUG:root:FauxMo device 'giant bomb' ready on 192.168.0.25:52013
DEBUG:root:UPnP broadcast listener: new device registered
DEBUG:root:FauxMo device 'snes' ready on 192.168.0.25:52009
DEBUG:root:UPnP broadcast listener: new device registered
DEBUG:root:FauxMo device 'home theater' ready on 192.168.0.25:52006
DEBUG:root:Entering fauxmo polling loop
DEBUG:root:Responding to OFF for tv
State False on  tv from client @ 192.168.0.29
{"type": "response", "id": "0", "payload": {"returnValue": true}}
{"closing": {"reason": "", "code": 1000}}
TV turned off!
DEBUG:root:Responding to OFF for tv
State False on  tv from client @ 192.168.0.29

^C
^CTraceback (most recent call last):
  File "lgtv.py", line 493, in <module>
    ws.close()
  File "/usr/local/lib/python2.7/dist-packages/ws4py/client/__init__.py", line 205, in close
    self._write(self.stream.close(code=code, reason=reason).single(mask=True))
  File "/usr/local/lib/python2.7/dist-packages/ws4py/websocket.py", line 285, in _write
    self.sock.sendall(b)
  File "/usr/lib/python2.7/socket.py", line 228, in meth
    return getattr(self._sock,name)(*args)
KeyboardInterrupt
TV turned off!
DEBUG:root:Responding to OFF for tv
State False on  tv from client @ 192.168.0.29
^CTV turned off!
DEBUG:root:Responding to ON for tv
^[[A^[[A^CTraceback (most recent call last):
  File "alexa-tv.py", line 121, in <module>
    p.poll(100)
  File "/home/pascal/hometheater-smarthome-bridge/fauxmo.py", line 83, in poll
    ready = self.poller.poll(timeout)
KeyboardInterrupt

(Used this: https://github.com/carlherbst/hometheater-smarthome-bridge)

klattimer commented 6 years ago

OK, I'm closing this bug as it seems to be absolutely nothing to do with my code, I'm seriously not entertaining other peoples bugs here and will only respond to bug reports which have been identified and reproducible on the command line tool I provided.

I've seen multiple extremely poor attempts at integrating this with alexa now and I think you need to start at the first point of failure, which isn't my code.