Home Automation (1 Viewer)

vuego

Documentation Group
  • Team MediaPortal
  • August 5, 2006
    1,639
    764
    Göteborg
    Home Country
    Sweden Sweden
    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 :)
     

    GetWell

    Portal Pro
    October 4, 2006
    205
    32
    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 ?
     

    vuego

    Documentation Group
  • Team MediaPortal
  • August 5, 2006
    1,639
    764
    Göteborg
    Home Country
    Sweden Sweden
    • Thread starter
    • Moderator
    • #3
    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.

    Add_device.png


    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.
     

    cane

    MP Donator
  • Premium Supporter
  • October 20, 2007
    129
    48
    Zagreb
    Home Country
    Croatia Croatia
    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.
     

    vuego

    Documentation Group
  • Team MediaPortal
  • August 5, 2006
    1,639
    764
    Göteborg
    Home Country
    Sweden Sweden
    • Thread starter
    • Moderator
    • #5
    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.
     

    cane

    MP Donator
  • Premium Supporter
  • October 20, 2007
    129
    48
    Zagreb
    Home Country
    Croatia Croatia
    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.
     

    vuego

    Documentation Group
  • Team MediaPortal
  • August 5, 2006
    1,639
    764
    Göteborg
    Home Country
    Sweden Sweden
    • Thread starter
    • Moderator
    • #7
    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 :)
     

    cane

    MP Donator
  • Premium Supporter
  • October 20, 2007
    129
    48
    Zagreb
    Home Country
    Croatia Croatia
    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
     

    JBravo

    MP Donator
  • Premium Supporter
  • November 11, 2007
    269
    27
    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.
     

    vuego

    Documentation Group
  • Team MediaPortal
  • August 5, 2006
    1,639
    764
    Göteborg
    Home Country
    Sweden Sweden
    • Thread starter
    • Moderator
    • #10
    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:
    import os
    sWakeTime = eg.plugins.Suntracker.plugin.csSR
    os.system("runas /savecred /user:administrator \"schtasks /change /s localhost /ru administrator /rp <pass> /tn \\\"WakeUpSunrise\\\" /st " + sWakeTime[:2] + ":" + sWakeTime[2:] + "\"")
    sWakeTime = eg.plugins.Suntracker.plugin.csSS
    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 :)
     

    Users who are viewing this thread

    Top Bottom