Skip to content

Commit 8c2e835

Browse files
committed
Added HVAC and some other new device types and variables from the
development branch.
1 parent 21ea26f commit 8c2e835

File tree

4 files changed

+103
-15
lines changed

4 files changed

+103
-15
lines changed

libraries/MySensors/MyMessage.h

Lines changed: 96 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,106 @@ typedef enum {
3232
C_STREAM = 4 // For Firmware and other larger chunks of data that need to be divided into pieces.
3333
} mysensor_command;
3434

35+
// Type of sensor (used when presenting sensors)
36+
typedef enum {
37+
S_DOOR, // Door sensor, V_TRIPPED, V_ARMED
38+
S_MOTION, // Motion sensor, V_TRIPPED, V_ARMED
39+
S_SMOKE, // Smoke sensor, V_TRIPPED, V_ARMED
40+
S_LIGHT, // Binary light or relay, V_STATUS (or V_LIGHT), V_WATT
41+
S_BINARY=3, // Binary light or relay, V_STATUS (or V_LIGHT), V_WATT (same as S_LIGHT)
42+
S_DIMMER, // Dimmable light or fan device, V_STATUS (on/off), V_DIMMER (dimmer level 0-100), V_WATT
43+
S_COVER, // Blinds or window cover, V_UP, V_DOWN, V_STOP, V_DIMMER (open/close to a percentage)
44+
S_TEMP, // Temperature sensor, V_TEMP
45+
S_HUM, // Humidity sensor, V_HUM
46+
S_BARO, // Barometer sensor, V_PRESSURE, V_FORECAST
47+
S_WIND, // Wind sensor, V_WIND, V_GUST
48+
S_RAIN, // Rain sensor, V_RAIN, V_RAINRATE
49+
S_UV, // Uv sensor, V_UV
50+
S_WEIGHT, // Personal scale sensor, V_WEIGHT, V_IMPEDANCE
51+
S_POWER, // Power meter, V_WATT, V_KWH
52+
S_HEATER, // Header device, V_HVAC_SETPOINT_HEAT, V_HVAC_FLOW_STATE
53+
S_DISTANCE, // Distance sensor, V_DISTANCE
54+
S_LIGHT_LEVEL, // Light level sensor, V_LIGHT_LEVEL (uncalibrated in percentage), V_LEVEL (light level in lux)
55+
S_ARDUINO_NODE, // Used (internally) for presenting a non-repeating Arduino node
56+
S_ARDUINO_REPEATER_NODE, // Used (internally) for presenting a repeating Arduino node
57+
S_LOCK, // Lock device, V_LOCK_STATUS
58+
S_IR, // Ir device, V_IR_SEND, V_IR_RECEIVE
59+
S_WATER, // Water meter, V_FLOW, V_VOLUME
60+
S_AIR_QUALITY, // Air quality sensor, V_LEVEL
61+
S_CUSTOM, // Custom sensor
62+
S_DUST, // Dust sensor, V_LEVEL
63+
S_SCENE_CONTROLLER, // Scene controller device, V_SCENE_ON, V_SCENE_OFF.
64+
S_RGB_LIGHT, // RGB light. Send color component data using V_RGB. Also supports V_WATT
65+
S_RGBW_LIGHT, // RGB light with an additional White component. Send data using V_RGBW. Also supports V_WATT
66+
S_COLOR_SENSOR, // Color sensor, send color information using V_RGB
67+
S_HVAC, // Thermostat/HVAC device. V_HVAC_SETPOINT_HEAT, V_HVAC_SETPOINT_COLD, V_HVAC_FLOW_STATE, V_HVAC_FLOW_MODE
68+
S_MULTIMETER, // Multimeter device, V_VOLTAGE, V_CURRENT, V_IMPEDANCE
69+
S_SPRINKLER, // Sprinkler, V_STATUS (turn on/off), V_TRIPPED (if fire detecting device)
70+
S_WATER_LEAK, // Water leak sensor, V_TRIPPED, V_ARMED
71+
S_SOUND, // Sound sensor, V_TRIPPED, V_ARMED, V_LEVEL (sound level in dB)
72+
S_VIBRATION, // Vibration sensor, V_TRIPPED, V_ARMED, V_LEVEL (vibration in Hz)
73+
S_MOISTURE, // Moisture sensor, V_TRIPPED, V_ARMED, V_LEVEL (water content or moisture in percentage?)
74+
} mysensor_sensor;
75+
3576
// Type of sensor data (for set/req/ack messages)
3677
typedef enum {
37-
V_TEMP,V_HUM, V_LIGHT, V_DIMMER, V_PRESSURE, V_FORECAST, V_RAIN,
38-
V_RAINRATE, V_WIND, V_GUST, V_DIRECTION, V_UV, V_WEIGHT, V_DISTANCE,
39-
V_IMPEDANCE, V_ARMED, V_TRIPPED, V_WATT, V_KWH, V_SCENE_ON, V_SCENE_OFF,
40-
V_HEATER, V_HEATER_SW, V_LIGHT_LEVEL, V_VAR1, V_VAR2, V_VAR3, V_VAR4, V_VAR5,
41-
V_UP, V_DOWN, V_STOP, V_IR_SEND, V_IR_RECEIVE, V_FLOW, V_VOLUME, V_LOCK_STATUS,
42-
V_DUST_LEVEL, V_VOLTAGE, V_CURRENT
78+
V_TEMP, // S_TEMP
79+
V_HUM, // S_HUM
80+
V_STATUS, // S_LIGHT, S_DIMMER, S_SPRINKLER, Used for setting binary (on/off) status. 1=on, 0=off
81+
V_LIGHT=2, // S_LIGHT, S_DIMMER. Same as V_STATUS
82+
V_PERCENTAGE, // S_DIMMER. Used for sending a percentage value (0-100).
83+
V_DIMMER=3, // S_DIMMER. Same as V_PERCENTAGE.
84+
V_PRESSURE, // S_BARO
85+
V_FORECAST, // S_BARO
86+
V_RAIN, // S_RAIN
87+
V_RAINRATE, // S_RAIN
88+
V_WIND, // S_WIND
89+
V_GUST, // S_WIND
90+
V_DIRECTION, // S_WIND
91+
V_UV, // S_UV
92+
V_WEIGHT, // S_WEIGHT
93+
V_DISTANCE, // S_DISTANCE
94+
V_IMPEDANCE, // S_MULTIMETER, S_WEIGHT
95+
V_ARMED, // S_DOOR, S_MOTION, S_SMOKE, S_SPRINKLER
96+
V_TRIPPED, // S_DOOR, S_MOTION, S_SMOKE, S_SPRINKLER (for sprinklers with fire detection)
97+
V_WATT, // S_POWER, S_LIGHT, S_DIMMER
98+
V_KWH, // S_POWER
99+
V_SCENE_ON, // S_SCENE_CONTROLLER
100+
V_SCENE_OFF, // S_SCENE_CONTROLLER
101+
V_HEATER, // Deprecated. Use V_HVAC_FLOW_STATE instead.
102+
V_HVAC_FLOW_STATE=21, // HVAC flow state ("Off", "HeatOn", "CoolOn", or "AutoChangeOver"). S_HEATER, S_HVAC
103+
V_HVAC_SPEED, // HVAC/Heater fan speed ("Min", "Normal", "Max", "Auto")
104+
V_LIGHT_LEVEL, // S_LIGHT_LEVEL (light level in uncalibrated percentage) or S_LEVEL (light level in lux)
105+
V_VAR1, V_VAR2, V_VAR3, V_VAR4, V_VAR5,
106+
V_UP, // S_COVER
107+
V_DOWN, // S_COVER
108+
V_STOP, // S_COVER
109+
V_IR_SEND, // S_IR
110+
V_IR_RECEIVE, // S_IR
111+
V_FLOW, // S_WATER
112+
V_VOLUME, // S_WATER
113+
V_LOCK_STATUS, // S_LOCK
114+
V_LEVEL, // S_DUST, S_AIR_QUALITY, S_SOUND (dB), S_VIBRATION (hz), S_LIGHT_LEVEL (lux)
115+
V_VOLTAGE, // S_MULTIMETER
116+
V_CURRENT, // S_MULTIMETER
117+
V_RGB, // S_RGB_LIGHT, S_COLOR_SENSOR.
118+
// Used for sending color information for multi color LED lighting or color sensors.
119+
// Sent as ASCII hex: RRGGBB (RR=red, GG=green, BB=blue component)
120+
V_RGBW, // S_RGBW_LIGHT
121+
// Used for sending color information to multi color LED lighting.
122+
// Sent as ASCII hex: RRGGBBWW (WW=while component)
123+
V_ID, // S_TEMP
124+
// Used for sending in sensors hardware ids (i.e. OneWire DS1820b).
125+
V_UNIT_PREFIX, // Allows sensors to send in a string representing the
126+
// unit prefix to be displayed in GUI, not parsed by controller! E.g. cm, m, km, inch.
127+
// Can be used for S_DISTANCE or gas concentration (S_DUST, S_AIR_QUALITY)
128+
V_HVAC_SETPOINT_COLD, // HVAC cold setpoint (Integer between 0-100). S_HVAC
129+
V_HVAC_SETPOINT_HEAT, // HVAC/Heater setpoint (Integer between 0-100). S_HEATER, S_HVAC
130+
V_HVAC_FLOW_MODE, // Flow mode for HVAC ("Auto", "ContinuousOn", "PeriodicOn"). S_HVAC
131+
43132
} mysensor_data;
44133

134+
45135
// Type of internal messages (for internal messages)
46136
typedef enum {
47137
I_BATTERY_LEVEL, I_TIME, I_VERSION, I_ID_REQUEST, I_ID_RESPONSE,
@@ -50,13 +140,6 @@ typedef enum {
50140
I_REBOOT, I_GATEWAY_READY
51141
} mysensor_internal;
52142

53-
// Type of sensor (for presentation message)
54-
typedef enum {
55-
S_DOOR, S_MOTION, S_SMOKE, S_LIGHT, S_DIMMER, S_COVER, S_TEMP, S_HUM, S_BARO, S_WIND,
56-
S_RAIN, S_UV, S_WEIGHT, S_POWER, S_HEATER, S_DISTANCE, S_LIGHT_LEVEL, S_ARDUINO_NODE,
57-
S_ARDUINO_REPEATER_NODE, S_LOCK, S_IR, S_WATER, S_AIR_QUALITY, S_CUSTOM, S_DUST,
58-
S_SCENE_CONTROLLER
59-
} mysensor_sensor;
60143

61144
// Type of data stream (for streamed message)
62145
typedef enum {

libraries/MySensors/examples/AirQualitySensor/AirQualitySensor.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ float SmokeCurve[3] ={2.3,0.53,-0.44}; //two points are taken from
5959

6060

6161
MySensor gw;
62-
MyMessage msg(CHILD_ID_MQ, V_VAR1);
62+
MyMessage msg(CHILD_ID_MQ, V_LEVEL);
6363

6464

6565
void setup()

libraries/MySensors/examples/DustSensor/DustSensor.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ float calcVoltage = 0;
3636
float dustDensity = 0;
3737

3838
MySensor gw;
39-
MyMessage dustMsg(CHILD_ID_DUST, V_DUST_LEVEL);
39+
MyMessage dustMsg(CHILD_ID_DUST, V_LEVEL);
4040

4141
void setup()
4242
{

libraries/MySensors/examples/LightLuxSensor/LightLuxSensor.ino

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds)
2626

2727
BH1750 lightSensor;
2828
MySensor gw;
29+
30+
// V_LIGHT_LEVEL should only be used for uncalibrated light level 0-100%.
31+
// If your controller supports the new V_LEVEL variable, use this instead for
32+
// transmitting LUX light level.
2933
MyMessage msg(CHILD_ID_LIGHT, V_LIGHT_LEVEL);
34+
// MyMessage msg(CHILD_ID_LIGHT, V_LEVEL);
3035
uint16_t lastlux;
3136

3237
void setup()

0 commit comments

Comments
 (0)