Sony Devices Binding

When I copy the jar-file to the addons-folder I get the following error:

Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.binding.sony-2.5.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.sony [253]
  Unresolved requirement: Import-Package: org.eclipse.jdt.annotation; resolution:="optional"
  Unresolved requirement: Import-Package: org.eclipse.smarthome.config.discovery.upnp

Any suggestions which addons I need to install additionally?

Thank you for the gread binding.

I have only ip commands power, mute…, But i need right, up, left, down, ok. How can I add this? Under paperUI controls i find no of this commands

@johfeu @AV_HomeAuto
Just discovered that I accidentally made the MAP transformation service required. Prior to the debug messages you see - there should be one that says

08:22:12.348 [WARN ] [ding.sony.internal.SonyHandlerFactory] - No transformation service found for 'MAP' type - cannot create a IrccHandler

Until I make a fix to make it optional - install the map transformation service and try it again.

@KleemannT
What version of openhab are you using?

@anon92890676
Depends on what service you are using. I’m guessing it’s the scalar one? If so, look in your transforms directory for a scalar*.map file - that should show you all the commands your device supports. Then send the name to the IRCCCommand channel. (example: send “Left” to the IRCCCommand channel should do a left - note that it is case sensitive so “LEFT” wouldn’t work).

1 Like

What version of openhab are you using?
openHAB 2.4.0-1 (Release Build)

THank you. But I get allways this error for binding:
Status: UNINITIALIZED - HANDLER_REGISTERING_ERROR SonyHandlerFactory could not create a handler for the thing ‘sony:ircc:XXXXXXX’.
When I insert PIN Code he say error 500

Found the issue here: Creating a binding with UPNP discovery

Appears this only occurs when you drop it in (like we are doing until it’s merged). Try that feature install to see if it works for you (you’ll probably run into the map issue then the other have)

@anon92890676

You are now hitting the map issue from above - install the map transformation and it should work (until I get out a new version - probably tomorrow)

Latest release: https://github.com/tmrobert8/openhab2-addons/releases/tag/2.5-0303-1

Should fix the issue with the map transform service being required. Note: you should install the MAP transform ANYWAY if you plan on using the IRCC Command channel. If you don’t, you’ll need to send the raw commands (“AAAAAwAAHF…”) rather than the short cuts (“Left”)

1 Like

Than you. Now it works. But the IRCC Commands not. I have installed the MAP Transform addin but nothing. Have you any idea?

cheers mate!

Same Problem:

2019-03-03 17:44:08.833 [WARN ] [org.apache.felix.fileinstall ] - Error while starting bundle: file:/C:/Users/Baumi/Desktop/openhab-2.5.0.M1/addons/org.openhab.binding.sony-2.5.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.sony [198]
Unresolved requirement: Import-Package: org.eclipse.jdt.annotation; resolution:=“optional”
Unresolved requirement: Import-Package: org.eclipse.smarthome.config.discovery.upnp

Win10 / OH 2.5.0.M1

@Dragonfly
See response a few replys up - you’ll see th answer.

@anon92890676

If you would, do the following

  1. Stop openhab
  2. Delete the map file in transform directory
  3. Start openhab - should recreate the map file
  4. Open the map file, find the ‘Left’ command and post it
  5. Then send ‘Left’ to the ircc command channel
  6. Open the log, find where ‘Left’ is being sent and post the lines from that point to the corresponding HTTP command/response

If it works - don’t bother posting the above beyond a ‘it works’ type of response…

@tmrobert8 I’m somehow missing audio controls in scalar. Also, before changing the state to Online i get an error “Storage doesn’t exist.” I have a Bravia KD-55XE8096

P.S.
I noticed that if I manually add scalar thing (via .things file) it doesn’t find any audio controls…

@suntribe
First - storage doesn’t exist is fine. Likely your TV is reporting a storage service but the service isn’t responding because the TV actually doesn’t have storage (likely) or its a service only accessible through a different interface (which I’ll be integrating later on). Either way shouldn’t be an issue.

As for the audio - we’ll isn’t that a pain. I just stumbled on the exact issue as well by pure accident. Try this - shutdown openhab, turn on the tv and startup openhab (or turn on the tv and restart the binding if you know how to do that). I’m betting the audio channels appear now. Seems like the audio service will only respond when the device is on - in which case I can’t seem to get the audio channels defined at startup. I think this might be tied to the sonyaudio way of doing things (ie though a websocket) - I’ll need to think on this for a bit if you confirm that they appear now

@tmrobert8 I’ll try to restart the binding while the tv is on… but odd thing is that autodiscovered scalar thing normally reports audio channels while the tv is off :slight_smile:

P.S.
image

You were right… after i turned on the tv and restarted the binding… audio channels are here…

argh - it appears that a change by sony, sometime since I wrote the first version, has made it that some of the services will only respond when the device is on. That creates an issue for some of the services since I need information from the service to dynamically create the channels for the device. Current example is audio - I need to contact the device audio service to find out what audio channels are available (headphone, speaker, etc). If the device isn’t on, the audio service doesn’t respond and I can’t setup those channels.

That creates the problem that if you restart openhab and the device isn’t on - those channels will suddenly disappear even though they are valid once the device is on.

The ONLY way I can think to get around this is to go the zwave route and start creating thing definitions with specific channel setups for all the various devices (using the generic one as a default device when we don’t have a specific definition). I really didn’t want to do that because, like zwave, there is a ton of devices the binding supports and I don’t have the time to manage creating every little device.

The generic scalar device would still be the default if no specific device setup was found (and it will continue with it’s dynamic creation).

So here’s what I was thinking about doing. We’ll create device definitions from this beta group as well as we can (I’ll try to publish [later on]what you’ll need to give me to have it included). I’ll furthermore create a special xml registry that you can define/load your own definitions as well from some local files (this will allow new models to be defined without really having to change the binding each time).

Here’s an example:

    <thing-type id="scalar-XBR-xX830c">
        <label>Sony XBR-X830C</label>
        <description>Sony Bravia XBR-X830C TV</description>

        <channels>
            ... the various channel definitions specific to the 830C
        </channels>
        <config-description-ref uri="thing-type:sony:scalarconfig" />
    </thing-type>

Note that I’m using the lower case “x” as a wildcard since TVs generally have some model format where the screen size is part of it (and usually screen size doesn’t matter from a channel perspective).

What do you all think?

Thank you

My scaler-… File
Left=Left
CursorLeft=CursorLeft
My ircc-… File
CursorLeft=ircc:AAAAAgAAAJcAAABNAw%3D%3D
Left=ircc:AAAAAQAAAAEAAAA0Aw%3D%3D

I have test to send with ircc::, without and with the Name. I get this result in my “/var/log/openhab2/events.log”

2019-03-04 18:12:00.774 [ome.event.ItemCommandEvent] - Item 'sony_ircc_xxxxxxxxxxxx_primary_command' received command Left
2019-03-04 18:12:00.776 [nt.ItemStatePredictedEvent] - sony_ircc_xxxxxxxxxxxx_primary_command predicted to become Left
2019-03-04 18:12:00.778 [vent.ItemStateChangedEvent] - sony_ircc_xxxxxxxxxxxx_primary_command changed from AAAAAQAAAAEAAAA0Aw%3D%3D to Left
2019-03-04 18:12:04.395 [ome.event.ItemCommandEvent] - Item 'sony_ircc_xxxxxxxxxxxx_primary_command' received command L1
2019-03-04 18:12:04.397 [nt.ItemStatePredictedEvent] - sony_ircc_xxxxxxxxxxxx_primary_command predicted to become L1
2019-03-04 18:12:04.398 [vent.ItemStateChangedEvent] - sony_ircc_xxxxxxxxxxxx_primary_command changed from Left to L1
2019-03-04 18:12:07.432 [ome.event.ItemCommandEvent] - Item 'sony_ircc_xxxxxxxxxxxx_primary_command' received command L2
2019-03-04 18:12:07.435 [nt.ItemStatePredictedEvent] - sony_ircc_xxxxxxxxxxxx_primary_command predicted to become L2
2019-03-04 18:12:07.436 [vent.ItemStateChangedEvent] - sony_ircc_xxxxxxxxxxxx_primary_command changed from L1 to L2
2019-03-04 18:12:09.788 [ome.event.ItemCommandEvent] - Item 'sony_ircc_xxxxxxxxxxxx_primary_command' received command L3
2019-03-04 18:12:09.788 [nt.ItemStatePredictedEvent] - sony_ircc_xxxxxxxxxxxx_primary_command predicted to become L3
2019-03-04 18:12:09.789 [vent.ItemStateChangedEvent] - sony_ircc_xxxxxxxxxxxx_primary_command changed from L2 to L3
2019-03-04 18:12:11.344 [ome.event.ItemCommandEvent] - Item 'sony_ircc_xxxxxxxxxxxx_primary_command' received command L4
2019-03-04 18:12:11.346 [nt.ItemStatePredictedEvent] - sony_ircc_xxxxxxxxxxxx_primary_command predicted to become L4
2019-03-04 18:12:11.349 [vent.ItemStateChangedEvent] - sony_ircc_xxxxxxxxxxxx_primary_command changed from L3 to L4
2019-03-04 18:12:13.000 [ome.event.ItemCommandEvent] - Item 'sony_ircc_xxxxxxxxxxxx_primary_command' received command L5
2019-03-04 18:12:13.001 [nt.ItemStatePredictedEvent] - sony_ircc_xxxxxxxxxxxx_primary_command predicted to become L5
2019-03-04 18:12:13.002 [vent.ItemStateChangedEvent] - sony_ircc_xxxxxxxxxxxx_primary_command changed from L4 to L5
2019-03-04 18:12:14.548 [ome.event.ItemCommandEvent] - Item 'sony_scalar_xxxxxxxxxxxx_system_sysCmd' received command Left
2019-03-04 18:12:14.549 [nt.ItemStatePredictedEvent] - sony_scalar_xxxxxxxxxxxx_system_sysCmd predicted to become NULL
2019-03-04 18:12:15.878 [ome.event.ItemCommandEvent] - Item 'sony_scalar_xxxxxxxxxxxx_system_sysCmd' received command L1
2019-03-04 18:12:15.880 [nt.ItemStatePredictedEvent] - sony_scalar_xxxxxxxxxxxx_system_sysCmd predicted to become NULL
2019-03-04 18:12:18.161 [ome.event.ItemCommandEvent] - Item 'sony_scalar_xxxxxxxxxxxx_system_sysCmd' received command L2
2019-03-04 18:12:18.163 [nt.ItemStatePredictedEvent] - sony_scalar_xxxxxxxxxxxx_system_sysCmd predicted to become NULL
2019-03-04 18:12:20.110 [ome.event.ItemCommandEvent] - Item 'sony_scalar_xxxxxxxxxxxx_system_sysCmd' received command L3
2019-03-04 18:12:20.115 [nt.ItemStatePredictedEvent] - sony_scalar_xxxxxxxxxxxx_system_sysCmd predicted to become NULL
2019-03-04 18:12:21.323 [ome.event.ItemCommandEvent] - Item 'sony_scalar_xxxxxxxxxxxx_system_sysCmd' received command L4
2019-03-04 18:12:21.325 [nt.ItemStatePredictedEvent] - sony_scalar_xxxxxxxxxxxx_system_sysCmd predicted to become NULL
2019-03-04 18:12:22.502 [ome.event.ItemCommandEvent] - Item 'sony_scalar_xxxxxxxxxxxx_system_sysCmd' received command L5
2019-03-04 18:12:22.505 [nt.ItemStatePredictedEvent] - sony_scalar_xxxxxxxxxxxx_system_sysCmd predicted to become NULL

@anon92890676 - event log doesn’t help in this case. You’ll need to turn debug on for org.openhab.binding.sony and look at the openHAB log - we need to see the command it’s sending. If you want to send the command directly - use “AAAAAgAAAJcAAABNAw==” (you don’t want the ‘ircc:’ part and translate the %3D to equal signs). But looking at this - you should be able to simply send ‘Left’ and it would work - but we need to see what’s happening in the openhab log…

Thank you. For my test I have use this:
Left=Left,L1=CursorLeft,L3=AAAAAgAAAJcAAABNAw==,L5=AAAAAQAAAAEAAAA0Aw==

On openhab I used log:tail and get this. I hope log:tail is the right thing?

The first is for this command: sony_ircc_xxxxxxxxx_primary_command
18:53:37.736 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘sony_ircc_xxxxxxxx_primary_command’ received command Left
18:53:37.738 [INFO ] [arthome.event.ItemStatePredictedEvent] - sony_ircc_xxxxxxxx_primary_command predicted to become Left
18:53:37.744 [ERROR] [nding.sony.internal.ircc.IrccProtocol] - Bad return code from X_SendIRCC: 403 (http reason: Forbidden)
18:53:40.632 [INFO ] [inding.sony.internal.dial.DialHandler] - Attempting connection to DIAL device…
18:53:42.810 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘sony_ircc_xxxxxxxx_primary_command’ received command L1
18:53:42.811 [WARN ] [orm.AbstractFileTransformationService] - Could not transform ‘L1’ with the file ‘ircc-xxxxxxxx.map’ : Target value not found in map for ‘L1’
18:53:42.813 [INFO ] [arthome.event.ItemStatePredictedEvent] - sony_ircc_xxxxxxxx_primary_command predicted to become L1
18:53:42.815 [INFO ] [smarthome.event.ItemStateChangedEvent] - sony_ircc_xxxxxxxx_primary_command changed from Left to L1
18:53:42.818 [ERROR] [nding.sony.internal.ircc.IrccProtocol] - Bad return code from X_SendIRCC: 403 (http reason: Forbidden)
18:53:44.786 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘sony_ircc_xxxxxxxx_primary_command’ received command L3
18:53:44.788 [WARN ] [orm.AbstractFileTransformationService] - Could not transform ‘L3’ with the file ‘ircc-xxxxxxxx.map’ : Target value not found in map for ‘L3’
18:53:44.789 [INFO ] [arthome.event.ItemStatePredictedEvent] - sony_ircc_xxxxxxxx_primary_command predicted to become L3
18:53:44.792 [INFO ] [smarthome.event.ItemStateChangedEvent] - sony_ircc_xxxxxxxx_primary_command changed from L1 to L3
18:53:44.796 [ERROR] [nding.sony.internal.ircc.IrccProtocol] - Bad return code from X_SendIRCC: 403 (http reason: Forbidden)
18:53:47.041 [WARN ] [orm.AbstractFileTransformationService] - Could not transform ‘L5’ with the file ‘ircc-xxxxxxxx.map’ : Target value not found in map for ‘L5’
18:53:47.042 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘sony_ircc_xxxxxxxx_primary_command’ received command L5
18:53:47.046 [INFO ] [arthome.event.ItemStatePredictedEvent] - sony_ircc_xxxxxxxx_primary_command predicted to become L5
18:53:47.047 [INFO ] [smarthome.event.ItemStateChangedEvent] - sony_ircc_xxxxxxxx_primary_command changed from L3 to L5
18:53:47.048 [ERROR] [nding.sony.internal.ircc.IrccProtocol] - Bad return code from X_SendIRCC: 403 (http reason: Forbidden)

The second was this: sony_scalar_5089bf24928c_system_sysCmd
18:53:53.882 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘sony_scalar_xxxxxxxx_system_sysCmd’ received command L5
18:53:53.883 [WARN ] [orm.AbstractFileTransformationService] - Could not transform ‘L5’ with the file ‘scalar-xxxxxxxx.map’ : Target value not found in map for ‘L5’
18:53:53.884 [INFO ] [arthome.event.ItemStatePredictedEvent] - sony_scalar_xxxxxxxx_system_sysCmd predicted to become NULL
18:53:55.302 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘sony_scalar_xxxxxxxx_system_sysCmd’ received command L3
18:53:55.302 [WARN ] [orm.AbstractFileTransformationService] - Could not transform ‘L3’ with the file ‘scalar-xxxxxxxx.map’ : Target value not found in map for ‘L3’
18:53:55.303 [INFO ] [arthome.event.ItemStatePredictedEvent] - sony_scalar_xxxxxxxx_system_sysCmd predicted to become NULL
18:53:56.478 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘sony_scalar_xxxxxxxx_system_sysCmd’ received command L1
18:53:56.479 [INFO ] [arthome.event.ItemStatePredictedEvent] - sony_scalar_xxxxxxxx_system_sysCmd predicted to become NULL
18:53:56.479 [WARN ] [orm.AbstractFileTransformationService] - Could not transform ‘L1’ with the file ‘scalar-xxxxxxxx.map’ : Target value not found in map for ‘L1’
18:53:57.677 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘sony_scalar_xxxxxxxx_system_sysCmd’ received command Left
18:53:57.680 [INFO ] [arthome.event.ItemStatePredictedEvent] - sony_scalar_xxxxxxxx_system_sysCmd predicted to become NULL
18:54:00.508 [INFO ] [y.internal.scalarweb.ScalarWebHandler] - Status: OFFLINE
18:54:00.668 [INFO ] [inding.sony.internal.dial.DialHandler] - Attempting connection to DIAL device…
18:54:10.689 [INFO ] [inding.sony.internal.dial.DialHandler] - Attempting connection to DIAL device…
18:54:20.707 [INFO ] [inding.sony.internal.dial.DialHandler] - Attempting connection to DIAL device…