0विंडोज पीसी के और कोडी को 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 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.

भाग एक: एक पीसी की नींद को नियंत्रित करना

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 आईपी पता (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 साथ पीसी विन्यास करें

  • 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 (नहीं एक यूएसबी वाईफ़ाई कार्ड). 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. पीसी आप नियंत्रित करना चाहते पर घटना भूत स्थापित करें

  • डाउन लोड 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. आप बंदरगाह बदलने के लिए या छोड़ सकते हैं, लेकिन अगर आप को बदलने यह क्या आप इसे करने के लिए बदल का नोट बनाएँ.
  • ओके पर क्लिक करें, 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)
  • ओके पर क्लिक करें, और पुन: ठीक क्लिक करें अगले शीघ्र पर (without choos­ing force close all pro­grams)
  • अब फ़ाइल सहेज. लगभग हम (लेकिन काफी नहीं) fin­ished with it
  • फाइल पर जाएं, विकल्प
  • टिक पहले 2 विकल्प (run on star­tup and min­im­ise to tray) और ठीक क्लिक करें
  • 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”
  • प्रवेश करें आईपी address of the PC you wanted to con­trol (यह एक निश्चित होना चाहिए आईपी)
  • से पोर्ट बदलना 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 []"
  • हम सोने के लिए पीसी जब हम बंद करने के लिए स्विच को चालू रखना चाहते हैं, 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, इसमे केवल कुछ सेकंड्स लगते हैं
  • अगर (मेरे जैसा) आप यूरोपीय संघ में हैं या यूके 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”
  • अपने पीसी खुला पर 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 (उदा.. साल) 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. हमेशा-चालू पीसी पर 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 आईपी 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, the आईपी 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 (अमेरिका या यूरोपीय संघ). 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. अब पीसी के लिए जाने के लिए और यह पूरी तरह से बंद कर देते हैं (यह दीवार पर बंद कर देते हैं). अब, use the switch in the SmartTh­ings App to turn the PC on. बेशक पीसी पर है, क्योंकि यह है दीवार पर बंद नहीं कर सकते. 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.

भाग बी: कोडी को नियंत्रित करना

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 आईडीई में स्मार्ट एप्लिकेशन और डिवाइस हैंडलर स्थापित करें

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. सक्षम करें एचटीटीपी कोडी का नियंत्रण

  • अपने पीसी पर कोडी लोड
  • 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 एचटीटीपी"

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

भाग सी: सॉकेट बंद करने के लिए जब पीसी निष्क्रिय हो जाती है 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”
  • अपनी दिनचर्या को कोई नाम दें
  • दूसरी स्क्रीन में, 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

अपना खुद का कुछ विचारों को समझे? खुद टिप्पणी से नीचे लिप्त! आप सदस्यता के लिए चाहते हैं, तो ऊपर दाईं ओर मेनू पर लिंक का उपयोग करें सदस्यता लें. आप नीचे दिए गए सामाजिक लिंक का उपयोग करके अपने दोस्तों के साथ इस साझा कर सकते हैं. चियर्स.

उत्तर छोड़ दें