Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aubess WiFi IR Controller S16 - cannot control SONY TV set #492

Open
bgolab opened this issue May 7, 2024 · 6 comments
Open

Aubess WiFi IR Controller S16 - cannot control SONY TV set #492

bgolab opened this issue May 7, 2024 · 6 comments
Labels
documentation Improvements or additions to documentation tuya_device Support for specific Tuya Devices

Comments

@bgolab
Copy link

bgolab commented May 7, 2024

Hi,
I wonder if you could help me out. The device model S16 is based on Tuya CBU BK7231.

What I did so far but the SONY TV cannot be controlled.

  • I retrieved the Device Log from Tuya cloud while using Tuya Smart App and pressing PWR button on it:
    IR send{"control":"send_ir","head":"010fbb00000000000f001900320064032c0313044c041a03450433046502fa0401035e02e1047e", "key1":"002$000CA900)","type":0,"delay":300}

  • also tested other buttons like VOL+/VOL-

  • I tested different DP ID from 1 to 255 range.

  • I use the following piece of code:
    import tinytuya
    import json
    d = tinytuya.OutletDevice( dev_id='bf778fxxxxx', address='192.168.1.61', local_key='x;Df9Fxxxx', version=3.3)

sony_pwr = { "control": "send_ir", "head": "", "key1": "002$000CA900)", "type": 0, "delay": 300, }

payload = d.generate_payload(tinytuya.CONTROL, {"201": json.dumps(sony_pwr)})

d.send(payload)

I would be grateful for any hint what else I could try.

@bgolab
Copy link
Author

bgolab commented May 7, 2024

teardown

@uzlonewolf
Copy link
Collaborator

uzlonewolf commented May 7, 2024

Have you tried using the IRRemoteControlDevice in Contrib? https://github.com/jasonacox/tinytuya/blob/master/examples/Contrib/IRRemoteControlDevice-example.py

head = '010fbb00000000000f001900320064032c0313044c041a03450433046502fa0401035e02e1047e'
key1 = '002$000CA900'
ir.send_key( head, key1 )

@bgolab
Copy link
Author

bgolab commented May 7, 2024

Tried this without success

import sys
import tinytuya
from tinytuya import Contrib
from time import sleep

tinytuya.set_debug(True)

# SONY Tuya Device Debug Log: IR send{"control":"send_ir","head":"010fbb00000000000f001900320064032c0313044c041a03450433046502fa0401035e02e1047e","key1":"002$000CA900)","type":0,"delay":300}
head = '010fbb00000000000f001900320064032c0313044c041a03450433046502fa0401035e02e1047e'
key1 = '002$000CA900)'

ir = Contrib.IRRemoteControlDevice( 'bf778fxxxx', '192.168.1.61', 'x;Df9FZxxx', persist=True )
ir.send_key( head, key1 )

@uzlonewolf
Copy link
Collaborator

uzlonewolf commented May 7, 2024

Actually, remove a leading zero from key1 and try it again (so, key1 = '02$000CA900'). Depending on what DPS set the device uses the key1 from the debug logs could have an extra 0.

@bgolab
Copy link
Author

bgolab commented May 7, 2024

Yes, this works. Thank you.

Maybe you can share more tips about how to use the Contrib library in the real world - like the latest one (i.e. "remove the leading zero"). I know it may require some detailed knowledge about the difference between what we see in the Device Log and the way the data is encoded in the packet. Also the DP ID is kind of interesting topics (I have noticed that it is discovered somehow within the lib).

I also noticed this lib has some 'learning' capabilities - it kind of brute force approach but it looks like it might be very useful when you have the real Remote available.
Thank you again. The working script is attached below..

import sys
import tinytuya
from tinytuya import Contrib
from time import sleep

# SONY Tuya Device Debug Log: IR send{"control":"send_ir","head":"010fbb00000000000f001900320064032c0313044c041a03450433046502fa0401035e02e1047e","key1":"002$000CA900)","type":0,"delay":300}
head = '010fbb00000000000f001900320064032c0313044c041a03450433046502fa0401035e02e1047e'
key1 = '02$000CA900)'  # leading zero removed

ir = Contrib.IRRemoteControlDevice( 'bf778f99xxxxx', '192.168.1.61', 'x;Dfxxx', persist=True )
ir.send_key( head, key1 )

@jasonacox jasonacox added the tuya_device Support for specific Tuya Devices label May 8, 2024
@jasonacox
Copy link
Owner

Maybe you can share more tips about how to use the Contrib library in the real world

Fair point. I'll capture that.

@jasonacox jasonacox added the documentation Improvements or additions to documentation label May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation tuya_device Support for specific Tuya Devices
Projects
None yet
Development

No branches or pull requests

3 participants