Sharp Aquos TV Driver

Does anybody know of any Hubitat Driver to control a Sharp Aquos TV.
There is one on github created for Smartthings, but I don't know how to port it over to Hubitat. device-sharp-aquos/device-type-sharp-aquos.groovy at master · macmedia/device-sharp-aquos · GitHub

Step one would be to just try importing it. Sometimes you get lucky.

There is a thread about what is different between the hub commands here: App and driver porting to Hubitat Hopefully if you have to edit the driver, this will help.

Beyond that, I am not much help. Hopefully others can chime in here.

Interested in this too!

I replaced physicalgraph with hubitat in the code and it saved ok. Now when I press any of the buttons it says Cannot get property 'host' on null object. Does that mean it is not communicating with the tv?

Should this have been an app code or driver code. I put it in the driver code section of Hubitat.

Must suppose to be in driver section, app code area give me errors.

Still says current states blocked and in error logs says Cannot get property 'host' on null object. Any ideas?

The linked driver is... shall we say... rather sparse....

That and the ST way of doing things is ever so slightly different for HE...

So, even though I DO NOT have a compatible Sharp TV (The one I have is a Roku version... They do not have the IP control socket), as an intellectual exercize, I converted and upgraded the driver so that it should work....

First, delete the non working device. Then delete the existing driver code. Then create a new driver and upload the attached code. Then create a new virtual device with the new driver... Once the device is created, enter the IP Address and port of the TV into the appropriate parameters, click on "Save parameters", and check the logs to see what it's doing...

As a first attempt, there is no option to turn off the debugging... There are also options for username and password for the TV... Neither of these parameters are used by the driver. Those options can come later...

MAKE SURE THAT: 1) IP Control is enabled on your TV, 2) There is no username or password set up for IP Control on your TV and 3) make sure that "quick start" is enabled on the TV (That option may be worded differently... but it should be there...)

If the driver connects to the TV, it should support: Power On, Power Off, Volume Up, Volume Down, Set volume, inputNextChannel, inputSelect and inputCommand.

Other functions (Channel Up, Channel Down, etc) can be added later, but as I do not know exactly what data the various commands returns, It will need to be added after we get some log data...

[Old version removed]

Thank you very much for your help.
Did as you stated, this is what I see when I hit initialize.

2019-12-03 11:14:34.305 pm warnConnection refused (Connection refused)

dev:7052019-12-03 11:14:34.296 pm debugSharpAquos - request = IAVD?

dev:7052019-12-03 11:14:34.288 pm debugSharpAquos - request = VOLM?

dev:7052019-12-03 11:14:34.283 pm debugSharpAquos - request = MUTE?

dev:7052019-12-03 11:14:34.277 pm debugSharpAquos - request = POWR?

dev:7052019-12-03 11:14:34.264 pm debugSharpAquos - initialize

If the TV is refusing the connection, then there is something not set up properly on the TV or in the driver settings...

On the TV make sure you have enabled IP Control... and that the username and password are not set. Once these options are set, you will probably need to power cycle the TV...

In the driver, make sure the IP address is set to the IP address of the TV, and that the Port is set to the same port as on the TV.

Thanks again for the advice, but I am still struggling with this one. I think the tv is step correctly as I downloaded a Sharpremote app for my iphone and with my tvs ip and port it controls it just fine. My guess is the driver is missing something but I don't know. Still getting the Connection refused.

Ok... Reviewing the code... There may be a bug... or maybe the hubAction route is not the best course of action...

So, I've added some more debugging and added some code to test raw sockets...

Give this new code a try...

[Old version removed]

No luck, this is what I am seeing.

Summary

dev:7372019-12-05 04:51:36.941 pm warnConnection refused (Connection refused)

dev:7372019-12-05 04:51:36.241 pm debugSharpAquos - socketStatus - received [receive error: Stream closed.]

dev:7372019-12-05 04:51:36.201 pm debugSharpAquos - socketStatus - received [receive error: Stream closed.]

dev:7372019-12-05 04:51:36.130 pm warnConnection refused (Connection refused)

dev:7372019-12-05 04:51:36.125 pm debugSharpAquos - socketStatus - received [send error: Socket closed]

dev:7372019-12-05 04:51:36.101 pm debugSharpAquos - HubAction request = [IAVD? ] to 192.168.254.205:10002

dev:7372019-12-05 04:51:36.093 pm debugSharpAquos - request - Trying HubAction...

dev:7372019-12-05 04:51:36.088 pm debugSharpAquos - socketStatus - received [send error: Socket closed]

dev:7372019-12-05 04:51:36.043 pm warnConnection refused (Connection refused)

dev:7372019-12-05 04:51:36.038 pm debugSharpAquos - rawSocket request = [IAVD? ] to 192.168.254.205:10002

dev:7372019-12-05 04:51:36.033 pm debugSharpAquos - request - Trying raw socket...

dev:7372019-12-05 04:51:36.017 pm debugSharpAquos - HubAction request = [VOLM? ] to 192.168.254.205:10002

dev:7372019-12-05 04:51:36.011 pm debugSharpAquos - request - Trying HubAction...

dev:7372019-12-05 04:51:35.969 pm debugSharpAquos - rawSocket request = [VOLM? ] to 192.168.254.205:10002

dev:7372019-12-05 04:51:35.963 pm debugSharpAquos - request - Trying raw socket...

dev:7372019-12-05 04:51:35.958 pm debugSharpAquos - socketStatus - received [send error: Socket closed]

dev:7372019-12-05 04:51:35.921 pm debugSharpAquos - HubAction request = [MUTE? ] to 192.168.254.205:10002

dev:7372019-12-05 04:51:35.915 pm debugSharpAquos - request - Trying HubAction...

dev:7372019-12-05 04:51:35.910 pm warnConnection refused (Connection refused)

dev:7372019-12-05 04:51:35.904 pm debugSharpAquos - socketStatus - received [send error: Socket closed]

dev:7372019-12-05 04:51:35.883 pm debugSharpAquos - rawSocket request = [MUTE? ] to 192.168.254.205:10002

dev:7372019-12-05 04:51:35.878 pm debugSharpAquos - request - Trying raw socket...

dev:7372019-12-05 04:51:35.861 pm debugSharpAquos - HubAction request = [POWR? ] to 192.168.254.205:10002

dev:7372019-12-05 04:51:35.855 pm debugSharpAquos - request - Trying HubAction...

dev:7372019-12-05 04:51:35.835 pm debugSharpAquos - rawSocket request = [POWR? ] to 192.168.254.205:10002

dev:7372019-12-05 04:51:35.829 pm debugSharpAquos - request - Trying raw socket...

dev:7372019-12-05 04:51:35.816 pm debugSharpAquos - initialize - IP: 192.168.254.205 PORT: 10002 USER: null PASS: null

dev:7372019-12-05 04:51:35.811 pm debugSharpAquos - initialize

This text will be hidden

You'll notice that the driver attempted a hubAction connection and a raw socket connection... Both resulted in the connection being refused. There has to be something that is causing the TV to refuse the connection...

  1. Have you power cycled the TV since setting the IP control parameters. Some discussions indicate that this may be required...
  2. Have you verified that the IP address is set correctly?
  3. Have you verified that the Port is set correctly?
  4. Is there a username/password set on the TV??? If there is, set the login and password parameters for the driver (the fact that the raw socket is returning "send error: socket closed" rather than an explicit "connection refused" may indicate that it is refusing the command because it is not authenticated). The driver has already been updated to handle the documented authentication procedure.

Also... What App are you using on your phone, and what is the model of your TV?

The IP looks good, port is 10002, everything looks setup correctly on the TV like you stated. The iphone IOS app SharpRemoteControl2 talks to the TV just fine. The TV is a Sharp LC-80LE844U.

Looks like I missed a carriage return in the command sent to the TV...

Let's give this another try...

[Old version removed]

Good try but same error.....I think.

Summary

dev:7732019-12-05 11:17:09.665 pm debugSharpAquos - socketStatus - received [receive error: Stream closed.]

dev:7732019-12-05 11:17:09.658 pm warnConnection refused (Connection refused)

dev:7732019-12-05 11:17:09.655 pm debugSharpAquos - socketStatus - received [send error: Socket closed]

dev:7732019-12-05 11:17:09.631 pm debugSharpAquos - HubAction request = [IAVD? ] to 192.168.254.205:10002

dev:7732019-12-05 11:17:09.628 pm debugSharpAquos - request - Trying HubAction...

dev:7732019-12-05 11:17:09.625 pm debugSharpAquos - socketStatus - received [send error: Socket closed]

dev:7732019-12-05 11:17:09.622 pm debugSharpAquos - rawSocket request = [IAVD? ] to 192.168.254.205:10002

dev:7732019-12-05 11:17:09.619 pm debugSharpAquos - request - Trying raw socket...

dev:7732019-12-05 11:17:09.617 pm debugSharpAquos - socketStatus - received [receive error: Stream closed.]

dev:7732019-12-05 11:17:09.614 pm warnConnection refused (Connection refused)

dev:7732019-12-05 11:17:09.611 pm debugSharpAquos - HubAction request = [VOLM? ] to 192.168.254.205:10002

dev:7732019-12-05 11:17:09.608 pm warnConnection refused (Connection refused)

dev:7732019-12-05 11:17:09.605 pm debugSharpAquos - request - Trying HubAction...

dev:7732019-12-05 11:17:09.602 pm debugSharpAquos - socketStatus - received [send error: Socket closed]

dev:7732019-12-05 11:17:09.570 pm debugSharpAquos - socketStatus - received [receive error: Stream closed.]

dev:7732019-12-05 11:17:09.557 pm debugSharpAquos - rawSocket request = [VOLM? ] to 192.168.254.205:10002

dev:7732019-12-05 11:17:09.551 pm debugSharpAquos - request - Trying raw socket...

dev:7732019-12-05 11:17:09.549 pm warnConnection refused (Connection refused)

dev:7732019-12-05 11:17:09.542 pm debugSharpAquos - HubAction request = [MUTE? ] to 192.168.254.205:10002

dev:7732019-12-05 11:17:09.519 pm debugSharpAquos - request - Trying HubAction...

dev:7732019-12-05 11:17:09.516 pm debugSharpAquos - rawSocket request = [MUTE? ] to 192.168.254.205:10002

dev:7732019-12-05 11:17:09.513 pm debugSharpAquos - socketStatus - received [send error: Socket closed]

dev:7732019-12-05 11:17:09.499 pm debugSharpAquos - request - Trying raw socket...

dev:7732019-12-05 11:17:09.491 pm debugSharpAquos - HubAction request = [POWR? ] to 192.168.254.205:10002

dev:7732019-12-05 11:17:09.488 pm debugSharpAquos - request - Trying HubAction...

dev:7732019-12-05 11:17:09.468 pm debugSharpAquos - rawSocket request = [POWR? ] to 192.168.254.205:10002

dev:7732019-12-05 11:17:09.465 pm debugSharpAquos - request - Trying raw socket...

dev:7732019-12-05 11:17:09.457 pm debugSharpAquos - initialize - IP: 192.168.254.205 PORT: 10002 USER: null PASS: null

dev:7732019-12-05 11:17:09.454 pm debugSharpAquos - initialize

Another try...

[Old version removed]

Still no luck, the SharpRemoteControl2 ios app works fine on my lan to the TV.

Summary

dev:7742019-12-06 04:40:37.541 pm debugSharpAquos - socketStatus - received [receive error: Stream closed.]

dev:7742019-12-06 04:40:37.480 pm debugSharpAquos - socketStatus - received [receive error: Stream closed.]

dev:7742019-12-06 04:40:37.397 pm warnConnection refused (Connection refused)

dev:7742019-12-06 04:40:37.392 pm debugSharpAquos - socketStatus - received [send error: Socket closed]

dev:7742019-12-06 04:40:37.386 pm debugSharpAquos - HubAction request = [IAVD? ] to 192.168.254.205:10002

dev:7742019-12-06 04:40:37.383 pm debugSharpAquos - request - Trying HubAction...

dev:7742019-12-06 04:40:37.373 pm debugSharpAquos - rawSocket request = [IAVD? ] to 192.168.254.205:10002

dev:7742019-12-06 04:40:37.371 pm debugSharpAquos - request - Trying raw socket...

dev:7742019-12-06 04:40:37.366 pm warnConnection refused (Connection refused)

dev:7742019-12-06 04:40:37.354 pm debugSharpAquos - HubAction request = [VOLM? ] to 192.168.254.205:10002

dev:7742019-12-06 04:40:37.352 pm debugSharpAquos - request - Trying HubAction...

dev:7742019-12-06 04:40:37.343 pm debugSharpAquos - socketStatus - received [send error: Socket closed]

dev:7742019-12-06 04:40:37.340 pm debugSharpAquos - rawSocket request = [VOLM? ] to 192.168.254.205:10002

dev:7742019-12-06 04:40:37.337 pm debugSharpAquos - request - Trying raw socket...

dev:7742019-12-06 04:40:37.334 pm warnConnection refused (Connection refused)

dev:7742019-12-06 04:40:37.324 pm debugSharpAquos - HubAction request = [MUTE? ] to 192.168.254.205:10002

dev:7742019-12-06 04:40:37.321 pm debugSharpAquos - request - Trying HubAction...

dev:7742019-12-06 04:40:36.446 pm debugSharpAquos - socketStatus - received [receive error: Stream closed.]

dev:7742019-12-06 04:40:36.309 pm debugSharpAquos - rawSocket request = [MUTE? ] to 192.168.254.205:10002

dev:7742019-12-06 04:40:36.306 pm warnConnection refused (Connection refused)

dev:7742019-12-06 04:40:36.304 pm debugSharpAquos - request - Trying raw socket...

dev:7742019-12-06 04:40:36.293 pm debugSharpAquos - HubAction request = [POWR? ] to 192.168.254.205:10002

dev:7742019-12-06 04:40:36.290 pm debugSharpAquos - request - Trying HubAction...

dev:7742019-12-06 04:40:36.249 pm debugSharpAquos - rawSocket request = [POWR? ] to 192.168.254.205:10002

dev:7742019-12-06 04:40:36.247 pm debugSharpAquos - request - Trying raw socket...

dev:7742019-12-06 04:40:36.236 pm debugSharpAquos - initialize - IP: 192.168.254.205 PORT: 10002 USER: null PASS: null

dev:7742019-12-06 04:40:36.233 pm debugSharpAquos - initialize

I notice you’re using socket. I’m not sure if you even need to tokenize the IP for that in HE’s implementation.

Feel free to take a look at any of my MagicHome/EcoPlugs/other code that uses socket/telnet if you want to use any code from there :slight_smile:

Ok... Looking closely at the code and at the debug responses... It looks like the driver may actually be connecting to the TV... But it does not receive a response from the TV so it does not properly complete the connection...

As all of the commands sent to the TV are query command... We can't tell if the TV is receiving and processing the commands...

So, I have made changes so that the driver should properly capture data returned by the TV... And... changed the command sent to the TV so that, if it is receiving the commands, It will show something on the display (It should bring up the "smart Central" screen/menu)....

[Old version removed]