hobbyquaker / lgtv2mqtt

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

Monitoring on/off status #6

Closed MattL0 closed 6 years ago

MattL0 commented 6 years ago

Hi,

I would like to know if there is a way to monitor the on/off status of the TV with this MQTT package?

thank you

MattL0 commented 6 years ago

maybe with the states of the internet connection? iex: if the tv is disconnected from the internet, the tv is off if tv is connected , the tv is on

hobbyquaker commented 6 years ago

the websocket connection status is published on the topic lgtv/connected. If the payload equals 2 the connection is established. Downside: After switching in the TV there is quite long latency, you‘ll have to wait up to 15s until the smart-tv services are started and the websocket is connected. hth.

MattL0 commented 6 years ago

Thank you so much !! that is perfect

MattL0 commented 6 years ago

I do not know why, but before, when i put the tv off, i was not able to see the off status in lgtv/status/foregroundApp ( it was showing the last app on tv when the tv was on)

But now , since i subscribed to lgtv/connected , i can see a ''off'' satus in lgtv/status/foregroundApp when the tv is off. And it is instant