-
Forum
-
EasyIoT server
-
Automation
-
Automation Thermostat : Get Analog Value
Automation Thermostat : Get Analog Value
Less
More
-
Posts: 2
-
Thank you received: 0
-
-
9 years 9 months ago #411
by ipaqman
Hello,
First thank you very much for your awesome project !
I am trying to make a simple thermostat automation program in EasyIot, but I can't get the temperature sensor value.
public void Run()
{
ModuleParameter temp = ModuleHelper.GetProperty(Domains.MYSENSORS, "N3S10", "Sensor.Temperature");
if (temp!= null && temp.Value<21.0) {DriverHelper.ProcessCommad(Domains.MYSENSORS, "N2S2", "ControlOn", "");}
else {DriverHelper.ProcessCommad(Domains.MYSENSORS, "N2S2", "ControlOff", "");}
}
When I update it says me " Operator `<' cannot be applied to operands of type `string' and `double' " .
I think that i don't get the right variable, but as I am a beginner in programming I didn't find a solution.
Please, could you help me ?
Thank you
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 62
-
Thank you received: 3
-
-
-
9 years 9 months ago #413
by Xavier
Hello,
Yes, as a float 21.0 is a double.
But sorry I don't have the solution.
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 862
-
Karma: 25
-
Thank you received: 264
-
-
-
9 years 9 months ago #422
by EasyIoT
ipaqman wrote: Hello,
First thank you very much for your awesome project !
I am trying to make a simple thermostat automation program in EasyIot, but I can't get the temperature sensor value.
public void Run()
{
ModuleParameter temp = ModuleHelper.GetProperty(Domains.MYSENSORS, "N3S10", "Sensor.Temperature");
if (temp!= null && temp.Value<21.0) {DriverHelper.ProcessCommad(Domains.MYSENSORS, "N2S2", "ControlOn", "");}
else {DriverHelper.ProcessCommad(Domains.MYSENSORS, "N2S2", "ControlOff", "");}
}
When I update it says me " Operator `<' cannot be applied to operands of type `string' and `double' " .
I think that i don't get the right variable, but as I am a beginner in programming I didn't find a solution.
Please, could you help me ?
Thank you
Try temp.DecimalValue function.
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 2
-
Thank you received: 0
-
-
Less
More
-
Posts: 46
-
Karma: 1
-
Thank you received: 7
-
-
-
Forum
-
EasyIoT server
-
Automation
-
Automation Thermostat : Get Analog Value
Time to create page: 0.560 seconds