- Posts: 7
- Thank you received: 0
public void Setup(){
}
public void Run(){
int ism;
ModuleParameter s = ModuleHelper.GetProperty(Domains.VIRTUAL, "N2S0", "Sensor.DigitalValue");
if (s.Value == "1"){
if (ism <= 0 || ism >=6000 ){ism = 0;}
ism = ism + 1;
Console.WriteLine("sunshine=" + s.Value);
Console.WriteLine("sunshine_minutes=" + ism);
}
}
Please Log in or Create an account to join the conversation.
public void Setup(){
}
public void Run(){
// Console.WriteLine("Run");
ModuleParameter s = ModuleHelper.GetProperty(Domains.VIRTUAL, "N2S0", "Sensor.DigitalValue");
ModuleParameter sm = ModuleHelper.GetProperty(Domains.VIRTUAL, "N5S0", "Sensor.AnalogValue");
if (s.Value == "1"){
//Console.WriteLine("sunshine=" + s.Value);
int tsm = Int32.Parse(sm.Value);
tsm = tsm + 10;
//Console.WriteLine("out=" + tsm);
DriverHelper.ProcessCommad(Domains.VIRTUAL, "N5S0", "ControlLevel", tsm.ToString());
}
}
Please Log in or Create an account to join the conversation.
public void Setup()
{
//string SOLAR_OVERFLOW_WANTED_DAILY = "N1S0";
string SOLAR_OVERFLOW_SENSOR = "N2S0";
string SOLAR_OVERFLOW_CONSUMER1 = "N3S0";
string SOLAR_OVERFLOW_CONSUMER2 = "N4S0";
//string SOLAR_OVERFLOW_DAILY_MINUTES = "N5S0";
EventHelper.ModuleChangedHandler((o, m, p) =>
{
// filter digital switch - change module address
if (m.Domain == Domains.VIRTUAL && m.Address == SOLAR_OVERFLOW_SENSOR && p.Property == "Sensor.DigitalValue"){
// filter when switch on event
if (p.Value == "1")
{
DriverHelper.ProcessCommad(Domains.VIRTUAL, SOLAR_OVERFLOW_CONSUMER1, "ControlOn", "");
DriverHelper.ProcessCommad(Domains.VIRTUAL, SOLAR_OVERFLOW_CONSUMER2, "ControlOn", "");
} else {
DriverHelper.ProcessCommad(Domains.VIRTUAL, SOLAR_OVERFLOW_CONSUMER1, "ControlOff", "");
DriverHelper.ProcessCommad(Domains.VIRTUAL, SOLAR_OVERFLOW_CONSUMER2, "ControlOff", "");
}
}
return true;
});
}
public void Run()
{
}
public void Setup(){
}
public void Run(){
//string SOLAR_OVERFLOW_WANTED_DAILY = "N1S0";
string SOLAR_OVERFLOW_SENSOR = "N2S0";
//string SOLAR_OVERFLOW_CONSUMER1 = "N3S0";
//string SOLAR_OVERFLOW_CONSUMER2 = "N4S0";
string SOLAR_OVERFLOW_DAILY_MINUTES = "N5S0";
ModuleParameter so = ModuleHelper.GetProperty(Domains.VIRTUAL, SOLAR_OVERFLOW_SENSOR, "Sensor.DigitalValue");
ModuleParameter som = ModuleHelper.GetProperty(Domains.VIRTUAL, SOLAR_OVERFLOW_DAILY_MINUTES, "Sensor.AnalogValue");
if (so.Value == "1"){ // solar power has overflow
int isom = Int32.Parse(som.Value);
isom = isom + 1;
DriverHelper.ProcessCommad(Domains.VIRTUAL, SOLAR_OVERFLOW_DAILY_MINUTES, "ControlLevel", isom.ToString());
}
}
public void Setup(){
}
public void Run(){
string SOLAR_OVERFLOW_WANTED_DAILY = "N1S0";
//string SOLAR_OVERFLOW_SENSOR = "N2S0";
string SOLAR_OVERFLOW_CONSUMER1 = "N3S0";
string SOLAR_OVERFLOW_CONSUMER2 = "N4S0";
string SOLAR_OVERFLOW_DAILY_MINUTES = "N5S0";
ModuleParameter som = ModuleHelper.GetProperty(Domains.VIRTUAL, SOLAR_OVERFLOW_DAILY_MINUTES, "Sensor.AnalogValue");
ModuleParameter sow = ModuleHelper.GetProperty(Domains.VIRTUAL, SOLAR_OVERFLOW_WANTED_DAILY, "Sensor.AnalogValue");
int isom = Int32.Parse(som.Value);
int isow = Int32.Parse(sow.Value);
if (isow >= isom){ // solar overflow limit NOT reached
DriverHelper.ProcessCommad(Domains.VIRTUAL, SOLAR_OVERFLOW_CONSUMER1, "ControlOn", "");
DriverHelper.ProcessCommad(Domains.VIRTUAL, SOLAR_OVERFLOW_CONSUMER2, "ControlOn", "");
}
}
public void Setup(){
}
public void Run(){
//string SOLAR_OVERFLOW_WANTED_DAILY = "N1S0";
//string SOLAR_OVERFLOW_SENSOR = "N2S0";
string SOLAR_OVERFLOW_CONSUMER1 = "N3S0";
string SOLAR_OVERFLOW_CONSUMER2 = "N4S0";
string SOLAR_OVERFLOW_DAILY_MINUTES = "N5S0";
DriverHelper.ProcessCommad(Domains.VIRTUAL, SOLAR_OVERFLOW_CONSUMER1, "ControlOff", "");
DriverHelper.ProcessCommad(Domains.VIRTUAL, SOLAR_OVERFLOW_CONSUMER2, "ControlOff", "");
DriverHelper.ProcessCommad(Domains.VIRTUAL, SOLAR_OVERFLOW_DAILY_MINUTES, "ControlLevel", "0");
}
Please Log in or Create an account to join the conversation.