Turning on TCL Roku, change HDMI source, show Blue Iris outdoor camera grid, and power off via Home Assistant. Success!

Joined
May 1, 2019
Messages
1,212
Reaction score
1,579
Location
Reno, NV
For many months since learning that Blue Iris has MQTT options, I've always wanted to have my bedroom TV turn on camera feeds during an outside camera motion but only during the evening because the screen is bigger than my smartphone and would be a pain to find my glasses in the middle of the night. At first, I thought only option was using UI3 on a Raspberry Pi connected to a TCL smart tv. It occured to me that I could run a HDMI cable from my headless Blue Iris Server directly to the bedroom TCL tv.
And now, due to a recent security event...I had to figure out the Home Assistant / Blue Iris / Roku TV integration and automation on the fly.
After 5 hours of tinkering and asking for a "why is this not working" in the Home Assistant reddit, it works!
End result: setting up profiles/schedules in Blue Iris to send a MQTT topic & payload to Home Assistant only from 9pm-6am 7 days a week when motion is detected on outdoor cameras only. Upon recieving the topic & payload, Home Assistant powers on my bedroom Roku TV and changes the source (from Netflix or Spectrum TV) to HDMI2, waits 2 minutes, and then powers the Roku TV back down.
Unsure how I may like this setup. Will it irritate me too often when I am sleeping? What if watching Avengers movie at 10pm and it flips to another source and powers off? Gots more tinkering to do but for now, I feel I am on the right track.
automation1a.jpgautomation1b.jpg
 
Joined
May 1, 2019
Messages
1,212
Reaction score
1,579
Location
Reno, NV
This is a temp setup, I suppose. The issue is that I have to run the main Blue Iris program on the Blue Iris server which hogs up necessary CPU %, but is acceptable for time being. Other issue is since I am using HDMI from Blue Iris server to my TCL Roku TV, it is a pain to remote login onto the Blue Iris server from my main PC to edit camera properties because it logs out of the current user to the remote log in user. After any edits, I have to go to the server itself and with a spare monitor/mouse, re-log back in to get the HDMI to display. I'm no good with Windows user config/do/dont's so this is all magic to me. For now, I guess it's not exactly a headless Blue Iris server since I have a monitor/mouse connected to it. As I said, is a temp solution.
 

fenderman

Staff member
Joined
Mar 9, 2014
Messages
34,419
Reaction score
14,773
This is a temp setup, I suppose. The issue is that I have to run the main Blue Iris program on the Blue Iris server which hogs up necessary CPU %, but is acceptable for time being. Other issue is since I am using HDMI from Blue Iris server to my TCL Roku TV, it is a pain to remote login onto the Blue Iris server from my main PC to edit camera properties because it logs out of the current user to the remote log in user. After any edits, I have to go to the server itself and with a spare monitor/mouse, re-log back in to get the HDMI to display. I'm no good with Windows user config/do/dont's so this is all magic to me. For now, I guess it's not exactly a headless Blue Iris server since I have a monitor/mouse connected to it. As I said, is a temp solution.
You can use something like google remote desktop so it wont log you off.
 
Joined
May 1, 2019
Messages
1,212
Reaction score
1,579
Location
Reno, NV
You can use something like google remote desktop so it wont log you off.
I actually did use google remote desktop for a time. Went back to Windows Remote Desktop when I built the server and it finally worked. But yea, may give that a shot again cause this user log in/log out is an issue.
 

SyconsciousAu

Getting comfortable
Joined
Sep 13, 2015
Messages
751
Reaction score
504
remote desktop
Give Ultra VNC a run. Works well for me, and it's free

when motion is detected on outdoor cameras only
unsure how I may like this setup. Will it irritate me too often when I am sleeping?
Get the AI tool set up. It will almost eliminate false alarms, so it only turns on when you have actual company.

Not sure if you saw the thread


But I can see you with speakers, triggerd by BI and the AI tool, that say "Stupid bitch get away from my car!"
 
Joined
May 1, 2019
Messages
1,212
Reaction score
1,579
Location
Reno, NV
sidenote that I noticed last night
From the start...I put all my Roku TCL smart tv's into "Fast TV start" under System/Power menu (saw that this was necessary for Home Assistant to talk to TV when powered off).
Apparently, the first action of powering on the roku tv creates a conflict or something with the API with Home Assistant as after turning on/off....a 2nd cycle does not turn on.
I tinkered and removed the first action of powering on. Now, the first action is a call service to changing sources. Seems to work 100% (so far).
 
Joined
May 1, 2019
Messages
1,212
Reaction score
1,579
Location
Reno, NV
How does home assistant actually talk to the tv.
Home Assistant come pre-built with a number of integrations for popular devices as seen at their home page: Integrations
From the Roku Developer page on how they integrate with others... "The External Control Protocol (ECP) enables a Roku device to be controlled over a local area network by providing a number of external control services. The Roku devices offering these external control services are discoverable using SSDP (Simple Service Discovery Protocol). ECP is a simple RESTful API that can be accessed by programs in virtually any programming environment." Note, is not cloud based nor do I have to input a API myself. If the device is on your local network, it should find it.

roku integration page.jpg
 
Last edited:

Kameraad

Getting the hang of it
Joined
Oct 23, 2016
Messages
125
Reaction score
86
Other issue is since I am using HDMI from Blue Iris server to my TCL Roku TV, it is a pain to remote login onto the Blue Iris server from my main PC to edit camera properties because it logs out of the current user to the remote log in user. After any edits, I have to go to the server itself and with a spare monitor/mouse, re-log back in to get the HDMI to display.
I have a fix for that logging off stuff, it's pretty easy. Create a .bat file (create a txt file but change the .txt to .bat) and paste in this:
Code:
@echo off
title RDP logoff script
echo logoff in 10 seconds!
pause
cls
echo logging off...
timeout /t 10
for /f "skip=1 tokens=3" %%s in ('query user %USERNAME%') do (%windir%\System32\tscon.exe %%s /dest:console)
This will open a command prompt window in which you have to press a key, After the keypress it's counting down from 10 (you can change the value in the timeout line). After the time is up it will close the rdp connection and will login your user again. The 10 seconds is there so you can set Blue Iris to full screen. My BlueIris machine is on windows 10, i've been using this a long time now and it never failed me.

I'm using a hdmi over cat extender from Gofanco, It has a hdmi out on the tx extender for a local screen (my desk) and the rx side is hooked to my Yamaha AV receiver. I'm also running Home Assistant and when de doorbell rings or the backgate is opened (has a zwave doorsensor) it will switch from TV/Kodi to Blueiris, set Kodi to pause, and back after 30 seconds.
 
Joined
May 1, 2019
Messages
1,212
Reaction score
1,579
Location
Reno, NV
I have a fix for that logging off stuff, it's pretty easy. Create a .bat file (create a txt file but change the .txt to .bat) and paste in this:
Code:
@echo off
title RDP logoff script
echo logoff in 10 seconds!
pause
cls
echo logging off...
timeout /t 10
for /f "skip=1 tokens=3" %%s in ('query user %USERNAME%') do (%windir%\System32\tscon.exe %%s /dest:console)
This will open a command prompt window in which you have to press a key, After the keypress it's counting down from 10 (you can change the value in the timeout line). After the time is up it will close the rdp connection and will login your user again. The 10 seconds is there so you can set Blue Iris to full screen. My BlueIris machine is on windows 10, i've been using this a long time now and it never failed me.

I'm using a hdmi over cat extender from Gofanco, It has a hdmi out on the tx extender for a local screen (my desk) and the rx side is hooked to my Yamaha AV receiver. I'm also running Home Assistant and when de doorbell rings or the backgate is opened (has a zwave doorsensor) it will switch from TV/Kodi to Blueiris, set Kodi to pause, and back after 30 seconds.
I have not dabbled with .bat files since the 286 cpu days and setting my own IRQ's :) will give this a shot, thanks!
Hmm...tried it. Did not work. The window just closes without logging off. Is there suppose to be a password input in that command line?
 
Last edited:

Kameraad

Getting the hang of it
Joined
Oct 23, 2016
Messages
125
Reaction score
86
No, password is not necessary. But i do think the user has to be set to automatically login when the pc is booted. Ben a while since ive set this up, can't rembember all the details..
 

Kameraad

Getting the hang of it
Joined
Oct 23, 2016
Messages
125
Reaction score
86
I tried this on a fresh install today. You'll need to fix the auto login stuff for windows and also run the bat file as admin!
 
Joined
May 1, 2019
Messages
1,212
Reaction score
1,579
Location
Reno, NV
I tried this on a fresh install today. You'll need to fix the auto login stuff for windows and also run the bat file as admin!
this is a temporary situation. I am sure there is a answer out there somewhere. The whole point was to have my outside cameras displayed from the Blue Iris GUI via HDMI to my upstairs TV. I have a 50' HDMI cable running along the floor & stairwell for this to happen.
I ordered a Raspberry Pi 4 which will be a dedicated UI3 machine for this TV. Once that arrives and setup, no need to worry about the windows log in anymore :) But thanks for the suggestions.
 

wittaj

Known around here
Joined
Apr 28, 2019
Messages
4,679
Reaction score
5,974
Location
USA
Did you ever get the Raspberry Pi thing figured out?

Like I have time LOL, but I am looking at more improvements to make.
 
Joined
May 1, 2019
Messages
1,212
Reaction score
1,579
Location
Reno, NV
Did you ever get the Raspberry Pi thing figured out?

Like I have time LOL, but I am looking at more improvements to make.
I did order a RPi4, still sitting in box. However, went the Amazon Firestick route instead. It works :) Can use the RPi4 for something else nifty. Or, if the Amazon Firestick gives me too much headache.
 

wittaj

Known around here
Joined
Apr 28, 2019
Messages
4,679
Reaction score
5,974
Location
USA
LOL - I have a Pi Zero W still in packaging just sitting here begging me to do something with it.
 

jz3082

Young grasshopper
Joined
Dec 13, 2019
Messages
77
Reaction score
22
Location
Oklahoma, US
I have a fix for that logging off stuff, it's pretty easy. Create a .bat file (create a txt file but change the .txt to .bat) and paste in this:
Code:
@echo off
title RDP logoff script
echo logoff in 10 seconds!
pause
cls
echo logging off...
timeout /t 10
for /f "skip=1 tokens=3" %%s in ('query user %USERNAME%') do (%windir%\System32\tscon.exe %%s /dest:console)
This will open a command prompt window in which you have to press a key, After the keypress it's counting down from 10 (you can change the value in the timeout line). After the time is up it will close the rdp connection and will login your user again. The 10 seconds is there so you can set Blue Iris to full screen. My BlueIris machine is on windows 10, i've been using this a long time now and it never failed me.

I'm using a hdmi over cat extender from Gofanco, It has a hdmi out on the tx extender for a local screen (my desk) and the rx side is hooked to my Yamaha AV receiver. I'm also running Home Assistant and when de doorbell rings or the backgate is opened (has a zwave doorsensor) it will switch from TV/Kodi to Blueiris, set Kodi to pause, and back after 30 seconds.
Thanks for the tip. I was disconnecting from the RDP session and then using UltraVNC to get the console logged back in. The PC automatically logs in on a restart. You have to execute the batch with elevated permissions for it to execute. On previous Windows 10 versions you could accomplish this under the advanced properties of the batch file but that is gone. You can run regedit and add runas to the key below. Now when you double click the batch file it will automatically run as administrator saving a right click.

1614378836614.png
 
Top