28.06.2021, 09:57
Just try the Wake-on-LAN script, either it works with your TV or it does not.
LG smart TV
|
28.06.2021, 09:57
Just try the Wake-on-LAN script, either it works with your TV or it does not.
14.10.2022, 11:33
Hi , Admin how should i use Wake-on-LAN script
TV has wake-on-lan feature , i tried with someother controllers,But could'nt make it with LM
14.10.2022, 11:39
Use this script: https://forum.logicmachine.net/showthread.php?tid=687
Code: 1 wol_send('TV_MAC_ADDRESS')
14.10.2022, 11:58
Thanks it worked.
Another thing i stumbled on is mute "lgtv.request('ssap://audio/setMute', {mute: true});" How can i change this line to lua ?
14.10.2022, 12:02
Check the code/examples in this thread, especially this: https://forum.logicmachine.net/showthrea...6#pid20936
14.10.2022, 12:25
Code: 1 payload = json.encode({ mute = true })
17.10.2022, 12:19
Thank you Admin.
06.02.2023, 18:29
(13.07.2020, 17:54)ro_ki@tut.by Wrote: Attached you can find the library to control LG TV with Web OS.Hi, Thank you so much for your works, I am working with your script. On WOL I can work with the TV, but with script I always receive (no connection). Is there some initial confirmation to do before start? Best regards Cristian
28.02.2023, 08:46
Hello Admin,
How to make the get commands like the following: audio/getStatus audio/getVolume
Best Regards,
28.02.2023, 08:55
You need to modify the lg_execute_command function to return the response:
Code: 1234567891011121314151617181920 function lg_execute_command(ip, key_address, prefix, msgtype, uri, payload)
local connection_sync = require('user.websocket_client_sync')
local url = 'ws://'..ip..':3000/'
local resp
local client = connection_sync.client(5)
local noerr,msg,headers = client:connect(url)
if noerr then
if initial_connect(client, key_address) then
resp = send_command_with_response(client, prefix, msgtype, uri, payload)
end
else
log('No connection with TV. Probably it is switched off', url, noerr, a, text)
end
local was_clean,code,reason = client:close()
log("Connection close result:", was_clean,code,reason)
return resp
endThen try this and see if you get anything logged: Code: 12 resp = lg_execute_command(LGTV65_IP, LGTV65_KEY, "", "request", "ssap://audio/getStatus", "")
log(resp)
28.02.2023, 10:04
Thanks Admin
yes I get the following: Code: 1 "returnValue":true,"volumeStatus":{"activeStatus":true,"adjustVolume":true,"maxVolume":100,"muteStatus":false,"volume":8,"mode":"normal","soundOutput":"tv_external_speaker"},"callerId":"com.webos.service.apiadapter","mute":false,"volume":8}}
Best Regards,
28.02.2023, 10:07
Looks like a part of a JSON string. Have you copied it completely?
The correct way is to parse the JSON but it is also possible to get the volume value from the output like this: Code: 12 volume = resp:match('"volume":(%d+)')
log(volume)
Here is the full string
Code: 1 * string: {"type":"response","id":"******","payload":{"returnValue":true,"volumeStatus":{"activeStatus":true,"adjustVolume":true,"maxVolume":100,"muteStatus":false,"volume":8,"mode":"normal","soundOutput":"tv_external_speaker"},"callerId":"com.webos.service.apiadapter","mute":false,"volume":8}}
Best Regards,
28.02.2023, 10:14
Try this then:
Code: 1234567 data = require('json').pdecode(resp)
if type(data) == 'table' then
volume = data.payload.volumeStatus.volume
log(volume)
else
log('invalid response', resp)
end
Hello dears,
the turn off command stop working, is there any changes have been made on the LG TV? here are the log response of the lg_execute_command * arg: 1 * string: No connection with TV. Probably it is switched off * arg: 2 * string: ws://192.168.10.8:3000/ * arg: 3 * nil * arg: 4 * nil * arg: 5 * nil * arg: 1 * string: Connection close result: * arg: 2 * bool: false * arg: 3 * number: 1006 * arg: 4 * string: wrong state
Best Regards,
19.08.2024, 08:18
Hello Dears,
Has anyone encountered a similar issue? Are there any updates that need to be applied?
Best Regards,
|
« Next Oldest | Next Newest »
|