2.0 Discussion: Units, sensor types and protocol
-
To simplify sketches even further we've discussed and decided to let sensors send in standard SI units and let controller convert them to the appropriate format.
This will also remove the need for a unit-config exchange with controller at sensor startup.
The new over-the-air messages has changed quite much with a more logical structure that can handle extension and even a completely different network layer if needed.
The ongoing work can be found here:
https://github.com/henrikekblad/Arduino/blob/development/libraries/MySensors/MyMessage.hWill not bring this into development until it actually compiles.
Feel free to give feedback and report any missed sensor-types.
In parallell we should probably discuss the serial-protocol for 2.0. Is it time for json perhaps?
-
@hek said:
V_WIND - m/s (average wind speed during last hour)
V_GUST - m/s (highest wind speed during last hour)Why average/highest over last hour? My weather station reports wind speed every minute and I like to see the minute detail instead of averaging everything over an hour.
-
-
@hek said:
V_DUST_LEVEL - ug/m3
g/m3 if you standardize on SI
Same for distance BTW. Might be more...@Yveaux said:
g/m3 if you standardize on SI
Same for distance BTW. Might be more...I choose to scale the SI units to something relevant for thing getting measured. E.g. g/m3 would give a VERY small small value for dust.
Distance is mainly for the distance sensor now, which only has a small range.
Rain - measure in meters would also render very small numbers.
So, until we have a scaling factor in the protocol or something similar we'll have select a proper scaling at the source and agree on it between sensor and controller.
-
I would like a way to configure a sensor from the gateway, to e.g calibrate a sensor or store some ID. Maybe a V_CONFIG can be added, where childid indicates the actual variable written. Or define a few V_CONFIG0,V_CONFIG1 etc.
What do you think? -
@hek said:
V_WIND - m/s (average wind speed during last hour)
V_GUST - m/s (highest wind speed during last hour)Why average/highest over last hour? My weather station reports wind speed every minute and I like to see the minute detail instead of averaging everything over an hour.
-
@Yveaux said:
g/m3 if you standardize on SI
Same for distance BTW. Might be more...I choose to scale the SI units to something relevant for thing getting measured. E.g. g/m3 would give a VERY small small value for dust.
Distance is mainly for the distance sensor now, which only has a small range.
Rain - measure in meters would also render very small numbers.
So, until we have a scaling factor in the protocol or something similar we'll have select a proper scaling at the source and agree on it between sensor and controller.
@hek said:
So, until we have a scaling factor in the protocol or something similar we'll have select a proper scaling at the source and agree on it between sensor and controller.
When values are sent as floats it doesn't matter. Scaling is implicitly store in the floating point value when sent as binary float. When transfered as ASCII you're right, but that isn't required with 1.4 anymore...
-
@ServiceXp said:
V_RELAY_STATUS 1=Active, 0=Deactive
Not sure what differs this form V_LIGHT_STATUS.
Maybe we need a better word than LIGHT that describes a thing-that-can-be-turned-on-or-off? -
@HEK I'll bite:
Use under scores consistently ? eg V_RAINRATE and V_LIGHT_LEVEL
The units to be used here can be clearer:
V_VOLTAGE ---> V_VOLTS
V_CURRENT ---> V_AMPSWhere the base unit is not used - should the name reflect that? eg V_DISTANCE --> V_DISTANCE_CM
Electrical impedance and resistance are not the same thing- suspect resistance is intended here?
V_IMPEDANCE --> V_RESISTANCEHUM is a bit vague - suggest: V_HUM --> V_HUMIDITY
V_DIRECTION may be confused with an angle or up/down. Could use V_COMPASS_POINT, but that may be confused with magnetic or true north!
V_LIGHT could be confused with V_LIGHT_LEVEL. Could use V_LIGHT_STATUS
V_TEMP while often used, can be confused with a temporary variable? Could use V_TEMPERATURE
V_VOLUME could be confused with audio volume? Could use V_CUBIC_MEASURE
V_HEATER_MODE for V_HEATER?Could add V_DEW_POINT
STATUS always be used for binary values eg on/off, locked/unlocked?
V_LOCK_STATUS
V_LIGHT_STATUS
V_HEATER_STATUS@a-lurker said:
Electrical impedance and resistance are not the same thing- suspect resistance is intended here?
V_IMPEDANCE --> V_RESISTANCEI think the impedance-variable comes from the RFXTRX plugin. And it is related to body fat measurements for body scales.
http://code.mios.com/trac/mios_rfxtrx/browser/trunk/L_RFXtrx.lua
If I understand it correctly Impedace is used for AC and resistance for DC. Not sure what would be most useful in this setup.
-
@hek said:
So, until we have a scaling factor in the protocol or something similar we'll have select a proper scaling at the source and agree on it between sensor and controller.
When values are sent as floats it doesn't matter. Scaling is implicitly store in the floating point value when sent as binary float. When transfered as ASCII you're right, but that isn't required with 1.4 anymore...
-
@a-lurker said:
Electrical impedance and resistance are not the same thing- suspect resistance is intended here?
V_IMPEDANCE --> V_RESISTANCEI think the impedance-variable comes from the RFXTRX plugin. And it is related to body fat measurements for body scales.
http://code.mios.com/trac/mios_rfxtrx/browser/trunk/L_RFXtrx.lua
If I understand it correctly Impedace is used for AC and resistance for DC. Not sure what would be most useful in this setup.
@hek Moisture or Water detecded... Might be 2 different ?
Thinking different applications: Moisture in ground. (I.e. Water needed? Ground dry?) And Water level, hmm, if you have a fluid level meter to detect overfill. or leakage. Fluid flow -
@Yveaux said:
When transfered as ASCII you're right, but that isn't required with 1.4 anymore.
Most users still use the serial protocol. Which means strings like "0.000003423" must be generated and transferred to the controller from gateway.
@hek said:
strings like "0.000003423" must be generated and transferred
Ok, but is this a problem? You could even pass it as 3.423e-6....
You don't want this string on air if you can transfer the same thing in 4 bytes, that's true.
I only want to state that if you transfer it purely in SI units, without scaling, you always know what the actual value is.