gw.send for float
-
Hello,
I have many gases sensors, especially for harmful gases, that report very small concentration, which is thus a float.
Today gw.send only allows an int, which is troublesome for I have to multiply per 1k to have an int.
That would mean that the controller would have to convert back to float to be on the right scale.
Would that extension be possible ?
-
@epierre almost all my sensors use gw.send to send floats. It is in the API, or do I misunderstand you?
-
in 1.5 I just have the int definition of it, maybe is that linked to the S_AIR_QUALITY maybe ?
gw.present(CHILD_ID_CO, S_AIR_QUALITY);
gw.send(msg_co.set("ppm"));
-
@epierre Did you try something like:
float myval = 0.1234; gw.send( MyMessage(CHILD_ID_CO, V_VAR1).set(myval) );
-
You should be able to do something like line 57 in this sketch https://codebender.cc/sketch:177182#Soil moisture for houseplants - multi-sensor internal pull-up.ino
-
@mfalkvidd thanks a lot !