Add mysensors types (#1031)

* Add more types.
* Fix some rendering issues.
This commit is contained in:
Martin Hjelmare 2016-10-02 10:44:37 +02:00 committed by GitHub
parent 2fffb5d097
commit bb9533e546
6 changed files with 91 additions and 71 deletions

View File

@ -2,14 +2,13 @@
layout: page layout: page
title: "MySensors HVAC" title: "MySensors HVAC"
description: "Instructions how to integrate MySensors climate into Home Assistant." description: "Instructions how to integrate MySensors climate into Home Assistant."
date: 2016-09-14 18:20 +0100 date: 2016-10-01 15:00 +0200
sidebar: true sidebar: true
comments: false comments: false
sharing: true sharing: true
footer: true footer: true
logo: mysensors.png logo: mysensors.png
ha_category: Climate ha_category: Climate
featured: false
ha_release: 0.29 ha_release: 0.29
--- ---
@ -19,18 +18,18 @@ The following actuator types are supported:
##### MySensors version 1.5 and higher ##### MySensors version 1.5 and higher
S_TYPE | V_TYPE S_TYPE | V_TYPE
------------|------------- -------|-----------------------------------------------------------------------------
S_HVAC | V_HVAC_FLOW_STATE*, V_HVAC_SETPOINT_HEAT, V_HVAC_SETPOINT_COOL, V_HVAC_SPEED S_HVAC | V_HVAC_FLOW_STATE*, V_HVAC_SETPOINT_HEAT, V_HVAC_SETPOINT_COOL, V_HVAC_SPEED
V_HVAC_FLOW_STATE is mapped to the state of the Climate component in HA as follows: V_HVAC_FLOW_STATE is mapped to the state of the Climate component in HA as follows:
Home Assistant State | MySensors State Home Assistant State | MySensors State
-----------------------|---------------------- ---------------------|----------------
STATE_COOL | CoolOn STATE_COOL | CoolOn
STATE_HEAT | HeatOn STATE_HEAT | HeatOn
STATE_AUTO | Off STATE_AUTO | Off
STATE_OFF | AutoChangeOver STATE_OFF | AutoChangeOver
Currently humidity, away_mode, aux_heat, swing_mode is not supported. This will be included in later versions as feasible. Currently humidity, away_mode, aux_heat, swing_mode is not supported. This will be included in later versions as feasible.
@ -44,67 +43,72 @@ For more information, visit the [serial api] of MySensors.
```cpp ```cpp
/* /*
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
* Support Forum: http://forum.mysensors.org * Support Forum: http://forum.mysensors.org
* */
*/
#include <MySensor.h> #include <MySensor.h>
/* Include all the other Necessary code here. The example code is limited to message exchange for mysensors with the controller (ha)*/ /*
* Include all the other Necessary code here.
* The example code is limited to message exchange for mysensors
* with the controller (ha).
*/
#define CHILD_ID_HVAC 0 // childId #define CHILD_ID_HVAC 0 // childId
MyMessage msgHVACSetPointC(CHILD_ID_HVAC, V_HVAC_SETPOINT_COOL); MyMessage msgHVACSetPointC(CHILD_ID_HVAC, V_HVAC_SETPOINT_COOL);
MyMessage msgHVACSpeed(CHILD_ID_HVAC, V_HVAC_SPEED); MyMessage msgHVACSpeed(CHILD_ID_HVAC, V_HVAC_SPEED);
MyMessage msgHVACFlowState(CHILD_ID_HVAC, V_HVAC_FLOW_STATE); MyMessage msgHVACFlowState(CHILD_ID_HVAC, V_HVAC_FLOW_STATE);
/* Include all the other Necessary code here. The example code is limited to message exchange for mysensors with the controller (ha)*/ /*
* Include all the other Necessary code here.
* The example code is limited to message exchange for mysensors
* with the controller (ha).
*/
void setup() void setup()
{ {
// Startup and initialize MySensors library.
// Set callback for incoming messages.
gw.begin(incomingMessage);
// Startup and initialize MySensors library. Set callback for incoming messages. // Send the sketch version information to the gateway and Controller
gw.begin(incomingMessage); gw.sendSketchInfo("HVAC", "0.1");
// Send the sketch version information to the gateway and Controller gw.present(CHILD_ID_HVAC, S_HVAC, "Thermostat");
gw.sendSketchInfo("HVAC", "0.1"); gw.send(msgHVACFlowState.set("Off"));
gw.send(msgHVACSetPointC.set(target_temp));
gw.present(CHILD_ID_HVAC, S_HVAC, "Thermostat"); gw.send(msgHVACSpeed.set("Max"));
gw.send(msgHVACFlowState.set("Off"));
gw.send(msgHVACSetPointC.set(target_temp));
gw.send(msgHVACSpeed.set("Max"));
}
void incomingMessage(const MyMessage &message) {
String recvData = message.data;
recvData.trim();
switch (message.type) {
case V_HVAC_SPEED:
if(recvData.equalsIgnoreCase("auto")) fan_speed = 0;
else if(recvData.equalsIgnoreCase("min")) fan_speed = 1;
else if(recvData.equalsIgnoreCase("normal")) fan_speed = 2;
else if(recvData.equalsIgnoreCase("max")) fan_speed = 3;
processHVAC();
break;
case V_HVAC_SETPOINT_COOL:
target_temp = message.getFloat();
processHVAC();
break;
case V_HVAC_FLOW_STATE:
if(recvData.equalsIgnoreCase("coolon") && (!Present_Power_On )){
togglePower();
}
else if(recvData.equalsIgnoreCase("off") && Present_Power_On ){
togglePower();
}
break;
}
} }
void loop() { void loop() {
// Process incoming messages (like config from server)
gw.process();
}
// Process incoming messages (like config from server) void incomingMessage(const MyMessage &message) {
gw.process(); String recvData = message.data;
recvData.trim();
switch (message.type) {
case V_HVAC_SPEED:
if(recvData.equalsIgnoreCase("auto")) fan_speed = 0;
else if(recvData.equalsIgnoreCase("min")) fan_speed = 1;
else if(recvData.equalsIgnoreCase("normal")) fan_speed = 2;
else if(recvData.equalsIgnoreCase("max")) fan_speed = 3;
processHVAC();
break;
case V_HVAC_SETPOINT_COOL:
target_temp = message.getFloat();
processHVAC();
break;
case V_HVAC_FLOW_STATE:
if(recvData.equalsIgnoreCase("coolon") && (!Present_Power_On )){
togglePower();
}
else if(recvData.equalsIgnoreCase("off") && Present_Power_On ){
togglePower();
}
break;
}
} }
``` ```

View File

@ -2,14 +2,14 @@
layout: page layout: page
title: "MySensors Cover" title: "MySensors Cover"
description: "Instructions how to integrate MySensors covers into Home Assistant." description: "Instructions how to integrate MySensors covers into Home Assistant."
date: 2016-09-25 11:30 +0100 date: 2016-10-01 15:00 +0200
sidebar: true sidebar: true
comments: false comments: false
sharing: true sharing: true
footer: true footer: true
logo: mysensors.png logo: mysensors.png
ha_category: Cover ha_category: Cover
ha_release: 0.30 ha_release: "0.30"
--- ---
Integrates MySensors covers into Home Assistant. See the [main component] for configuration instructions. Integrates MySensors covers into Home Assistant. See the [main component] for configuration instructions.
@ -17,14 +17,16 @@ Integrates MySensors covers into Home Assistant. See the [main component] for co
The following actuator types are supported: The following actuator types are supported:
##### MySensors version 1.4 ##### MySensors version 1.4
S_TYPE | V_TYPE
------------|------------- S_TYPE | V_TYPE
S_COVER | V_UP, V_DOWN, V_STOP, [V_DIMMER or V_LIGHT] --------|--------------------------------------------
S_COVER | V_UP, V_DOWN, V_STOP, [V_DIMMER or V_LIGHT]
##### MySensors version 1.5 and higher ##### MySensors version 1.5 and higher
S_TYPE | V_TYPE
------------|------------- S_TYPE | V_TYPE
S_COVER | V_UP, V_DOWN, V_STOP, [V_PERCENTAGE or V_STATUS] --------|-------------------------------------------------
S_COVER | V_UP, V_DOWN, V_STOP, [V_PERCENTAGE or V_STATUS]
All V_TYPES above are required. Use V_PERCENTAGE (or V_DIMMER) if you know the exact position of the cover in percent, use V_STATUS (or V_LIGHT) if you don't. All V_TYPES above are required. Use V_PERCENTAGE (or V_DIMMER) if you know the exact position of the cover in percent, use V_STATUS (or V_LIGHT) if you don't.

View File

@ -2,14 +2,13 @@
layout: page layout: page
title: "MySensors Light" title: "MySensors Light"
description: "Instructions how to integrate MySensors lights into Home Assistant." description: "Instructions how to integrate MySensors lights into Home Assistant."
date: 2016-04-13 14:20 +0100 date: 2016-10-01 15:00 +0200
sidebar: true sidebar: true
comments: false comments: false
sharing: true sharing: true
footer: true footer: true
logo: mysensors.png logo: mysensors.png
ha_category: Light ha_category: Light
featured: false
ha_release: 0.13 ha_release: 0.13
--- ---

View File

@ -2,7 +2,7 @@
layout: page layout: page
title: "MySensors" title: "MySensors"
description: "Instructions how to integrate MySensors sensors into Home Assistant." description: "Instructions how to integrate MySensors sensors into Home Assistant."
date: 2016-08-26 23:00 +0200 date: 2016-10-01 15:00 +0200
sidebar: true sidebar: true
comments: false comments: false
sharing: true sharing: true
@ -10,7 +10,7 @@ footer: true
logo: mysensors.png logo: mysensors.png
ha_category: Hub ha_category: Hub
featured: true featured: true
ha_iot_class: "Local Polling" ha_iot_class: "Local Push"
--- ---
The [MySensors](https://www.mysensors.org) project combines Arduino boards with NRF24L01 radio boards to build sensor networks. The component will automatically add all available devices to Home Assistant, after [presentation](#presentation) is done. The [MySensors](https://www.mysensors.org) project combines Arduino boards with NRF24L01 radio boards to build sensor networks. The component will automatically add all available devices to Home Assistant, after [presentation](#presentation) is done.

View File

@ -2,7 +2,7 @@
layout: page layout: page
title: "MySensors Sensor" title: "MySensors Sensor"
description: "Instructions how to integrate MySensors sensors into Home Assistant." description: "Instructions how to integrate MySensors sensors into Home Assistant."
date: 2016-06-12 15:00 +0200 date: 2016-10-01 15:00 +0200
sidebar: true sidebar: true
comments: false comments: false
sharing: true sharing: true
@ -50,6 +50,15 @@ S_LIGHT_LEVEL | V_LEVEL
S_AIR_QUALITY | V_LEVEL (replaces V_DUST_LEVEL) S_AIR_QUALITY | V_LEVEL (replaces V_DUST_LEVEL)
S_DUST | V_LEVEL (replaces V_DUST_LEVEL) S_DUST | V_LEVEL (replaces V_DUST_LEVEL)
##### MySensors version 2.0 and higher
S_TYPE | V_TYPE
----------------|--------------------------
S_INFO | V_TEXT
S_GAS | V_FLOW, V_VOLUME
S_GPS | V_POSITION
S_WATER_QUALITY | V_TEMP, V_PH, V_ORP, V_EC
### {% linkable_title Custom unit of measurement %} ### {% linkable_title Custom unit of measurement %}
Some sensor value types are not specific for a certain sensor type. These do not have a default unit of measurement in Home Assistant. For example, the V_LEVEL type can be used for different sensor types, dust, sound, vibration etc. Some sensor value types are not specific for a certain sensor type. These do not have a default unit of measurement in Home Assistant. For example, the V_LEVEL type can be used for different sensor types, dust, sound, vibration etc.

View File

@ -2,7 +2,7 @@
layout: page layout: page
title: "MySensors Switch" title: "MySensors Switch"
description: "Instructions how to integrate MySensors switches into Home Assistant." description: "Instructions how to integrate MySensors switches into Home Assistant."
date: 2016-06-12 15:00 +0200 date: 2016-10-01 15:00 +0200
sidebar: true sidebar: true
comments: false comments: false
sharing: true sharing: true
@ -19,7 +19,7 @@ The following actuator types are supported:
##### MySensors version 1.4 and higher ##### MySensors version 1.4 and higher
S_TYPE | V_TYPE S_TYPE | V_TYPE
---------|-------------- ---------|-------------------
S_DOOR | V_ARMED S_DOOR | V_ARMED
S_MOTION | V_ARMED S_MOTION | V_ARMED
S_SMOKE | V_ARMED S_SMOKE | V_ARMED
@ -30,7 +30,7 @@ S_IR | V_IR_SEND, V_LIGHT
##### MySensors version 1.5 and higher ##### MySensors version 1.5 and higher
S_TYPE | V_TYPE S_TYPE | V_TYPE
-------------|------------------ -------------|----------------------
S_LIGHT | V_STATUS S_LIGHT | V_STATUS
S_BINARY | [V_STATUS or V_LIGHT] S_BINARY | [V_STATUS or V_LIGHT]
S_SPRINKLER | V_STATUS S_SPRINKLER | V_STATUS
@ -39,6 +39,12 @@ S_SOUND | V_ARMED
S_VIBRATION | V_ARMED S_VIBRATION | V_ARMED
S_MOISTURE | V_ARMED S_MOISTURE | V_ARMED
##### MySensors version 2.0 and higher
S_TYPE | V_TYPE
----------------|---------
S_WATER_QUALITY | V_STATUS
All V_TYPES for each S_TYPE above are required to activate the actuator for the platform. Use either V_LIGHT or V_STATUS depending on library version for cases where that V_TYPE is required. All V_TYPES for each S_TYPE above are required to activate the actuator for the platform. Use either V_LIGHT or V_STATUS depending on library version for cases where that V_TYPE is required.
For more information, visit the [serial api] of MySensors. For more information, visit the [serial api] of MySensors.