Dune mediaplayer script vanuit HSTouch

Forum over Homeseer scripts (DUTCH forum)

Moderators: TANE, Ruud

Post Reply
Zefram
Starting Member
Starting Member
Posts: 17
Joined: Mon Sep 24, 2012 10:10 pm

Dune mediaplayer script vanuit HSTouch

Post by Zefram »

I am making use of the ipad interface made by r-255 domoticaforum.eu/viewtopic.php?f=46& ... 827#p51747. I want to use the PS3 screen to controle my Dune mediaplayer, by using IR HEX codes. My programming skills are very low, so by trail and error (copy) I made a script. Pressing a button on the ipad screen turns the player on and off.

Code: Select all

Sub Main(ByVal strDuneCmd As String) 
Dim strReturn, strWebsite As String 
Dim strDune As String 

strDune = "BC43BF00"
 
strWebsite = "http://192.168.1.12/cgi-bin/do?cmd=ir_code&ir_code=" & strDune 
strReturn = hs.URLAction(strWebsite, "GET", "", "") 
End Sub
So far so good, there are about 50 codes for the player, and I don't think 50 scripts is an option.
I tried the script part below, but I don't get around the param part.

Code: Select all

 
    Dim action
    Dim cmd	


    action = param(0).ToString 'button to take action on

	Select Case action 
        	Case "dunepower" 
          		cmd = "BC43BF00" 
       		Case "1191"
			cmd = "E718BF00" 


	End Select 
So my question is how to link the buttons on the screen to the codes and make a select in the script.
Does any one have a lookalike script or can give me hints?

dune-hd.nl/eng/support/additional_featu ... ntrol.html
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

Re: Dune mediaplayer script vanuit HSTouch

Post by Digit »

I have a HDI Dune HD Max and do essentially the same to control my Dune and as far as I can see the first script looks OK.
The 2nd one is half finished, you'll need Sub main(Byval param as String) or something like that.
I'm probably mixing up some things here, but maybe it can help you to find the right syntax.
Chiel
Member
Member
Posts: 71
Joined: Mon Nov 17, 2008 11:57 pm
Location: Netherlands

Re: Dune mediaplayer script vanuit HSTouch

Post by Chiel »

I use &HS.GetUrl.

Run a Homeseer script with values from elements
In the script line i put something like this;
&hs.GetUrl("http://10.0.0.8/cgi-bin/do?cmd=ir_code& ... "",True,80)
This one is "PLAY"

No seperate scripts, just one line.
Easy.
Attachments
Dune.jpg
Dune.jpg (133.49 KiB) Viewed 8602 times
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

Re: Dune mediaplayer script vanuit HSTouch

Post by Digit »

I can understand what Zefram is trying to do: keeping device specific stuff in a single script.
Cause that's his goal, a single script for the Dune.
And I think that's a good thing to do; if he buys another brand media player he will only have to modify that single script instead of all the buttons.
Or consider the situation where the IP address of the Dune has to be changed; in that case he'll be very happy with his single script and job done in 10 seconds.
Zefram
Starting Member
Starting Member
Posts: 17
Joined: Mon Sep 24, 2012 10:10 pm

Re: Dune mediaplayer script vanuit HSTouch

Post by Zefram »

Chiel thank you for your input, I tested some buttons and it runs fine.
But like in Digit's reply you can see the advantage of one script.(to rule them all ;-))
For me it is a challenge to learn more about VB-scripts.
So if there is input for the script I am all ears.
Chiel thank you for sharing and a nice Dune button by the way.
Chiel
Member
Member
Posts: 71
Joined: Mon Nov 17, 2008 11:57 pm
Location: Netherlands

Re: Dune mediaplayer script vanuit HSTouch

Post by Chiel »

Ah, like that.
Does he needs all possible command in a list then? (under case action)
r_255
Advanced Member
Advanced Member
Posts: 621
Joined: Wed Jun 11, 2008 9:39 pm
Location: Netherlands

Re: Dune mediaplayer script vanuit HSTouch

Post by r_255 »

Is there any feedback on the command from the dune ?
else the serial/ip plugin could be a option to...

The nice thing of this plugin is it can do a event on feedback.


But isnt the dune DLNA compatible...? in that case i would try the dlna plugin at the hs forum as that supports the music api from homeseer.
Zefram
Starting Member
Starting Member
Posts: 17
Joined: Mon Sep 24, 2012 10:10 pm

Re: Dune mediaplayer script vanuit HSTouch

Post by Zefram »

If you fire this URL in your browser
1.1.1.1/cgi-bin/do?cmd=ir_code&ir_code=BC43BF00
You get this

Code: Select all

<command_result>
<param name="protocol_version" value="3"/>
<param name="command_status" value="ok"/>
<param name="player_state" value="navigator"/>
</command_result>
The script I "made" works perfect for one button, but inserting a select has failed.
See below for example.
forums.homeseer.com/showpost.php?p=1019 ... stcount=19
DrDoo
Member
Member
Posts: 103
Joined: Tue Sep 29, 2009 5:18 pm
Location: Netherlands

Re: Dune mediaplayer script vanuit HSTouch

Post by DrDoo »

Not sure if you wanna go this route but take a look at my post here : http://domoticaforum.eu/viewtopic.php?f ... 7&start=15

I posted a script for XBMC there. You can then call the different functions (play/stop etc etc). Its all in one script.
You could probably change it for the Dune.
Post Reply

Return to “Homeseer Scripts Forum”