HomeGenie Forum

Automation Program Plugins and Wizard Scripting => APP Contributions => Topic started by: mvdarend on December 10, 2014, 07:30:10 PM

Title: Philips TV remote
Post by: mvdarend on December 10, 2014, 07:30:10 PM
Here is a start for a remote for Philips TV's. I haven't created a GUI for this yet, but you could automate a few things with what there is so far.

- Mute TV when phone/doorbell rings.
- Automatically change channel when your favorite show starts etc.

Here are some example commands:
Code: [Select]
var PhilipsTV = Modules.WithName("PhilipsTV").Get();

// Channel UP
PhilipsTV.Command("Control.ChannelUp").Set();
Pause(5);

// Go to Channel 14
PhilipsTV.Command("Control.Digit").Set("1");
PhilipsTV.Command("Control.Digit").Set("4");
Pause(3);

// Set volume level to 20
PhilipsTV.Command("Control.VolumeLevel").Set("20");
Pause(3);

// Turn Mute on and then Off
PhilipsTV.Command("Control.Mute").Set("true");
Pause(3);
PhilipsTV.Command("Control.Mute").Set("false");

Edit: I've tested it on a 2012 Philips TV, unfortunately it does not support 'waking up' of the TV, but I understand that newer TV's have some sort of WOL function.

Update 13-12-2014 GUI is now complete.
Title: Re: Philips TV remote
Post by: mvdarend on December 12, 2014, 07:37:33 PM
I've update the hgx file slightly to add a widget, and also added the html and json files for the widget itself. (these need to be placed in a folder called philipstv in the /html/pages/control/widgets/ folder)

But, it's not showing in the HomeGenie as I'd like. The Dashboard display is 'empty., but it's clickable and the control widget shows up OK. What am I doing wrong?
Title: Re: Philips TV remote
Post by: Gene on December 12, 2014, 08:14:05 PM
try changing the first line of the html file like this:

Code: [Select]
<div data-ui-field="widget" class="ui-overlay-shadow ui-corner-all ui-body-inherit hg-widget-a">

also change the close tag (that was a </a>) to </div>.
Try to follow standard templates as shown here:

http://codepen.io/genielabs/public/ (http://codepen.io/genielabs/public/)

btw this is cool =) once you get it working I will include it in next hg release.

g.
Title: Re: Philips TV remote
Post by: mvdarend on December 13, 2014, 07:56:04 AM
Thanks for the help Gene, I'm almost finished. But the kids are watching TV right now so I can't do the last tets... :-\ I'll try later in the day
Title: Re: Philips TV remote
Post by: mvdarend on December 13, 2014, 09:48:40 AM
I've Updated the files, the User interface is now showing properly. The remote has only the most basic of functions, but it's fairly easy to modify it if you want.

I've also made it so that the most used controls can be triggered by their own function, but also with a 'CustomKey' function. eg:

- Control.VolumeUp
- Control.VolumeDown
- Control.ChannelUp
- Control.ChannelDown
- Control.ToggleStandby

Can also be access with Control.CustomKey (KeyValue)

eg. Control.CustomKey("ChannelStepUp"), Control.CustomKey("VolumeDown"), Control.CustomKey("Standby") etc.

Here is a full list of 'CustomKey' commands for my model TV, to see a full list for your own TV go to the follwing address:
http://192.168.x.x:1925/1/doc/API-Method-input-key-POST.html (http://192.168.x.x:1925/1/doc/API-Method-input-key-POST.html)
Code: [Select]
Standby
Back
Find
RedColour
GreenColour
YellowColour
BlueColour
Home
VolumeUp
VolumeDown
Mute
Options
Dot
Digit0
Digit1
Digit2
Digit3
Digit4
Digit5
Digit6
Digit7
Digit8
Digit9
Info
CursorUp
CursorDown
CursorLeft
CursorRight
Confirm
Next
Previous
Adjust
WatchTV
Viewmode
Teletext
Subtitle
ChannelStepUp
ChannelStepDown
Source
AmbilightOnOff
PlayPause
Pause
FastForward
Stop
Rewind
Record
Online

Any feedback or ideas for improvement would be greatly appreciated.
Title: Re: Philips TV remote
Post by: mvdarend on December 13, 2014, 10:50:05 AM
For those that downloaded the .zip file, there was an error in the version I uploaded. The current version should work though.
Title: Re: Philips TV remote
Post by: Bitcraze on August 31, 2015, 04:47:51 PM
Hi, mvdarend

Will your script work with my Series-5 Samsung TV? Really keen on testing.
Title: Re: Philips TV remote
Post by: mvdarend on August 31, 2015, 04:51:15 PM
Will your script work with my Series-5 Samsung TV? Really keen on testing.


No, Samsung has their own API. It's well documented though if you want to try yourself:
http://developer.samsung.com/web-api (http://developer.samsung.com/web-api)