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

Using smart wifi remote as IR Blaster #579

Open
Matsilagi opened this issue Jan 8, 2025 · 2 comments
Open

Using smart wifi remote as IR Blaster #579

Matsilagi opened this issue Jan 8, 2025 · 2 comments
Labels
tuya_device Support for specific Tuya Devices

Comments

@Matsilagi
Copy link

Its not an issue per-se, but a question more of.
Is it possible to use this app as a IR blaster to send remote codes over to a Tuya device with an IR blaster?
I need to clone a remote which i dont have, but its NEC Hex codes are available on the internet, especifically those.

Is there a way to make a python script which does that? This way i wouldnt need to suffer with IR blasters for android devices (which are 99% of the time, locked behind specific apps, such as ocrustar)

image

@uzlonewolf
Copy link
Collaborator

uzlonewolf commented Jan 8, 2025

It depends. Does that smart WiFi remote remain connected to WiFi? Battery operated devices do not since WiFi uses a lot of power. If it does then the standard IR library should work https://github.com/jasonacox/tinytuya/blob/master/examples/Contrib/IRRemoteControlDevice-example.py

Edit: the relevant parts from the above example:

# discrete on/off codes for LG
hex_lg_on = 0x20DF23DC
hex_lg_off = 0x20DFA35C

# convert the 32-bit integers into a stream of pulses
pulses_lg_on = Contrib.IRRemoteControlDevice.nec_to_pulses( hex_lg_on )

ir = Contrib.IRRemoteControlDevice( 'abcdefghijklmnop123456', '172.28.321.475', '1234567890123abc', persist=True )

print( 'Turning the LG tv off with head/key' )
head, key = Contrib.IRRemoteControlDevice.pulses_to_head_key( pulses_lg_off )
ir.send_key( head, key )

@Matsilagi
Copy link
Author

Yes it does. It's one of those wired ones.
Will give it a shot then

@jasonacox jasonacox added the tuya_device Support for specific Tuya Devices label Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tuya_device Support for specific Tuya Devices
Projects
None yet
Development

No branches or pull requests

3 participants