iRed2 users, UNITE!

Posted on
Mon Jun 15, 2009 3:13 pm
FaTMax offline
Posts: 134
Joined: Feb 01, 2007
Location: Haugesund, Norway

iRed2 users, UNITE!

Hi!

So, I´ve been trying to fully test and use ired to control my tuner and reciever. So far everything has gone bad. I cant find a complete and up to date Applescript library for ired2 and all the scripts im trying to write end up doing nothing. Some work, some dont. That makes me wonder if the ired2 beta is completely useless or if there may be something wrong with the code im using. Anyone else have the same similarities ? Anyone that have a up to date library for the applescript code ?

Now that Indigo ships with Touch Client, I NEED this on controlpages ;-)

Posted on
Tue Jun 16, 2009 11:44 pm
macpro offline
User avatar
Posts: 765
Joined: Dec 29, 2005
Location: Third byte on the right

(No subject)

You should better go back to iRed 1 as that is the supported version. The author has decided to completely rewrite iRed 2.

What problems do you have with iRed?
It needs very little AppleScript code to get it working with Indigo.

Posted on
Sun Nov 08, 2009 6:13 am
FaTMax offline
Posts: 134
Joined: Feb 01, 2007
Location: Haugesund, Norway

(No subject)

So, still I just can´t get this to work!

The Applescript library is not complete, at least thats what I think it is.

Here´s my error log in Script Editor:

Code: Select all
tell application "iRed2"
   send ir Code "TvOff" of Remote "AltIBox"
      --> error number -1728 from Code "TvOff" of Remote "AltIBox"
end tell

Posted on
Sun Nov 08, 2009 4:16 pm
Matt offline
Posts: 406
Joined: Aug 13, 2006
Location: Northern Idaho

(No subject)

I believe iRed 2 has come a long ways since the developper decided to start over - there is even an iPhone app out for use with iRed 2.

iRed 2 has dropped support for Tiger, and I am not sure if it supports Leopard or just Snow Leopard.

I gave up on iRed 2 after a few weeks of trying to get my iPhone programmed and playing with iRed 2s UI.

I seriously don't expect much from the develloper for another year or so as far as iRed 2 usability...

Posted on
Sun Nov 08, 2009 4:26 pm
FaTMax offline
Posts: 134
Joined: Feb 01, 2007
Location: Haugesund, Norway

(No subject)

Yep, theres ALOT missing in the UI that was bumped after the first couple of betas.

No one here know how to write Applescript for it ?

Posted on
Sun Nov 08, 2009 11:54 pm
ricks offline
Posts: 122
Joined: Nov 11, 2006
Location: Reno, NV

(No subject)

I've had the latest beta of iRed2 running successfully for about the last 3-4 months. The only difficulty I've had is the IRTrans dropping off the network on a power reset. It gets a new (DHCP) IP address, and IRed2 refuses to catch it, as it continues to look at the old address. The solution is to assign it a static IP.

Based on previous comments by others, I was a bit worried when I went from iRed to iRed2, but honestly, it's been rock solid. I have applescript/iRed2 both receiving and sending out IR commands. As a precaution, I have Indigo (via Applescript) kill and restart iRed2 every morning at 3 am -- so maybe that is the magic bullet to keep it stable.

Give me a few and I'll post some applescript examples.
Rick

Posted on
Mon Nov 09, 2009 12:03 am
FaTMax offline
Posts: 134
Joined: Feb 01, 2007
Location: Haugesund, Norway

(No subject)

My IRTrans connection has always been stable.

Thanks, I´d really appreciate that!

Posted on
Mon Nov 09, 2009 12:10 am
ricks offline
Posts: 122
Joined: Nov 11, 2006
Location: Reno, NV

(No subject)

Ok, here is how I use a trigger action to fire off an IR event in iRed2.

I have the following as an attachment script:

Code: Select all
-- This script sends commands to iRed
-- See iRed2Indigo script for reverse
using terms from application "IndigoServer"
   
   on RemoteControl(TheDevice, irCode)
      with timeout of 3 seconds
         try
            tell application "iRed2" to perform action Code irCode of Device TheDevice
         on error
            tell application "IndigoServer"
               log "Error - Could not transmit to iRed2 --> Device: " & TheDevice & ", code: " & irCode using type "iRed:"
            end tell
            
         end try
      end timeout
   end RemoteControl
   
end using terms from
Edit: Of course I expect Jay to say that this shouldn't be an attachment as it could cause Indigo to hang if it goes awry. :D

Then, when I want to send an IR signal, I have a trigger with the following applescript:
Code: Select all
RemoteControl("Panasonic/TV", "TV On")


In iRed2, "Panasonic" is the Device Make, "TV" is the Device Name and "TV On" is the name of the IRCodes. Make sure you are in iRed2's Action Editor (from tools menu).
Last edited by ricks on Mon Nov 09, 2009 12:23 am, edited 1 time in total.

Posted on
Mon Nov 09, 2009 12:20 am
ricks offline
Posts: 122
Joined: Nov 11, 2006
Location: Reno, NV

(No subject)

And, of course, if you want Indigo to respond to an IR event just put that AS code into your iRed2 Action, e.g.:

Code: Select all
tell application "IndigoServer"
toggle "family room torch"
end tell


However, I also needed a way to update variables within Indigo based on presses of the remote. I did this with the following script:
Code: Select all
using terms from application "IndigoServer"
   on UpdateVariable(varName, VarValue)
      tell application "IndigoServer"
         if (exists variable varName) then
            set (value of variable varName) to VarValue
            log "iRed2 changed variable " & varName & " to " & VarValue
         else
            log "Error - iRed2 is telling Indigo to change a non-existant variable: " & varName
         end if
      end tell
   end UpdateVariable
end using terms from


An then in the iRed2 Action, I have the following applescript:
Code: Select all
--Load script that actually interfaces with Indigo
tell application "System Events"
   set p to file "Macintosh HD:Library:Application Support:Perceptive Automation:Indigo 4:Scripts:iRed2Indigo.scpt"
end tell
set x to load script p

x's UpdateVariable("HET_DVR_ON", "false")


The first part of the script essentially points to the UpdateVariable script and the last line tells tells the Indigo variable (first parameter) to become the second parameter.

Posted on
Mon Nov 09, 2009 12:28 am
FaTMax offline
Posts: 134
Joined: Feb 01, 2007
Location: Haugesund, Norway

(No subject)

Thanks a lot!!

I'll give this one a run for it's money when I get home from work later today! :-D

EDIT: I see you've put up the try commands, so it probably should work just fine?

Posted on
Mon Nov 09, 2009 12:51 pm
FaTMax offline
Posts: 134
Joined: Feb 01, 2007
Location: Haugesund, Norway

(No subject)

Hm, it really is the strangest thing. I get this in my indigo errorlog:

iRed: Error - Could not transmit to iRed2 --> Device: Motorola/PVR, code: TvOff

Which means that the attachment loads fine, its just iRed2 that can handle the trigger with applescript I´m creating.
Just so I am clear; TheDevice is specified right, as you said. The IRCode is correct and works fine in iRed2.

Is there a problem with ired here ?

Posted on
Mon Nov 09, 2009 8:26 pm
ricks offline
Posts: 122
Joined: Nov 11, 2006
Location: Reno, NV

(No subject)

In iRed2s log, do you see incoming IR signals (with Log incoming IR checked)?

Could your firewall be blocking communications with iRed2? In System Preferences->Security, try the "Allow all incoming connections" option under the firewall tab.

I'd suggest also sending an email to Robert at Tinb software. He has been very responsive to my questions and issues in the past.

Posted on
Tue Nov 10, 2009 12:26 am
FaTMax offline
Posts: 134
Joined: Feb 01, 2007
Location: Haugesund, Norway

(No subject)

I got it! The remite was out og the library for some reason. I added empty triggers for every IR code in iRed and voilà, it worked.

Thanks for the scripts, they work great!

Posted on
Fri Aug 27, 2010 10:37 pm
hamw offline
Posts: 1212
Joined: Mar 31, 2008

Re: iRed2 users, UNITE!

I got an IRTrans and IRed, learned the IR codes from my Sony Tuner remote and they execute from the Action Page in IRed. I created what I think are triggers and turned off the firewall. When I try to send this

command: RemoteControl("Sony/Tuner", "1", "Enter")

the command seems to take, in the sense that Indigo is not throwing an error and the IRTrans light flashes red once.

On the other hand, in iRed, if I click one of the learned IR codes, it sends fine. When I execute the command from the control panel browser display, it does NOT throw an error:

Code: Select all
WebServer           request to execute "_preview_5 WHA Radio Presets" control #28 from 127.0.0.1
Trigger Action      WHA Radio FM Preset Display


However, the tuner does not respond and in iRed's log, there seems to be no action.

Any ideas? Do I need to open a port somewhere?

Posted on
Sun Aug 29, 2010 9:17 pm
ricks offline
Posts: 122
Joined: Nov 11, 2006
Location: Reno, NV

Re: iRed2 users, UNITE!

Hmm, I don't know. If the IRTrans LED is turning red, then it seems that it is trying to send an IR command. So communications to the IRTrans is probably ok. Are you sure that it is sending the command that you think it is? I personally like making simple mistakes like that :o.

Who is online

Users browsing this forum: No registered users and 3 guests

cron