Closed sensboston closed 5 years ago
Hello!
It looks like your code is the only source code I can find for communicating with Hisense Smart TV via UDP, big thanks for that!
Command python hisense.py -l finds and shows my Hisense Smart TV: `` {'192.168.1.33': <HisenseDataObject method:DISCOVERYACK version:VERSION102 redundantip:192.168.1.33 tvdescriptor:SmartTV08 extra: ip=192.168.1.33 devicename=Smart TV versionid=VERSION300 sourcedesp=ATV:0;DTV:1;VIDEO1:2;VIDEO2:3;YPbPr:4;HDMI1:5;HDMI2:6;HDMI3:7;VGA:8;MC:10 inputmethod=1 tvconvergence=0 udpchannelsurport=1 platform=1 #0-android 1-linux
} `` but I can't figure out how to send "remote" keys to smart TV (sorry but I'm not proficient in Python). For example, command **python hisense.py KEY_APPS** produces this output: postloop postloop ('cm_read: ', 'STATUS 500\r\nPORT: 40168 \r\nID: 93901743\r\n\r\n\x00') postloop postloop postloop ('ct_read: ', 'STATUS 500\r\nVERSION: 0001\r\n\r\n') postloop postloop ('ct_read: ', 'STATUS 500\r\nPORT: 55198 \r\nID: 93901743\r\n\r\n\x00') ('creating new cc: ', 55198) postloop postloop ('key: ', 'KEY_VOLUMEUP') postloop ('cc_read: ', 'HEA 0000\r\n') ('key: ', 'KEY_INPUT') postloop ('cc_read: ', 'HEA 0000\r\n') ('key: ', 'KEY_INPUT1') postloop ('key: ', 'KEY_INPUT_1') postloop ('cc_read: ', 'HEA 0000\r\n') ('key: ', 'KEY_INPUT2') postloop ('key: ', 'KEY_INPUT_2') postloop ('cc_read: ', 'HEA 0000\r\n') ('key: ', 'KEY_MODE') postloop ('key: ', 'KEY_MODE1') postloop ('cc_read: ', 'HEA 0000\r\n') ('key: ', 'KEY_MODE_1') postloop ('key: ', 'KEY_MODE2') postloop ('cc_read: ', 'HEA 0000\r\n') ('key: ', 'KEY_MODE_2') postloop ('key: ', 'KEY_SOURCE') postloop ('cc_read: ', 'HEA 0000\r\n') ('key: ', 'KEY_SOURCE1') postloop ('key: ', 'KEY_SOURCE_1') postloop ('cc_read: ', 'HEA 0000\r\n') ('key: ', 'KEY_SOURCE2') postloop ('key: ', 'KEY_SOURCE_2') postloop ('cc_read: ', 'HEA 0000\r\n') ('key: ', 'KEY_HDMI') postloop ('key: ', 'KEY_HDMI1') postloop ('cc_read: ', 'HEA 0000\r\n') ('key: ', 'KEY_HDMI_1') postloop ('key: ', 'KEY_HDMI2') postloop ('cc_read: ', 'HEA 0000\r\n') ('key: ', 'KEY_HDMI_2') postloop ('key: ', 'KEY_LIVETV') postloop ('cc_read: ', 'HEA 0000\r\n') ('key: ', 'KEY_LIVE_TV') postloop ('key: ', 'KEY_LIVE') postloop ('cc_read: ', 'HEA 0000\r\n') ('key: ', 'KEY_TVLIVE') postloop ('key: ', 'KEY_TV_LIVE') postloop ('cc_read: ', 'HEA 0000\r\n') ('key: ', 'KEY_MUTE') postloop ('key: ', 'KEY_MUTING') postloop ('cc_read: ', 'HEA 0000\r\n') ('key: ', 'KEY_SLEEPTIMER') postloop ('key: ', 'KEY_TIMER') postloop ('cc_read: ', 'HEA 0000\r\n') ('key: ', 'KEY_TIMEOUT') postloop ('key: ', 'KEY_TIMEOFF') postloop ('cc_read: ', 'HEA 0000\r\n') ('key: ', 'KEY_APP') postloop ('key: ', 'KEY_APPS') postloop ('cc_read: ', 'HEA 0000\r\n') ('key: ', 'KEY_APPLICATIONS') postloop ('key: ', 'KEY_PROG') postloop ('cc_read: ', 'HEA 0000\r\n') ('key: ', 'KEY_PROGS') postloop ('key: ', 'KEY_PROGRAMS') postloop ('cc_read: ', 'HEA 0000\r\n') ('key: ', 'KEY_FN') postloop Traceback (most recent call last): File "hisense.py", line 285, in main(sys.argv[1:]) File "hisense.py", line 273, in main s.write() File "hisense.py", line 148, in write key = self.keylist[self.keyloop] IndexError: tuple index out of range and nothing more. Result: pressed key "MUTE" (sound muted on TV)
} `` but I can't figure out how to send "remote" keys to smart TV (sorry but I'm not proficient in Python).
and nothing more. Result: pressed key "MUTE" (sound muted on TV)
Could you please explain your code for a little?
Hello!
It looks like your code is the only source code I can find for communicating with Hisense Smart TV via UDP, big thanks for that!
Command python hisense.py -l finds and shows my Hisense Smart TV: `` {'192.168.1.33': <HisenseDataObject method:DISCOVERYACK version:VERSION102 redundantip:192.168.1.33 tvdescriptor:SmartTV08 extra: ip=192.168.1.33 devicename=Smart TV versionid=VERSION300 sourcedesp=ATV:0;DTV:1;VIDEO1:2;VIDEO2:3;YPbPr:4;HDMI1:5;HDMI2:6;HDMI3:7;VGA:8;MC:10 inputmethod=1 tvconvergence=0 udpchannelsurport=1 platform=1 #0-android 1-linux
Could you please explain your code for a little?