Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - esev

Pages: [1]
1
Developers / New Event Plug-in proposal
« on: November 09, 2010, 05:36:52 am »
I'd like to look into redesigning the Event Plug-in to make it better suited to handling complex events.  In the current Event Plug-in, a complex event might need to be broken into several separate events.

Lets say, as an example, you would like to automate whether your lawn sprinklers should be On or Off. In this example, you have two sensor devices to help determine when to water your lawn.  The first sensor, a rain sensor detects if it is currently raining.  If is is raining the state of the sensor will be "Raining" and if it is not raining, the state will be "No Rain".  The second sensor, a ground moisture sensor, detects the percentage of moisture in the ground.

In this example, you'd like the lawn to be watered only if the following conditions are satisfied:
  - The time is between 0500-0659
  - The rain sensor state is "No Rain"
  - The moisture sensor state is 25% or less
  - House mode is not Entertaining (you don't want to soak your guests)

Using the current Event Plug-in you would need to define six different events to manage your sprinklers.  You need two events (one On and one Off) for each type of event that effects the sprinklers.  Here are the six events, the event criteria are shown in parentheses:

  - Event 1 - Time Based at 0500, turn on
    (AND
      (sprinkler state = "Off")
      (moisture sensor state <= 25%)
      (rain sensor state "No Rain")
      (NOT
        (house mode "Entertaining")
      )
    )
    * ACTION: Turn the sprinklers on

  - Event 2 - Time Based at 0700, turn off
    (sprinkler state = "On" )
    * ACTION: Turn the sprinklers off

  - Event 3 - State Based, turn on
    (AND
      (sprinkler state = "Off")
      (current time >= 0500)
      (current time < 0700)
      (moisture sensor state <= 25%)
      (rain sensor state = "No Rain")
      (NOT
        (house mode "Entertaining")
      )
    )
    * ACTION: Turn the sprinklers on

  - Event 4 - State Based, turn off
    (AND
      (sprinkler state = "On")
      (OR
        (moisture sensor state > 25%)
        (rain sensor state = "Raining")
      )
    )
    * ACTION: Turn the sprinklers off

  - Event 5 - House Mode Based, turn on
    (AND
      (sprinkler state = "Off")
      (current time >= 0500)
      (current time < 0700)
      (moisture sensor state <= 25%)
      (rain sensor state = "No Rain")
      (NOT
        (house mode "Entertaining")
      )
    )
    * ACTION: Turn the sprinklers on

  - Event 6 - House Mode Based, turn off
    (AND
      (sprinkler state = "On")
      (house mode "Entertaining")
    )
    * ACTION: Turn the sprinklers off

As you can see, it takes a bit of thought to get this setup properly.  This is due to the current implementation of the Event Plug-in only being able to act on single events.  In this example, the individual events are Time, State, and House Mode.

An alternate implementation of the Event Plug-in could be less focused on the events that occur in the system and more focused on the overall state of the devices managed by LinuxMCE.  In this implementation, instead of being tied to a specific event, you just define the conditions necessary for your sprinklers to be On or Off.  To implement the example above only two rules are needed.  This is much easier for a person to implement and understand.

  - Rule 1 - Sprinklers auto-on
    (AND
      (sprinkers state off)
      (current-time >= 0500)
      (current-time <  0700)
      (rain-sensor state "No Rain")
      (moisture-sensor state <= 25%)
      (NOT
        (house-mode "Entertaining")
      )
    )
    * ACTION: (sprinklers send-command "on")

  - Rule 2 - Sprinklers auto-off
    (AND
      (sprinklers state on)
      (OR
        (current-time <  0500)
        (current-time >= 0700)
        (rain-sensor state "Raining")
        (moisture-sensor state > 25%)
        (house-mode "Entertaining")
      )
    )
    * ACTION: (sprinklers send-command "Off")

Implementing an event plugin that is based on the overall state of the system can quickly become inefficient if the right algorithm is not used.  You can immagine a nieve algorithm, checking each condition of each rule every time an event is fired, would bog down the system in a hurry.  I'm proposing this plug-in be based on the Rete algorithm.  You can read more about the Rete algoritm on Wikipedia, but in a nutshell it is designed to efficiently handle this type of rule based logic.  A C language public domain implementation of the Rete algorithm exists and is called CLIPS (C Language Integrated Production System).  I'd like to use CLIPS to implement a Rules-Base event plugin for LinuxMCE.  I'd also like to re-do the web interface for events to make it work with this new implementation.

Is it alright if I implement a new Event Plug-in?  Are there any other suggestions on how this should be done or features it should support?

2
I updated my core over the weekend and started having issues with the OSD orbiter not coming back on screen when I finished watching media on a non-pluto/external Blu-ray player.

Let me describe my setup.  I'm using Gyration remotes to control my OSD Orbiters.  I have a receiver, television, and Blu-ray player all in the same entertainment area.  I have device pipes setup on my MD to switch the receiver and television to the proper inputs to display the OSD orbiter.  And I have device pipes setup on my Blu-ray player device to switch the receiver and television to the proper inputs to view the Blu-ray player via Live AV.

What used to happen, was when I finished watching a Blu-ray, I'd press the power button on the remote.  That would turn off the Blu-ray player and switch my receiver and television back to the inputs needed to view the MD's OSD orbiter.  Then I'd press the power button again and the OSD Power menu would come up so that I could power down the television and receiver.

Now what happens is when I finish watching a Blu-ray, I press the power button on the remote and the only thing that happens is the Blu-ray player turns off.  I'm left with a "no signal" screen on my television.  When I press power again, I cannot see the OSD Power menu (though I know it has selected the 'Display Off' option for me).

I tracked my issue down to changeset 23325 (Don't turn the TV on when music stops playing).  I completely understand the reason behind this change, but can we bring that code back and find a different solution?

3
Does anyone else get this error in their ZWave log?
   No callback received: await_callback: 105 timer: 31 <0xb7136b90>
   No callback received: await_callback: 105 timer: 31 <0xb7136b90>
   No callback received: await_callback: 105 timer: 31 <0xb7136b90>
   ERROR: Dropping command, no callback received after three resends <0xb7136b90>

I have the Tricklestar 300ZW and see these from time to time.  It seems once I start getting this error it continues till I reboot the computer.  While this error is occurring LinuxMCE is unable to control any ZWave devices.

Just curious if anyone else has seen this. Is it limited to the Tricklestar dongle? Is there any way to prevent it?

4
Developers / Touch Orbiter and Web Orbiter speed improvements
« on: October 20, 2010, 10:56:16 am »
The Touch Orbiters, including the Web Orbiter feel slightly less responsive than a normal DCE Orbiter.  This is because they are polling once per second to see if any updates have taken place.  If an Orbiter update takes place while they are not polling there is a delay before the updates are shown.

Currently, to poll for changes, a Touch Orbiter client issues a "ANYNEWS?" request to the Proxy Orbiter.  This is a short lived call which simply returns "yes" if changes have been made since the last poll, or "no" if there haven't been any changes.  If "no" is returned, the client typically waits a second, then makes another "ANYNEWS?" request.

A slight tweak to the ANYNEWS? request can be made in order both speed things up and to eliminate having to poll every second.  The tweak would make the request look like this: ANYNEWS? [<lastImageSent> <maxWaitMs>] (ex: ANYNEWS? 1 30000)  Where the two extra parameters are optional so as to not break existing clients.  The response could also be tweaked to return lastImageSent (which is just a one up counter that increments each time the Orbiter screen changes) instead of "yes" or "no".  This has the added advantage that the Proxy Orbiter never gets out of sync with the client and the client knows that the Proxy Orbiter supports the extra paramters.

When calling ANYNEWS with these extra parameters, the semantics of the call change. If there has been a change since the last poll, the call will return immediately.  If there haven't been any changes, the call will block until either an Orbiter update occurs or <maxWaitMs> milliseconds have expired.  If an Orbiter update occurs while the request is blocked, the request will immediately unblock and reply with the new lastImageSent number.  This cuts down on the number of ANYNEWS requests that need to be made and at the same time also allows the client to know immediately when an Orbiter change occurs.

If you'd like to experiment with these changes, please see the attached patch file.  I'm not sure all the bugs are worked out yet, but the Web Orbiter is a lot more responsive with these changes.

Edit: Deleting the patch file. Use the patches in the message below

5
One of the common first questions people ask on the forums is "why can't I use just one network card".  I understand that today using just one network card will break DHCP based plug-and-play and network booting the media directors, but is there a reason we cannot solve these issues?

To make DHCP plug-and-play work without being a DHCP server, the Dhcpd-Plugin could be extended to perform arp requests for each IP on the subnet.  Any new MAC/IP addresses that appears can then be sent to the Plug and Play plugin.  This can be further extended by listening on the DHCPD port for DHCPDISCOVER requests.  When one is seen from a previously unknown MAC address, then the scan can start again to try to discover what IP address was assigned to it.

To make the media directors boot from the network, couldn't a ProxyDHCP server be used?

Besides QoS, and possibly hard coded 192.168.80.1 issues, are there any other features that would break with only having one NIC?

Disclaimer: I'm not trying to personally setup anything other than the standard two NIC setup, I personally like to have a separate segment for media and home automation devices.  I'm merely wondering if it would be technically possible to make some small-ish changes that would make things easier for new people who would like to experiment with LinuxMCE.  I'm also not advocating making these changes right away, just trying to learn the downsides of using only one NIC.

6
Users / Anyone using MythTV outside the USA?
« on: October 19, 2010, 04:33:22 pm »
Like a lot of folks here using LinuxMCE I am living outside the USA and need to perform some manual setup of MythTV to get it working properly.  As you've probably already discovered, LinuxMCE tries to manage your TV capture cards within MythTV.  If you're like me, you first noticed this when LinuxMCE erases any changes you make to the capture cards within mythtv-setup.  The current solution for this is to select the "Dont Auto Configure" option on your MythTV Plug-in device.

This solution has a few problems.
  • If the capture cards are detected in a different order on your next boot (i.e. /dev/video0 becomes /dev/video1), LinuxMCE will no longer update MythTV with these settings
  • If new capture cards are added to your system, they are not automatically available in MythTV
  • If you create a new Media Director after selecting "Dont Auto Configure", mythfrontend dies after one minute

I'd like to make this better.  I think I can make a few changes to the MythTV Plugin such that you won't need to select "Dont Auto Configure" any more when making modifications directly inside mythtv-setup.  But before I do that, I need your help.  If you've had to enable the "Dont Auto Configure" option, could you describe why you needed to do that and how you've configured MythTV for your setup?

I'm specifically looking for information about how you defined your Video Sources and Input Connections and if you had to make any changes to the capture cards.  Also, were there any other reasons for selecting the "Dont Auto Configure" option beyond issues with Input Connections?

Thanks in advance for your input!
Eric

7
Developers / TiVo custom orbiter screen crashes DCErouter (#851)
« on: October 18, 2010, 10:26:59 pm »
When support was added for the Series 2 TiVo, a new Orbiter screen was added to control some of the special features of the device.  When the entry for these screens was added to the MediaType_DesignObj table in pluto_main, the UIVersion field was left blank.  See ticket #851 for details, but the end result is that DCERouter is crashing as it is exiting.  Is anyone familiar with the custom HADesigner screens for the TiVo Series 2?  If so, are they built for UIVersion 1?

Sorry for cross posting this on the forums, but I thought it might get the issue to a larger audience in hopes someone might be able to fill in the missing information so the ticket can be resolved and closed.

8
Users / TrickleStar ZWave auto detection script - testers needed
« on: October 16, 2010, 07:31:36 am »
I've been trying to get as many devices as possible in my setup to be automatically detected.  I have a TrickleStar USB ZWave controller, and according to the wiki page for the device, it uses the USB ID of a generic serial port adapter.  So using the USB ID alone for PnP detection is not a good solution.  This is where the attached auto detection script is needed. The script sends a ZWave Version request to the serial port.  If is receives a valid ZWave response than it assumes this USB device is a ZWave controller.

To use, place the script into /usr/pluto/pnp.  Then modify the device template for ZWave (1754).  Follow the directions on this wiki page to add a new PnP entry - use 067b2303 as the vendor model id and ZWave.sh for the PNP detection script (or whatever name you saved the script as).

http://wiki.linuxmce.org/index.php/ZWave_DeviceTemplate_PlugAndPlay

If you have a TrickleStar ZWave adapter, or a Prolific Technology, Inc. PL2303 Serial Port, give this a try.  Let me know if you have any troubles with the script.

9
Users / Roku Netflix Player - MAC address
« on: October 11, 2010, 05:16:53 am »
Hi Folks,

Is anyone who has a Roku Netflix Player willing to share the first four components of the MAC address?  I'd like to update the NetflixPlayer_telnet (#2049) device template and at the same time make it be plug-n-play compatible.

I'll start, the MAC address on my Roku Netflix Player is in the range 00:0d:4b:57:XX:XX

Thank you,
--Eric

10
I am trying to create a device template to control my Blu-ray player using an infrared transmitter.  When I created the template, it was populated with input boxes for several commands that DVD/Blu-ray players have in common (Media Ctrl and On Screen Menu Navigation).  Almost all of the IR codes I entered work as I'd expect, but there are two commands, "#95 Stop" and "#86 Menu (Show Menu)", that I'm having trouble with.  If I enter the IR codes for those commands, then try to press the "Stop" or "Menu" buttons on an Orbiter, nothing happens.

If I look at the log for the infrared transmitter device, I see "Could not find Infrared Code for Command 87" when I press the Menu button on the Orbiter, and I see "Could not find Infrared Code for Command 763" when I press the Stop button on the Orbiter.

I must not be understanding how the Orbiter buttons are supposed to be mapped to the device commands.  Is there a reason the Stop button on the Orbiter doesn't map to command #95, and the Menu buttion on the Orbiter doesn't map to command #86?  If so, why are input boxes for commands #95 and #86 displayed automatically when a new DVD/Blu-ray device is created rather than commands #87 and #763?

My apologies if this is already documented somewhere.  I did search the wiki and forums before posting this question, but wasn't able to find an answer.

Thank you,
--Eric

Pages: [1]