Home Automation

Discussion in 'MediaPortal 1 Talk' started by vuego, July 31, 2011.

  1. vuego
    • Team MediaPortal

    vuego Documentation Group

    Joined:
    August 5, 2006
    Messages:
    1,568
    Likes Received:
    658
    Occupation:
    Alchemist, Astrobiologist, Exotic dancer
    Location:
    Göteborg
    Ratings:
    +865 / 0
    Home Country:
    Sweden Sweden
    Show System Specs
    How to get MediaPortal to control your lights, ceiling fans, curtains and other equipment, such as when you start, pause or end a movie, or when you receive a phone call.

    This guide is written in the MediaPortal Wiki which means that any user is free to add updates and other guides. However this forum thread is better suited if you wish to discuss settings or ask for support. So please read the guide and return here if you have any questions :)


     
    • Like Like x 5
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. GetWell

    GetWell Portal Pro

    Joined:
    October 4, 2006
    Messages:
    205
    Likes Received:
    32
    Gender:
    Male
    Ratings:
    +32 / 0
    Home Country:
    Denmark Denmark
    Really nice guide! Can't wait to read more about later!

    Do you know which protocol it uses? I have been looking on the z-wave technology, but at the moment the products supporting z-wave are not that great and really expensive (of what I have found).
    What are the approximately cost for a start-kit ?
     
  4. vuego
    • Team MediaPortal

    vuego Documentation Group

    Joined:
    August 5, 2006
    Messages:
    1,568
    Likes Received:
    658
    Occupation:
    Alchemist, Astrobiologist, Exotic dancer
    Location:
    Göteborg
    Ratings:
    +865 / 0
    Home Country:
    Sweden Sweden
    Show System Specs
    Glad you liked it!

    TellStick uses several different protocols depending on the device you set up. Many protocols are supported, however not all so be sure to check the list of compatible remote socket receivers.

    [​IMG]

    I have not tried Z-Wave products. They seem to have lots of interesting products but I don't think they have the same level of application support as TellStick. At least I couldn't find any MediaPortal or EventGhost plugins ;)

    Here's an example of cheap remote socket receivers (~€20 for three in Sweden).
    A TellStick device is ~€50.
     
  5. cane
    • Premium Supporter

    cane MP Donator

    Joined:
    October 20, 2007
    Messages:
    129
    Likes Received:
    24
    Location:
    Zagreb
    Ratings:
    +26 / 0
    Home Country:
    Croatia Croatia
    Show System Specs
    Thank you for writing such nice guide. I've been looking into getting Tellstick device and playing with it, it on my list of thing that I'd like to have.
    In your guide in last step you are referring to temperature reading, I've made small plugin that reads temperature from USB TEMPer device. To get temperature from that device is not a big problem. Sadly that version is not sold anymore, it's replaced with new one that doesn't use usb to serial port drivers.
    I tried to setup android phone and mediaportal as described in your guide. I got it working but I've got one problem. If my phone is locked when it rings the wifi is not quickly enough turned on and it can't send message to htpc. If I have it unlocked and wifi is turned on when it rings it sends message ok. Do you know how to maye postpone the sending of message in eventghost for android for 1 second or so; or is there a way to have phone connected to my wifi all the time?

    I found solution for wifi issue, on phone should be Settings -> Wirelsss & networks -> Wi-Fi settings -> Advanced -> Wi-Fi sleep policy -> Never.
    Now I see message for incoming call in mp, but when video is played the message appears just for a split second and disappears.
     
  6. vuego
    • Team MediaPortal

    vuego Documentation Group

    Joined:
    August 5, 2006
    Messages:
    1,568
    Likes Received:
    658
    Occupation:
    Alchemist, Astrobiologist, Exotic dancer
    Location:
    Göteborg
    Ratings:
    +865 / 0
    Home Country:
    Sweden Sweden
    Show System Specs
    Thanks cane, I added your solution to the wiki. I use the 3G connection myself so I keep the Wi-Fi disabled :)

    Your plugin looks very nice. Too bad it doesn't work with the new TEMPer. I'd like to see an updated plugin with skinning support as suggested in your thread. That way MediaPortal could show the room temperature next to the outside temperature and weather. Even better would be an EventGhost plugin since it could also support auto triggering the ceiling fan speed. And perhaps a skin file for MediaPortal to manually control the ceiling fan :)

    The incoming call message should be produced by EventGhost and not MediaPortal. The timeout of the OSD is 7.0 seconds in my example. Do you see the message longer if MediaPortal is closed? Did you enable "Keep MediaPortal always on top"? Perhaps that's what preventing EventGhost from showing the OSD on top of MediaPortal.
     
  7. cane
    • Premium Supporter

    cane MP Donator

    Joined:
    October 20, 2007
    Messages:
    129
    Likes Received:
    24
    Location:
    Zagreb
    Ratings:
    +26 / 0
    Home Country:
    Croatia Croatia
    Show System Specs
    Maybe I'll try to play around with new TEMPer device sometime in future, so much interests so little time.

    Yeah, I understand that EventGhost makes the message. And it works fine in all situations - it's shown for 7 seconds on screen, in windows, in MediaPortal in menus and while listening to music. But while playing video it just pops out and immediately disappears. Option "Keep MediaPortal always on top" is disabled, I tried to turn on/off dynamic refresh rate changer and it makes no difference at all. Something hides it immediately while playing videos, maybe it is the codec related.
     
  8. vuego
    • Team MediaPortal

    vuego Documentation Group

    Joined:
    August 5, 2006
    Messages:
    1,568
    Likes Received:
    658
    Occupation:
    Alchemist, Astrobiologist, Exotic dancer
    Location:
    Göteborg
    Ratings:
    +865 / 0
    Home Country:
    Sweden Sweden
    Show System Specs
    I have not seen this issue before. What graphics card and operating system do you use? (perhaps time for you to fill out the System Specifications of your profile :))
    You might be right that it's a video decoder or video renderer issue.

    If you play a video not in full screen (like pressing Esc when playing a video) does only the video cover EventGhost's OSD or the full MediaPortal window?
    You could also try the On Screen Menu and On Screen Explorer plugins of EventGhost to see if they have the same problem.

    I see something similar has been reported before at EventGhost's forum. You could try asking there. Pako is usually very quick to fix bugs once they're found :)
     
  9. cane
    • Premium Supporter

    cane MP Donator

    Joined:
    October 20, 2007
    Messages:
    129
    Likes Received:
    24
    Location:
    Zagreb
    Ratings:
    +26 / 0
    Home Country:
    Croatia Croatia
    Show System Specs
    I found solution for my problem. In MediaPortal Configuration under Codecs and Renderer -> Video Renderer -> Use exclusive mode (avoids tearing, MP stays on top during media) should be obviously disabled if VMR9 is used. Now I can see message normally, just hope that disabling this option won't do any problems with video playback.
    :D vuego for support
     
  10. JBravo
    • Premium Supporter

    JBravo MP Donator

    Joined:
    November 11, 2007
    Messages:
    269
    Likes Received:
    27
    Occupation:
    Software Architect
    Ratings:
    +27 / 0
    Home Country:
    Sweden Sweden
    Nice guide vuego!

    I already have a Tellstick, haven't used EventGhost though. Do you know if EventGhost/Suntracker can wake the computer from standby (s3) when e.g. lights are scheduled on/off?

    Don't have my computer turned on 24/7, and I have previoulsy used the native windows scheduler to control the Tellstick as the native scheduler can wake the computer from standby.
     
  11. vuego
    • Team MediaPortal

    vuego Documentation Group

    Joined:
    August 5, 2006
    Messages:
    1,568
    Likes Received:
    658
    Occupation:
    Alchemist, Astrobiologist, Exotic dancer
    Location:
    Göteborg
    Ratings:
    +865 / 0
    Home Country:
    Sweden Sweden
    Show System Specs
    Hey JBravo

    I'm not sure this is the best way to do it - I've never turned off my computer :cool:
    It is possible but tricky. There's probably other software that can wake up the computer at different times but I'll use Windows' built in functions.

    If you want to wake up your computer for the daily fixed times set up in SunTracker (i.e. turn lights on at 06:00 and off at 23:00), create a Scheduled Task which trigger at 06:00 and 23:00 with an action to run any application (for example send an event to EventGhost by letting the task launch Program: "C:\Program Files (x86)\EventGhost\EventGhost.exe" Arguments: -e GetUp). On the Conditions tab check Wake the computer to run this task. Be sure to run the task as the same user running EventGhost and select Run only when user is logged in or another hidden EventGhost process will be launched. Now you can either use this trigger to turn on your lights (Main.GetUp) or the SunTracker trigger.

    The other two variable triggers (turn lights off at sunrise and on at sunset) needs to have its start time modified every day to the new sunrise and sunset times calculated by SunTracker. EventGhost can modify Scheduled tasks by running schtasks.exe but the problem is that administrator privileges are required. If you run EventGhost as administrator you also need to run MediaPortal as administrator unless you disable UAC. Either way is no good idea.

    Another possibility is to enable Windows' built in Administrator account, set a password and make EventGhost launch runas to run schtasks as administrator. You need to save the administrator password in the Windows Vault since you don't want to enter the password every time EventGhost is launched. Caution! This might open security issues since it also allows users to run other applications with administrator privileges by the runas command so consider using this option only on secured computers.

    Here's how it's done:
    1. Create two Scheduled Tasks, WakeUpSunrise and WakeUpSunset with the same options as mentioned earlier.
    2. Enable Windows' built in Administrator account and set a password (Computer Management / Local Users and Groups).
    3. Create a Python Script in EventGhost's Autostart folder, paste the following code and replace <pass> with the administrator password:
    Code (Text):
    1. import os
    2. sWakeTime = eg.plugins.Suntracker.plugin.csSR
    3. os.system("runas /savecred /user:administrator \"schtasks /change /s localhost /ru administrator /rp <pass> /tn \\\"WakeUpSunrise\\\" /st " + sWakeTime[:2] + ":" + sWakeTime[2:] + "\"")
    4. sWakeTime = eg.plugins.Suntracker.plugin.csSS
    5. os.system("runas /savecred /user:administrator \"schtasks /change /s localhost /ru administrator /rp <pass> /tn \\\"WakeUpSunset\\\" /st " + sWakeTime[:2] + ":" + sWakeTime[2:] + "\"")
    4. Run the script once by pressing Test. Runas asks for the administrator password on the first launch due to the /savecred switch. The password is saved to Windows Vault (Start / search "credentials" / run Manage Windows Credentials).

    Hope this answer can be of some use. Even if you don't use this solution it might inspire other ideas :)
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!