0WindowsのPCのとコディにSmartThingsを接続します

私は複数のウィンドウを持っています パソコン コディを実行私の家で. 私は、目的の範囲のためにSmartThingsにそれらを接続したいです. あなたがしたい機能に応じて行うことができ、様々なものがあります.


まず、私は私のを置くことができると思いました パソコン to sleep and wake them up again via a but­ton in SmartTh­ings. 私はこれを達成しています, although the pro­cess is quite a long one to set up. 私は、以下に詳細それよ.

Next I wanted to be able to con­trol Kodi remotely via smartth­ings. This is reas­on­ably straight-for­ward to set up, 再びI詳細どのように以下の

最後に, I wanted to get the status of a PC in SmartTh­ings. This is so that when a PC goes to sleep I can use a routine in smartth­ings to turn off a power adapter with the home cinema amp­li­fi­ers plugged in. I ori­gin­ally looked at doing this with an energy sav­ing “smart” sock­et, but most of these have been dis­con­tin­ued and the reviews of them are mixed at best. Using SmartTh­ings seemed a more reli­able way to achieve the same thing, with the added bene­fit that I can over­ride the beha­viour at any time from the con­veni­ent of my phone.

パートA: PCのスリープを制御します

I fol­lowed the (ない深さで) art­icle on the SmartTh­ings for­um writ­ten by ront­al­ley. This took a bit of time to fig­ure out as many of the things required I hadn’t used before, 私が期待するほどトリッキーではなかったです. I’ll give a more detailed ver­sion below.

Note — you will need the tar­get PC to have a fixed loc­al IP アドレス (usu­ally in the format 192.168.x.x) and you will also need to know the MAC address of the net­work con­nec­tion it uses. If you don’t know how to find these then you’re not really the kind of user this guide is aimed at — you do need a bit of tech­nic­al know­ledge to do this kind of tinker­ing with SmartTh­ings.

1. WOLでPCを設定します

  • Hold the win­dows key and R to open the run menu
  • devmgmt.mscと入力し、Enterキーを押しますを入力
  • Expand ‘net­work adapters’
  • Double click on the net­work adapter yo use to con­nect to your net­work — this will need to be either a wired eth­er­net con­nec­tion or a wire­less card built in (ではありません USB 無線LANカード). In my case this was “Real­tek のPCIe ギガバイト Eth­er­net Con­nec­tion” on 1 PC and “Intel Eth­er­net Con­nec­tion” on anoth­er
  • Click on the “Power Man­age­ment” tab
  • すべてのことを確認してください 3 ボックスがチェックされ, then click OK and close device man­ager

2. あなたがコントロールしたいPC上でイベントGhostをインストールします。

  • ダウン·ロード Event­Ghost
  • Install Event­Ghost on the PC you want to con­trol. The default set­tings are all ok to use. At the end of setup run Event­Ghost
  • Cre­ate a new file (the white file but­ton at the top left) and then use “File, Save As” to save it some­where con­veni­ent (prob­ably in My doc­u­ments)
  • Right Click on “Auto­Start” and select “Add Plu­gin”
  • Scroll to the bot­tom of the list and select “Web­Serv­er” and click OK
  • Change the Event Pre­fix to ST. Do not cre­ate a user­name or pass­word
  • I changed the port as I already had some­thing run­ning on Port 80. あなたは、ポートを変更したり、それを残すことができます, しかし、あなたが変更した場合、それはあなたがそれを変更するものを書き留めておきます.
  • [OK]をクリックします, and then when the Win­dows Fire­wall prompt appears, [許可]をクリックします.
  • Click Can­cel to reject the offer to add the “Con­fig­ur­a­tion Tree” actions
  • Right click on “Auto­Start” again, this time select “Cre­ate Macro”
  • Expand “sys­tem” and then “power man­age­ment”
  • Select “Stand By” (or “Hibern­ate Com­puter” if that is what you prefer your PC to do)
  • [OK]をクリックします, そして次のプロンプトでもう一度[OK]をクリックします (without choos­ing force close all pro­grams)
  • 今すぐファイルを保存し直し. 私たちは、ほぼます (なく、かなり) fin­ished with it
  • ファイルに移動します, オプション
  • 最初のダニ 2 オプション (run on star­tup and min­im­ise to tray) し、[OK]をクリックします。
  • Leave Event­Ghost for now and go on to the next stage.

3. Install the Custom SmartThings Smart App “Send Events to EventGhost” in the SmartThings IDE

  • Login to the SmartTh­ings IDE アメリカ合衆国 若しくは 米国 & 英国
  • Click on “My SmartApps”
  • Click on the green but­ton “+ New SmartApp”
  • Click on “From Code”
  • 新しいブラウザタブを開いて、に行きます Git­Hub code for Send-Events-to-Event­Ghost
  • Click on the “Raw” but­ton to view the raw code
  • Copy and paste the code into the SmartApp cre­ation form on the oth­er tab you still have open
  • Click “Cre­ate”
  • Then Click “Save”, and finally “Pub­lish”.

4. SmartThings IDEでの仮想スイッチを作成します。

  • Still in the SmartTh­ings IDE (from the pre­vi­ous step) click on “My Devices”
  • Click the Green “+ New Device”
  • Give your device a sens­ible name and label — I used the same for each — using the name and loc­a­tion for the PC I wanted to con­trol
  • Change the type to “Vir­tu­al Switch”
  • Give your device a unique net­work name — I used the format “vs-###” where ### was the com­puter name
  • Select your Home loc­a­tion for Loc­a­tion and select your SmartTh­ings Hub (私たちのほとんどは、唯一持っています 1) that you want to con­trol the switch from for the Hub
  • Make sure ver­sion is set to pub­lished
  • Leave group and zig­bee ID blank
  • Click “Cre­ate”

5. Set the switch to send the “off” signal to event ghost via the Smart App

  • Open the SmartTh­ings app on your mobile device
  • Go to Auto­ma­tion and click on “+ Add a SmartApp”
  • Scroll down to “My Apps” at the bot­tom of the list
  • Select “Send Events to Event­Ghost”
  • を入力 IP address of the PC you wanted to con­trol (それが固定している必要があります IP)
  • からポートを変更 80 if you changed the port in the Event­Ghost web­serv­er cre­ation earli­er, oth­er­wise leave it at 80
  • Click on the “Switches” option and select the name of the vir­tu­al switch you cre­ated and then press “Done”
  • Click “Save” and you should see “Suc­cess­fully added…” shown in green
  • Switch back to “My Home” in the SmartTh­ings app and toggle the switch that you cre­ated on and off
  • Go back to the PC you wish to con­trol and look at the “log” on the left hand side of “Event­Ghost”. You should see a couple of entries that show your switch toggle activ­ity in SmartTh­ings — mine were lis­ted as “ST.ST.CompName.switch.off []” and “ST.ST.CompName.switch.on []」
  • 我々はオフにスイッチを切り替えたときにスリープ状態にPCを置きたいです, so we need the entry “ST.ST.CompName.switch.off []」
  • Drag and drop the “ST.ST.CompName.switch.off []” from the log onto the “Stand By” entry in the main pan­el
  • Save the Event­Ghost file again
  • Now try the but­ton in SmartTh­ings on your mobile device. When you toggle the switch to “off” the PC should go to sleep! You’ve com­pleted the first part of the oper­a­tion. 残りはここから簡単になります.

6. あなたのSmartThingsのセットアップwebCoRE

  • 私が上でこれをベースとしています offi­cial guide which is well worth look­ing at if you have any prob­lems
  • You will need a Git­Hub account (フリー) まだお持ちでない場合はそう、その後に頭の上 Git­Hub and cre­ate one, それはほんの数秒かかります
  • もし (私のような) あなたがEU内にありますか、 英国 then yo uneed to activ­ate Git­Hub integ­ra­tion for your SmartTh­ings IDE.
    に行きます このリンク and fol­low the instruc­tions to link your Git­Hub account to SmartTh­ings
  • あなたが完了したら (あるいはそれがすでにセットアップされた場合) log into the SmartTh­ings IDE アメリカ合衆国 若しくは 米国 & 英国
  • Click on “My SmartApps”
  • Click on “Set­tings” and then click on “Add new repos­it­ory” in the win­dow that appears
  • Use the fol­low­ing details for the repos­it­ory: Own­er= ady624; Name= web­CoRE; Branch= mas­ter
  • Click “save”
  • Next click the but­ton “Update from Repo” and select “web­CoRE (mas­ter)」
  • Tick ONLY the “web­CoRE” option (not the oth­er 3 オプション), and tick the “pub­lish” but­ton and click “Execute Update”
  • Click on “Update from Repo” again, and select “web­CoRE (mas­ter)” again
  • Tick the remain­ing 3, tick “pub­lish” again, and click “Execute Update” again
  • Click on the “edit prop­er­ties” but­ton (の右側 2 but­tons) next to the web­CoRE smart app in the list
  • Scroll down and click on “OAu­th” to expand the OAu­th options
  • Click on “Enable OAu­th in Smart App” and then click “Update”
  • Now go to the SmartTh­ings app on your mobile device
  • Click on “Mar­ket­Place” at the bot­tom and then select “Smart Apps” at the top
  • Scroll down to “My Apps” and select “web­CoRE” (not the dash­board, stor­age or pis­ton)
  • Fol­low the setup wiz­ard, includ­ing choos­ing a pass­word
  • Give web­CoRE access to the vir­tu­al switch you cre­ated earli­er when you get to the devices to con­trol choices.
    You can also select any oth­er devices you might want to con­trol web web­CoRE
  • Now click on the “Auto­ma­tion” tab in the SmartTh­ings App
  • Scroll down until you find web­CoRE and click on “Dash­board”
  • Enter the pass­word you cre­ated in the web­CoRE setup
  • To make web­CoRE easi­er to use we are going to access it via the browser on your PC…
  • In the auto­ma­tion tab click on web­CoRE again, but this time select “Register a browser”
  • お使いのPCのオープンで dashboard.webcore.co and enter the code shown on your SmartTh­ings App
  • Now you have web­CoRE set up we can use it to send a WOL sig­nal

7. Create a webCoRE piston to send a WOL signal when the switch it toggled to “on”

  • In the web­CoRE Dash­board, 左側にあります, click on “+ New Pis­ton”
  • Select “Cre­ate a blank pis­ton”
  • あなたの著者の名前を設定します。, and give the pis­ton a sens­ible name (例えば. SAL) and click “Cre­ate”
  • In the code view win­dow click on “+ add a new state­ment”
  • Click on “Add an if” and select “Add a Con­di­tion”
  • Change “what to com­pare” to “phys­ic­al device” and then change “noth­ing selec­ted” to the name of the vir­tu­al switch you cre­ated earli­er. Change the final box to “switch”
  • Leave the next box set to “any inter­ac­tion”
  • Set the box “what kind of com­par­is­on” to “changes to” and set the value to “on”
  • Click the “add” but­ton. あなたは、コードの少しが追加されましたが表示されます.
  • 次, click on the sec­tion of code that says “then” and click on “Add an action”
  • Leave the “devices” box set to “loc­a­tion” and click “add a task”
  • in the “Do” list, scroll down and select the “Wake a LAN device” option
  • In the “value” field enter the MAC address of the PC you want to con­trol. フォーマットxxを使用します:XX:XX:XX:XX:XX:XX:XX
  • Click the “Add” but­ton
  • Now click the “Save” but­ton at the top right of the web­CoRE Dash­board to save your code
  • You should now be able to use the switch in your SmartTh­ings app to wake your PC from sleep mode as well as put­ting it to sleep. We finally have the basic func­tion­al­ity we wanted! Try put­ting the PC to sleep and wak­ing it up with the switch. 待つ 20+ seconds between each oper­a­tion to give the PC chance to respond or the but­ton can get out of sync with the real state of the PC. We’ll do some more work next to keep the but­ton always in sync with the status of the PC.

8. 常時オンのPCにインストールしHostPinger

  • To keep the switch always in sync with the real con­di­tion of the PC we ‘ping’ the PC from anoth­er device which needs to be always on. I have a serv­er which I have used for this pur­pose, but you could use a Rasp­berry Pi. This guide will focus on using a Win­dows PC, しかし、あなたは使用することができます guide by the STHost­Pinger app author to do this with oth­er devices.
  • Down­load STHostPinger.exe from Git­Hub (EXE V2.zip) and extract it to a con­veni­ent loc­a­tion on the “always on” PC
  • Modi­fy the config.config file that comes with STHostPinger.exe to include the IP address of the PC that your vir­tu­al switch con­trols
  • Change the check inter­val if you wish — I changed mine to 10 のデフォルトからの秒 30
  • Keep the con­fig file open as we need 3 more set­tings for it once we have set up the smartapp
  • Login to the SmartTh­ings IDE アメリカ合衆国 若しくは 米国 & 英国 and click on “My SmartApps”
  • Click on “Set­tings” and then click on “Add new repos­it­ory” in the win­dow that appears
  • Use the fol­low­ing details for the repos­it­ory: Own­er= jebbett; Name= STHost­Pinger; Branch= mas­ter
  • Click “save”
  • Next click the but­ton “Update from Repo” and select “STHost­Pinger (mas­ter)」
  • 唯一のオプションをチェック, and tick the “pub­lish” but­ton and click “Execute Update”
  • Click on the “edit prop­er­ties” but­ton (の右側 2 but­tons) next to the STHost­Pinger smart app in the list
  • Scroll down and click on “OAu­th” to expand the OAu­th options
  • Click on “Enable OAu­th in Smart App” and then click “Update”
  • Now click on “My Device Hand­lers”
  • Next click the but­ton “Update from Repo” and select “STHost­Pinger (mas­ter)」
  • 唯一のオプションをチェック, and tick the “pub­lish” but­ton and click “Execute Update”
  • Go to the SmartTh­ings app on your mobile device
  • Click on Auto­ma­tion at the bot­tom right, and then scroll down and select “Add a SmartApp”
  • Scroll down and choose “My Apps”
  • Choose Host­Pinger, enter the name of the PC you want to mon­it­or, ザ· IP address of the PC you want to mon­it­or,
    change the “Turn this device on/off with status” and select the vir­tu­al switch you cre­ated earli­er. 遅延のために私は私はデフォルトを変更するために必要なことがわかりました 30 秒は、再起動を避けるために パソコン スリープ状態に直進. Once set click “Save”
  • Open the Host­Pinger smartapp from the auto­ma­tion menu, scroll down and turn on debug log­ging and click Save to close the smartapp
  • Switch back to the SmartTh­ings IDE and select the “live log­ging” menu
  • Reopen the Host­Pinger smartapp on your mobile device
  • Switch back to the IDE and you should see that sev­er­al events have appeared in the live log. These will include some inform­a­tion called “AppId”, “access­Token” and the IDE entity (米国やEU). You need this inform­a­tion
  • In the config.config file that you were edit­ing earli­er you need to enter the 3 bits of inform­a­tion from the live log. The IDE entity will look some­thing like this: “https://graph-eu01-euwest1.api.smartthings.com”. The oth­er 2 エントリーフォームXXXXXXXXXXXX-XXXXXXXX-XXXXXXXXXXXXになります
  • あなたのconfig.configファイルにこれらのエントリをコピーし、それを保存. Now run the STHostPinger.exe and you should see a com­mand prompt style win­dow. It should dis­play the status of the PC you want to mon­it­or as either online or off­line, and hope­fully this will match what the PC is actu­ally doing.
  • Your vir­tu­al switch should now accur­ately show the status of your PC, no mat­ter how it was switched on or off. You can test this by turn­ing the PC and mak­ing sure it shows as “on” on the switch in the SmartTh­ings App. 今すぐPCに移動して、完全にオフにそれを回します (壁でそれをオフにします). 今, use the switch in the SmartTh­ings App to turn the PC on. それがあるので、もちろんPCは壁にオン・オフすることはできません. The switch should say “turn­ing on” for 10–15 seconds, and after­wards should go back to say­ing “off”. If this works the pinger ser­vice has turned the but­ton back to off cor­rectly.

PART B: コディの制御

I tried a couple of dif­fer­ent Smart Apps for SmartTh­ings, but found one was easi­er to set up and did what I needed. 再び, I fol­lowed a guide on the SmartTh­ings for­um, this time writ­ten by the author of the smartapp called “Kodi for SmartTh­ings Beta」.

1. SmartThings IDEでスマートアプリとデバイスハンドラをインストールします。

Use the same prin­ciples as for the first stage, add the cus­tom smart app and device hand­ler and then con­fig­ure.

  • Login to the SmartTh­ings IDE アメリカ合衆国 若しくは 米国 & 英国 and click on “My SmartApps”
  • Click on “Set­tings” and then click on “Add new repos­it­ory” in the win­dow that appears
  • Use the fol­low­ing details for the repos­it­ory: Own­er= iamcanadian2222; 名前= ST-コディ; Branch= mas­ter
  • Click “save”
  • Next click the but­ton “Update from Repo” and select “ST-Kodi (mas­ter)」
  • 唯一のオプションをチェック, and tick the “pub­lish” but­ton and click “Execute Update”
  • Now click on “My Device Hand­lers”
  • Next click the but­ton “Update from Repo” and select “ST-Kodi (mas­ter)」
  • 唯一のオプションをチェック, and tick the “pub­lish” but­ton and click “Execute Update”

2. 有効にする HTTP コディの制御

  • お使いのPC上のコディのロード
  • Open Sys­tem settngs
  • Nav­ig­ate to the “Ser­vices” option
  • UPnPの タブ, turn on “Allow remote con­trol via UPnp”
  • In the “Web serv­er” tab, turn on “Allow remote con­trol via HTTP

3. SmartThingsアプリ経由smartappを設定

  • Open the SmartTh­ings App on your mobile device
  • Click on SmartApps at the bot­tom right
  • Scroll down to the bot­tom to “My Apps”
  • Select “Kodi (以前はXBMC)」
  • The auto­mat­ic setup should find your Kodi box, それがあるとき, それを選択し、[完了]をクリックします
  • Click “Done” a second time to fin­ish the setup
  • A device will appear in “My Home”, それは、コディ・マシンが何をしているかを示す必要があります. Click on it to get a set of media con­trols

PART C: PCがスリープ状態になったときにソケットをオフにするSmartThingsルーチンを使用して

上記たら、 2 guides were com­plete it was very easy to cre­ate a SmartTh­ings routine to mon­it­or the status of the PC and turn off sock­ets when it is off, and turn on sock­ets when it is on.

1. SmartThingsルーチンを作成します。

  • Open the SmartTh­ings app on your mobile device
  • Click on the “auto­ma­tion” tab at the bot­tom and then select the “Routines” tab at the top
  • Click “Add a routine”
  • あなたのルーチンの名前を付けます
  • 2番目の画面で, select the “turn off these lights or switches” and set the smart­plug you want to turn off
  • Next click on “Auto­mat­ic­ally per­form…” and then select “Some­thing turns on or off”
  • In the next menu click on “Which?” and select the vir­tu­al switch you cre­ated for your PC. Change “On” to “Off”
    for the “Turns” option, [保存]をクリックします, 再度[保存]をクリックします. You should now see your routine lis­ted
  • Cre­ate a second routine to turn the smart­plug back on when the vir­tu­al switch is turned on

私たちが何かを逃したと思います? 私たちは以下のコメントで教えてください. あなたが購読したい場合は、右上のメニューで購読リンクをご利用ください. また、下記の社会的なリンクを使用してお友達とこれを共有することができます. 乾杯.

返信を残します