IP control of a Samsung TV

Hmmm, might be.  I'm not quite prepared to spend time coding a solution to it.  
 
I'll have to see if iRule already supports it or not.
 
Last time I looked at that API it's intended for the creation of HTML5 apps running in the TVs sandbox.
Unfortunatly the TV has to be running for that type of app to respond.
 
hmm.
ESP8266 IR blasers are a thing
 
https://www.youtube.com/watch?v=8ku1HAMl4tU
 
necroposting this thread with a related question.
 
Total newb and in my infancy to programming and understanding the Raspberry Pi, python, Linux, etc.
Learning fast.  Great little box.
 
I have the Raspberry pi setup with CEC and can control the TV via the command line.
It also routes my IP cameras and displays them properly.
 
Now.
What type of command can I send from my Omni Pro to the RPi to trigger it send the CEC commands?
 
I'd really like to use an http post (is that the correct terminology?) or something via the network.
ssh in enabled on the RPi.
I don't want to use my last Omni serial port.
I could kludge together an Omni output relay to an RPi GPIO input.
There has to be something more elegant, something more "21st Century"
 
I'm having difficulty finding the right information regarding how to send the command to the RPi to trigger it and execute.
I think I can send an HTTP command from an executed button in Automation Studio (when my touchscreen pops up on the driveway camera), so that is the route I am exploring.
 
Thanks!
 
What type of command can I send from my Omni Pro to the RPi to trigger it send the CEC commands?
 
One possible option would be to use JomniLink on the RPI.  Jomnilink would receive notifications from the OP2 such as button pushes etc.  It would execute the CEC commands based on specific button pushes received.
 
JomniLink is on github at https://github.com/digitaldan/jomnilink
 
Desert_AIP said:
necroposting this thread with a related question.
 
Total newb and in my infancy to programming and understanding the Raspberry Pi, python, Linux, etc.
Learning fast.  Great little box.
 
I have the Raspberry pi setup with CEC and can control the TV via the command line.
It also routes my IP cameras and displays them properly.
 
Now.
What type of command can I send from my Omni Pro to the RPi to trigger it send the CEC commands?
 
I'd really like to use an http post (is that the correct terminology?) or something via the network.
ssh in enabled on the RPi.
I don't want to use my last Omni serial port.
I could kludge together an Omni output relay to an RPi GPIO input.
There has to be something more elegant, something more "21st Century"
 
I'm having difficulty finding the right information regarding how to send the command to the RPi to trigger it and execute.
I think I can send an HTTP command from an executed button in Automation Studio (when my touchscreen pops up on the driveway camera), so that is the route I am exploring.
 
Thanks!
 
I was fiddling around with some Java HTTP server code and maybe something like the following  server code would be of some help to you..
 

import java.io.IOException;
import java.io_OutputStream;
import java.net.InetSocketAddress;

import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
import com.sun.net.httpserver.HttpServer;

public class OmniHttpServer {

    public static void main(String[] args) throws Exception {
        HttpServer server = HttpServer.create(new InetSocketAddress(8080), 0);
        // http://XXX.XXX.XXX.XXX:8080/TV_On
        server.createContext("/TV_On", new TV_OnHandler());
        //  http://XXX.XXX.XXX.XXX:8080/TV_Off
        server.createContext("/TV_Off", new TV_OffHandler());
        server.setExecutor(null); // creates a default executor
        server.start();
    }

    static class TV_OnHandler implements HttpHandler {
        public void handle(HttpExchange t) throws IOException {
            // Place CEC command to turn TV on here    
            String response = "TV Turned On";
            t.sendResponseHeaders(200, response.length());
            OutputStream os = t.getResponseBody();
            os.write(response.getBytes());
            os.close();
        }
    }

    static class TV_OffHandler implements HttpHandler {
        public void handle(HttpExchange t) throws IOException {
            // Place CEC command to turn TV Off here
            String response = "TV Turned Off";
            t.sendResponseHeaders(200, response.length());
            OutputStream os = t.getResponseBody();
            os.write(response.getBytes());
            os.close();
        }
    }
}





The above code can also be executed from a browser.  For example to turn on tv enter http://xxx.xxx.xxx.xxx:8080/TV_On where xxx.xxx.xxx.xxx can be either your local or WAN IP address.  I'm thinking that somehow you can implement this HTTP command into your Automation Studio.  You would also have to add the appropriate CEC commands to the Java code.
 
I use plink.exe which is a command line version of putty to turn on my LGTV using by issuing a CEC command from a Pi.  Not sure if you have a way to run plink with your system (I run it using HomeSeer).
 
Cheers
Al
 
Well, boredom set in and I modified DigitalDan's Jomnilink code to control any CEC enabled TV via a Leviton/HAI console.  The code that I posted on my github repo ONLY turns on a tv from a button push on the console.  In the demo, button 25, (TVOn) will send a command to the RPI which in turn will turn on the TV.  But it's a trivial task to implement additional functionality such as turning off the TV or selecting various channels such as NatGeo, American Heroes Channel etc.  Just check out the Main.java file for examples on how to  implement CEC calls.
 
My CECJomnilinkII github repo link https://github.com/BobS0327/CECJOmniLinkII
 
DigitalDan's link https://github.com/digitaldan/jomnilink
 
Who says you can't bring an old 20th century controller into the 21st century.
 
 
 
I've managed to turn the TV on and off with the RPi via CEC and select the RPi as the active source on HDMI4, but I have been unable to command it to return to HDMI1.
 
Does that Jomilink run in the environment of some other service running, or is it a standalone python script that can be placed anywhere and executed?
 
 
I looked at the Indigo Domotics linked above and it appears to be part of a larger package.  I am flummoxed as to how to use it.
 
Does that Jomilink run in the environment of some other service running, or is it a standalone python script that can be placed anywhere and executed?
 
The JomniLink app is a Java standalone app that can be located and executed from anywhere.  It's not a python script. You'll have to use the Apache Ant build tool to compile the Java code.  Once successfully compiled, you'll have to locate the JomnLinkII jar file and execute the jar file as indicated in the Readme.md file.  The JomniLink app receives notifications from the OP2 controller and processes the button notifications thru  LibCEC
 
 
I looked at the Indigo Domotics linked above and it appears to be part of a larger package.  I am flummoxed as to how to use it.
I'm somewhat confused by  the "Indigo Domotics" term.  Nothing in the two links I posted refer to "Indigo Domotics".  I would suggest you download my CECJomniLink github package.  Find the folder that contains the build.xml file. You must then execute  ANT in that folder.  This will compile all the source code.  If you have a successful compile, you will find a JOmniLinkII jar file in the build/jar folder.  This jar file is executed as follows:
java -jar jOmniLinkII.jar 192.168.1.101 4369 00:01:02:03:04:05:06:07:08:09:0A:0B:OC:0D:0E:0F
The app is very verboose.  So, wait until you see the message indicating the the "Communication thread is running" before activating any buttons.
 
Speaking of somewhat confused...you lost me at Apache Ant. :)
 
Apache Ant is a software tool used to automate software build processes. The build files used as input to Ant are XML files.  The Ant acronym means Another Neat Tool.
 
I do just about all my development work on a Windows machine.  For example, I build the JomniLink app on a Windows box and then copy the jar file over to the RPI for execution.
 
Here's a link explaining how to install Ant on a Windows box http://www.mkyong.com/ant/how-to-install-apache-ant-on-windows/
 
Ant is what you'll need to build JomnLink.
 
I know this is an old thread, but I just found out you can turn on some Samsung TVs via a wall outlet. I can now turn my Samsung on and off with an Insteon outlet as long as the TV was in the on state when you turned it off with the outlet. This works great for me as I use it as a monitor only...now I only need a way to change the volume without using the remote.
 
ellisr63 said:
I know this is an old thread, but I just found out you can turn on some Samsung TVs via a wall outlet. I can now turn my Samsung on and off with an Insteon outlet as long as the TV was in the on state when you turned it off with the outlet. This works great for me as I use it as a monitor only...now I only need a way to change the volume without using the remote.
That's awesome! Thanks and good to know. It must remember it's last state.
 
I have been mentally working up to controlling my Sansung TV from my ISY994i for some time. I got tired of studying code but the Plug-in module would be so much easier and energy saving also.
 
I have been turning it on with the WoL command in ISY994i but never figured out how to turn it off again. Even a combination in case it fails to turn on from the Insteon Plug-in would work.
 
There would be some concern about the power kill switching causing some glitches inside the electronics though.
 
All my other A/V controls are done via ISY994i's Network Resources built in directed at the smart receiver.
 
I also have the isy994i, but I have not ventured to the Network module. I have the Zwave module...can you have both? Do you know if I can control my Yamaha CXA 5100 via the ISY too? I like to have multiple ways to control everything in case any one way fails.
 
Back
Top