I’ve been struggling with this for a while and finally decided to reach out for help. I have an older Sony TV that has to be controlled via IR. This TV has discrete Power On and Off commands, which work correctly with iRule.
Based on the article above, I did more digging and was able to use iLearn to modify the Global Cache commands to work for Powering On and Off. I used those working commands with iConvert to convert them into Hex Codes; which I refer to below as my modified commands.
What I’ve tried via the services section of HA:
I’ve tried sending both the On and Off commands. The emitter lights up but doesn’t actually cause to TV to come on or go off.
I’ve also tried using the node-red-contrib-globalcache node via NodeRed per this thread Problem with itach component and Sony TV with no success. I immediately get an API error in NodeRed.
You have commented out the entire data: key by putting this in front of it: #gc_commands Don’t put comments in front of the data key. Put them at the end. e.g. from my config (scroll all the way right to see the comment)
If you want to record the full 3x repeated code from your remote you could try the Putty method.
open putty and enter the ip of the Itach device (e.g.192.168.1.230)
in the port field enter 4998
select RAW mode
press open or hit the “enter” key
you should get a blank window with a cursor waiting
type get_IRL (IRL must be in capital letters)
you should get IR Learner Enabled
now it is ready for commands. Point the remote at the iTach, press the ON button on your remote and you should get the whole 3x repeated code.
After you get the code you will still have to adjust the first part of the code for the itach ir port
sendir,1:2,1 - port 2 (the middle one)
sendir,1:1,1 - port 1
sendir,1:3,1 - port 3
stop_IRL stops learning mode.
Then copy and paste into iConvert.exe to convert to HEX code.
I did this for my Aircon which has gaps in the IR transmission. Worked perfectly.
I now see your second lot of data: statements per command (the uncommented ones) were there all along.
It’s a lot more obvious now that you have formatted correctly (good job). I missed that in the unformatted version.
After a restart not all commands would work. Different ones each restart. Every three or so restarts all would be well (race condition? IDK). Either way a bit of work has been done on the component and I now run HA hardware that starts a lot quicker and it is no longer an issue for me. But if you ever see behaviour like this you know where to go to report it and I will reopen the issue.
Tonight I purchased two new IP capable (HA supported) AV receivers. I got sick of trying to transcode the new E-AC3 HD/X DTS/ Dolby audio formats.
Bonus is - two less IR controlled devices.
Only my TH-P60ST50A Viera Plasma TV (which TBH I love the picture on) and my projector left. The plasma actually shows up as a media player in HA but no power control. That’s the only control I need! Ugh! I might get lucky with HDMI CEC. The it will be only one.
Yes, putty will capture unusually long codes or codes with long gaps in them. Like Aircon unit codes. iLearn has trouble capturing the full codes in these cases.
I found this thread while researching how to get discrete on and off control of my older Sony Bravia TV (device code 1) through Home Assistant using an iTach IR2IP device. In case anyone else ends up here, this is what ended up working for me: