more G-Labs products

Author Topic: Philips TV remote  (Read 3941 times)

December 10, 2014, 07:30:10 PM
Read 3941 times

mvdarend

  • *****
  • Information
  • Hero Member
  • Posts: 431
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.
« Last Edit: December 13, 2014, 10:49:29 AM by mvdarend »

December 12, 2014, 07:37:33 PM
Reply #1

mvdarend

  • *****
  • Information
  • Hero Member
  • Posts: 431
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?
« Last Edit: December 12, 2014, 07:41:23 PM by mvdarend »

December 12, 2014, 08:14:05 PM
Reply #2

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
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/

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

g.

December 13, 2014, 07:56:04 AM
Reply #3

mvdarend

  • *****
  • Information
  • Hero Member
  • Posts: 431
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

December 13, 2014, 09:48:40 AM
Reply #4

mvdarend

  • *****
  • Information
  • Hero Member
  • Posts: 431
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
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.

December 13, 2014, 10:50:05 AM
Reply #5

mvdarend

  • *****
  • Information
  • Hero Member
  • Posts: 431
For those that downloaded the .zip file, there was an error in the version I uploaded. The current version should work though.

August 31, 2015, 04:47:51 PM
Reply #6

Bitcraze

  • ***
  • Information
  • Full Member
  • Posts: 73
Hi, mvdarend

Will your script work with my Series-5 Samsung TV? Really keen on testing.

August 31, 2015, 04:51:15 PM
Reply #7

mvdarend

  • *****
  • Information
  • Hero Member
  • Posts: 431
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