mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 17:27:19 +00:00
Update docs for mysensors
* Update config and text for mysensors ethernet gateway. * Update example sketch for mysensors switch.
This commit is contained in:
parent
9ac2dbdf7c
commit
8116de20e7
@ -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-04-13 14:20 +0100
|
date: 2016-04-21 13:30 +0100
|
||||||
sidebar: true
|
sidebar: true
|
||||||
comments: false
|
comments: false
|
||||||
sharing: true
|
sharing: true
|
||||||
@ -16,7 +16,7 @@ The [MySensors](https://www.mysensors.org) project combines Arduino boards with
|
|||||||
|
|
||||||
### {% linkable_title Configuration %}
|
### {% linkable_title Configuration %}
|
||||||
|
|
||||||
Integrate your Serial MySensors Gateway by adding the following to your `configuration.yaml` file:
|
Integrate your Serial or Ethernet MySensors Gateway by adding the following to your `configuration.yaml` file:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
# Example configuration.yaml entry
|
# Example configuration.yaml entry
|
||||||
@ -39,15 +39,16 @@ mysensors:
|
|||||||
|
|
||||||
Configuration variables:
|
Configuration variables:
|
||||||
|
|
||||||
- **port** (*Required*): The port where your board is connected to your Home Assistant host.
|
- **device** (*Required*): The path to the serial gateway where it is connected to your Home Assistant host, or the address of the tcp ethernet gateway. Resolving DNS addresses is theoretically supported but not tested.
|
||||||
|
- **baud_rate** (*Optional*): Specifies the baud rate of the connected serial gateway. Default is 115200.
|
||||||
|
- **tcp_port** (*Optional*): Specifies the port of the connected tcp ethernet gateway. Default is 5003.
|
||||||
- **debug** (*Optional*): Enable or disable verbose debug logging. Default is false.
|
- **debug** (*Optional*): Enable or disable verbose debug logging. Default is false.
|
||||||
- **persistence** (*Optional*): Enable or disable local persistence of sensor information. If this is disabled, then each sensor will need to send presentation messages after Home Assistant starts. Default is true.
|
- **persistence** (*Optional*): Enable or disable local persistence of sensor information. If this is disabled, then each sensor will need to send presentation messages after Home Assistant starts. Default is true.
|
||||||
- **persistence_file** (*Optional*): Path to a file to save sensor information. The file extension determines the file type. Currently supported file types are 'pickle' and 'json'.
|
- **persistence_file** (*Optional*): The path to a file to save sensor information. The file extension determines the file type. Currently supported file types are 'pickle' and 'json'.
|
||||||
- **version** (*Optional*): Specifies the MySensors protocol version to use. Supports 1.4 and 1.5. Default is 1.4.
|
- **version** (*Optional*): Specifies the MySensors protocol version to use. Supports 1.4 and 1.5. Default is 1.4.
|
||||||
- **baud_rate** (*Optional*): Specifies baud rate of the connected gateway. Default is 115200.
|
|
||||||
- **optimistic** (*Optional*): Enable or disable optimistic mode for actuators (switch/light). Default is false. Set this to true if no state feedback from actuators is possible. Home Assistant will assume that the command succeeded and change state.
|
- **optimistic** (*Optional*): Enable or disable optimistic mode for actuators (switch/light). Default is false. Set this to true if no state feedback from actuators is possible. Home Assistant will assume that the command succeeded and change state.
|
||||||
|
|
||||||
If you are using an original Arduino the port will be named `ttyACM*`. The exact number can be determined with the command shown below.
|
If you are using an original Arduino as a serial gateway, the port will be named `ttyACM*`. The exact number can be determined with the command shown below.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ ls /dev/ttyACM*
|
$ ls /dev/ttyACM*
|
||||||
@ -57,12 +58,12 @@ $ ls /dev/ttyACM*
|
|||||||
|
|
||||||
Present a MySensors sensor or actuator, by following these steps:
|
Present a MySensors sensor or actuator, by following these steps:
|
||||||
|
|
||||||
1. Connect your gateway to your computer.
|
1. Connect the serial gateway to your computer or the ethernet gateway to your network.
|
||||||
2. Configure the MySensors component in configuration.yaml.
|
2. Configure the MySensors component in configuration.yaml.
|
||||||
3. Start hass.
|
3. Start hass.
|
||||||
4. Wait for "gateway started" in the log output.
|
4. Wait for "Connected to [device]" in the log output.
|
||||||
5. Write and upload your MySensors sketch to the sensor. Make sure you:
|
5. Write and upload your MySensors sketch to the sensor. Make sure you:
|
||||||
- Either use a manual node id, or AUTO for requesting a node id from the controller, in gw.begin().
|
- Either use a manual node id, or AUTO for requesting a node id from the controller, in the begin method for initialization of the MySensors library.
|
||||||
- Send sketch name.
|
- Send sketch name.
|
||||||
- Present the sensor's S_TYPE.
|
- Present the sensor's S_TYPE.
|
||||||
- Send at least one initial value per V_TYPE.
|
- Send at least one initial value per V_TYPE.
|
||||||
|
@ -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-04-13 14:20 +0100
|
date: 2016-04-21 13:30 +0100
|
||||||
sidebar: true
|
sidebar: true
|
||||||
comments: false
|
comments: false
|
||||||
sharing: true
|
sharing: true
|
||||||
@ -81,6 +81,7 @@ void incomingMessage(const MyMessage &message)
|
|||||||
if (message.type == V_STATUS) {
|
if (message.type == V_STATUS) {
|
||||||
// Change relay state.
|
// Change relay state.
|
||||||
digitalWrite(RELAY_PIN, message.getBool() ? 1 : 0);
|
digitalWrite(RELAY_PIN, message.getBool() ? 1 : 0);
|
||||||
|
gw.send(msgRelay.set(message.getBool() ? 1 : 0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user