[Message Prev][Message
Next][Thread Prev][Thread Next][Message
Index][Thread Index]
RE: xPL cm11 Service
Hi Neil,
> Seasons greeting to you and your family.
And to yours.
>
> Could you perhaps shed some light onto my original question
> in this current thread.
>
> - How do you set the COM port for the MEDUSA xPLCM11 Service?
Sorry - I figured you'd sorted that when the X10 stuff started working.
To change the COM port:
1. Click on xPL Devices in xPLHal Manager.
2. In the right-hand window, double-click on the CM11 device.
3. When the device configuration screen appears, you should be able to
select "comport" and enter the port number that it should use.
4. Click OK.
5. You may need to restart the CM11 service in control panel for the
change to take effect.
I'm not actually the author of the CM11 service, so I can't say for sure
whether the above is correct, but I'm pretty sure that's how you change
the COM port.
I'm sure Tom will be along if you're still having problems.
> All so how would you tackle my Pool_Pump problem?
>
> Do we have a season variable? This I guess would be dependent
> on your longitude and latitude.
To be honest I've never thought about a season variable (don't have a
pool unfortunately :-()
You could try the following:
Create a global called "Season" and set it's value to your
current
season.
(set this manually for now - I'll discuss how you can change it
automatically later on)
You will need to create 3 determinators (spring and autumn can share the
same determinator):
For winter, the conditions would be:
Season global = Winter
The actions would be:
Turn on pump
Suspend the determinator for 60 minutes.
Turn off pump.
Now create a determinator for Spring/Autumn:
Conditions would be:
Season variable = Spring
Season variable = Autumn
(set the determinator to match any input condition, so it will match
either Spring or Autumn)
Actions would be:
Turn on pump.
Suspend for 60 minutes.
Turn off pump.
Suspend for however many minutes until you wanted the pump to come on in
the afternoon.
Turn on pump.
Suspend for 120 minutes.
Turn off pump.
For summer:
Conditions would be Season variable = Summer.
Actions would be:
Turn on pump.
Suspend for 120 minutes.
Turn off pump.
Suspend until afternoon.
Turn on pump.
Suspend for 180 minutes.
Turn off pump.
Now create 3 events - one for each of the determinators - to run once a
day, at whatever time in the morning you wanted the pump switching on.
(or in the case of the Winter event, set it to the afternoon time, as
the pump doesn't come on in the morning)
So, suppose you want your pump switching on at 7AM in
Spring/Summer/Autumn.
Both of your events (the one for Summer and the one for the
Autumn/Spring determinator) will fire at 7AM, and both determinators
will start.
Because of the input conditions, only one of those determinators will
actually run - based on the value of the Season global.
In the afternoon, your Winter determinator will run, but again it will
be stopped by the input condition unless the season is actually Winter.
I hope that all makes sense!
The next part is to automatically change the Season global at the
appropriate times of the year, to avoid you having to change it
manually.
At the moment, this can't be done using Determinators, as you can't
apply conditions to a determinator based on time of year - only time of
day.
However, I'll see about enhancing the determinator engine to support
this in the very near future, as I can see it being very useful.
For now, you could achieve this using scripting:
Click on the Scripts node in xPLHal Manager.
Then double click on the xplhal_load script.
In the script editor, look for a sub called SaveSystem.
Paste the following code into this sub, just above the End Sub line:
Select Case Month(Now())
Case 12, 1, 2
sys.value("season") = "Winter"
Case 3, 4, 5
sys.value("season") = "Spring"
Case 6, 7, 8
sys.value("season") = "Summer"
Case 9, 10, 11
sys.value("season") = "Autumn"
End Select
In the above script, we examine the current month, and set the global
accordingly.
(the value of the month is 1 for January, through to 12 for December)
If you want your seasons to change mid-month, you'll need to expand the
logic a little, but hopefully the above should be sufficient to get you
started.
Let me know if you have any questions.
Regards,
John
xPL Main Index |
xPL Thread Index |
xPL Home |
Archives Home
|