hobbyquaker / lgtv2mqtt

Interface between LG WebOS Smart TVs and MQTT :tv:
MIT License
106 stars 34 forks source link

Doesn't reconnect to TV after TV is off #11

Closed alternative4 closed 4 years ago

alternative4 commented 6 years ago

Hello! The module doesn't reconnect to TV if connection to TV was lost (for example, TV was turned off using a remote control). LGTV2MQTT is ran as a service, when it starts it tries to connect to tv every 3 seconds:

Jul 09 09:09:43 raspberrypi lgtv2mqtt[8002]: 2018-07-09 09:09:43.478 <debug> tv trying to connect ws://192.168.1.50:3000

When I turn on the TV, in connects, works, and everything is OK. When I turn off the TV using MQTT - it begins to reconnect again - which is OK. But when I turn off the TV using a remote - it doesn't check that connection as absent and doesn't try to reconnect.

I've tried to add reconnection, but I am not so familiar with JS to do so.

Thanks in advance!

ttycova commented 5 years ago

Seem to be experiencing the above as well