Merge branch 'master' into next
Conflicts: source/_components/sensor.loop_energy.markdown
This commit is contained in:
commit
e7d7175aa1
261 changed files with 3088 additions and 2449 deletions
|
@ -2,7 +2,7 @@
|
|||
layout: page
|
||||
title: "MySensors Binary Sensor"
|
||||
description: "Instructions how to integrate MySensors binary sensors into Home Assistant."
|
||||
date: 2016-02-28 01:20 +0100
|
||||
date: 2016-04-13 14:20 +0100
|
||||
sidebar: true
|
||||
comments: false
|
||||
sharing: true
|
||||
|
@ -36,5 +36,53 @@ S_MOISTURE | V_TRIPPED
|
|||
|
||||
For more information, visit the [serial api] of MySensors.
|
||||
|
||||
### {% linkable_title Example sketch %}
|
||||
|
||||
```cpp
|
||||
/**
|
||||
* Documentation: http://www.mysensors.org
|
||||
* Support Forum: http://forum.mysensors.org
|
||||
*
|
||||
* http://www.mysensors.org/build/binary
|
||||
*/
|
||||
|
||||
|
||||
#include <MySensor.h>
|
||||
#include <SPI.h>
|
||||
#include <Bounce2.h>
|
||||
|
||||
#define SN "BinarySensor"
|
||||
#define SV "1.0"
|
||||
#define CHILD_ID 1
|
||||
#define BUTTON_PIN 3 // Arduino Digital I/O pin for button/reed switch.
|
||||
|
||||
MySensor gw;
|
||||
Bounce debouncer = Bounce();
|
||||
MyMessage msg(CHILD_ID, V_TRIPPED);
|
||||
|
||||
void setup()
|
||||
{
|
||||
gw.begin();
|
||||
gw.sendSketchInfo(SN, SV);
|
||||
// Setup the button.
|
||||
pinMode(BUTTON_PIN, INPUT_PULLUP);
|
||||
// After setting up the button, setup debouncer.
|
||||
debouncer.attach(BUTTON_PIN);
|
||||
debouncer.interval(5);
|
||||
gw.present(CHILD_ID, S_DOOR);
|
||||
gw.send(msg.set(0));
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
if (debouncer.update()) {
|
||||
// Get the update value.
|
||||
int value = debouncer.read();
|
||||
// Send in the new value.
|
||||
gw.send(msg.set(value == LOW ? 1 : 0));
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
[main component]: /components/mysensors/
|
||||
[serial api]: https://www.mysensors.org/download/serial_api_15
|
||||
|
|
|
@ -18,7 +18,7 @@ The `rpi` platform allows you to integrate the Raspberry Pi camera into Home Ass
|
|||
```yaml
|
||||
# Example configuration.yaml entry
|
||||
camera:
|
||||
platform: raspberry_camera
|
||||
platform: rpi_camera
|
||||
name: Raspberry Pi Camera
|
||||
image_width: 640
|
||||
image_height: 480
|
||||
|
@ -34,10 +34,12 @@ Configuration variables:
|
|||
|
||||
- **name** (optional): name of the camera
|
||||
- **image_width** (optional): set the image width (default: 640)
|
||||
- **image_height** (optional): set the image width (default: 480)
|
||||
- **image_height** (optional): set the image height (default: 480)
|
||||
- **image_quality** (optional): set the image quality (from 0 to 100, default: 7)
|
||||
- **image_rotation** (optional): Set image rotation (0-359, default: 0)
|
||||
- **horizontal_flip** (optional): Set horizontal flip (0 to disable, 1 to enable, default: 0)
|
||||
- **vertical_flip** (optional): Set vertical flip (0 to disable, 1 to enable, default: 0)
|
||||
- **timelapse** (optional): Takes a picture every <t>ms (default: 1000)
|
||||
- **file_path** (optional): Save the picture in a custom file path (default: camera components folder)
|
||||
|
||||
The given **file_path** must be an existing file because the camera platform setup make a writeable check on it.
|
||||
|
|
|
@ -21,6 +21,6 @@ The configurator component allows components to request information from the use
|
|||
- Input fields can be defined with a description, and optional type
|
||||
- It will trigger a callback when the button is pressed
|
||||
|
||||
The Hue component in [the demo](/demo) and Plex are implemented using the configurator. See [the source of the demo component](https://github.com/balloob/home-assistant/blob/master/homeassistant/components/demo.py#L132) for a simple example.
|
||||
The Hue component in [the demo](/demo) and Plex are implemented using the configurator. See [the source of the demo component](https://github.com/home-assistant/home-assistant/blob/master/homeassistant/components/demo.py#L132) for a simple example.
|
||||
|
||||
See [the source](https://github.com/balloob/home-assistant/blob/master/homeassistant/components/configurator.py#L39) for more details on how to use the configurator component.
|
||||
See [the source](https://github.com/home-assistant/home-assistant/blob/master/homeassistant/components/configurator.py#L39) for more details on how to use the configurator component.
|
||||
|
|
|
@ -37,9 +37,13 @@ If running home-assistant in a docker container use switch `--net=host` to put i
|
|||
If you are developing a new platform, please read [how to make your platform discoverable]({{site_root}}/developers/add_new_platform/#discovery).
|
||||
|
||||
<p class='note warning'>
|
||||
There is currently a <a href='https://bitbucket.org/al45tair/netifaces/issues/17/dll-fails-to-load-windows-81-64bit'>known issue</a> with running this platform on a 64-bit version of Python.
|
||||
There is currently a <a href='https://bitbucket.org/al45tair/netifaces/issues/17/dll-fails-to-load-windows-81-64bit'>known issue</a> with running this platform on a 64-bit version of Python and Windows.
|
||||
</p>
|
||||
|
||||
<p class='note'>
|
||||
If you are on Windows and you're using Python 3.5, download the Netifaces dependency <a href='http://www.lfd.uci.edu/~gohlke/pythonlibs/#netifaces'>here</a>.
|
||||
</p>
|
||||
|
||||
<p class='note'>
|
||||
If you see `Not initializing discovery because could not install dependency netdisco==0.6.1` in the logs, you will need to install the `python3-dev` or `python3-devel` package on your system manually (eg. `sudo apt-get install python3-dev` or `sudo dnf -y install python3-devel`). On the next restart of home-assistant, discovery should work. If you still get an error, check if you have a compiler (`gcc`) available on your system.
|
||||
</p>
|
||||
|
|
|
@ -11,8 +11,15 @@ logo: wink.png
|
|||
ha_category: Garage Door
|
||||
---
|
||||
|
||||
Wink garage door functionality is currently limited to view only. Wink garage doors will still show the current state of the door, but control has been disabled for third parties. If you have a Chamberlain garage door, and would like to control it via Home Assistant, please contact Chamberlain and request that they re-enabled third-party control.
|
||||
|
||||
The Wink garage door platform allows you to control your [Wink](http://www.wink.com/) enabled garage door.
|
||||
The following quote is from Wink.
|
||||
|
||||
<blockquote>
|
||||
As part of our agreement with Chamberlain, third-party access to control Chamberlain garage doors has been restricted. Please contact Chamberlain directly to inquire about permissions.
|
||||
</blockquote>
|
||||
|
||||
~~The Wink garage door platform allows you to control your [Wink](http://www.wink.com/) enabled garage door.~~
|
||||
|
||||
The requirement is that you have setup your [Wink hub](/components/wink/).
|
||||
|
||||
|
|
|
@ -31,10 +31,12 @@ Configuration variables:
|
|||
- **ssl_certificate** (*Optional*): Path to your TLS/SSL certificate to serve Home Assistant over a secure connection.
|
||||
- **ssl_key** (*Optional*): Path to your TLS/SSL key to serve Home Assistant over a secure connection.
|
||||
|
||||
On top of the `http` component is a [REST API](/developers/rest_api/) and a [Python API](/developers/python_api/) available.
|
||||
The [Set up encryption using Let's Encrypt](/blog/2015/12/13/setup-encryption-using-lets-encrypt/) blog post gives you details about the encryption of your traffic using free certificates from [Let's Encrypt](https://letsencrypt.org/).
|
||||
|
||||
On top of the `http` component is a [REST API](/developers/rest_api/) and a [Python API](/developers/python_api/) available. There is also support for [Server-sent events](/developers/server_sent_events/) available.
|
||||
|
||||
The `http` platforms are not real platforms within the meaning of the terminology used around Home Assistant. Home Assistant's [REST API](/developers/rest_api/) sends and receives messages over HTTP.
|
||||
|
||||
To use those kind of sensors in your installation no configuration in Home Assistant is needed. All configuration is done on the devices themselves. This means that you must be able to edit the target URL or endpoint and the payload. The entity will be created after the first message has arrived.
|
||||
To use those kind of [sensors](/components/sensor.http/) or [binary sensors](components/binary_sensor.http/) in your installation no configuration in Home Assistant is needed. All configuration is done on the devices themselves. This means that you must be able to edit the target URL or endpoint and the payload. The entity will be created after the first message has arrived.
|
||||
|
||||
All [requests](/developers/rest_api/#post-apistatesltentity_id) need to be sent to the endpoint of the device and must be **POST**.
|
||||
|
|
|
@ -11,7 +11,7 @@ logo: home-assistant.png
|
|||
ha_category: Automation
|
||||
---
|
||||
|
||||
The `input_select` component allows the user to define a list of values that can be selected via the frontend and can be used within conditions of automation.
|
||||
The `input_select` component allows the user to define a list of values that can be selected via the frontend and can be used within conditions of automation. When a user selectes a new item, a state transition event is generated. This state event can be used in an `automation` trigger.
|
||||
|
||||
To enable this platform, add the following lines to your `configuration.yaml`:
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ logo: home-assistant.png
|
|||
ha_category: Automation
|
||||
---
|
||||
|
||||
The `input_slider` component allows the user to define values that can be controlled via the frontend and can be used within conditions of automation.
|
||||
The `input_slider` component allows the user to define values that can be controlled via the frontend and can be used within conditions of automation. Changes to the slider generate state events. These state events can be utilized as `automation` triggers as well.
|
||||
|
||||
```yaml
|
||||
# Example configuration.yaml entry
|
||||
|
@ -21,6 +21,7 @@ input_slider:
|
|||
initial: 30
|
||||
min: -20
|
||||
max: 35
|
||||
step: 1
|
||||
```
|
||||
|
||||
Configuration variables:
|
||||
|
@ -30,4 +31,5 @@ Configuration variables:
|
|||
- **initial** (*Optional*): Initial value when Home Assistant starts.
|
||||
- **min** (*Optional*): Minimum value for the slider.
|
||||
- **max** (*Optional*): Maximum value for the slider.
|
||||
- **step** (*Optional*): Step value for the slider.
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ footer: true
|
|||
|
||||
This component allows you to track and control various light bulbs.
|
||||
|
||||
It has [4 built-in light profiles](https://github.com/balloob/home-assistant/blob/master/homeassistant/components/light/light_profiles.csv) which you're able to extend by putting a `light_profiles.csv` file in your config dir.
|
||||
It has [4 built-in light profiles](https://github.com/home-assistant/home-assistant/blob/master/homeassistant/components/light/light_profiles.csv) which you're able to extend by putting a `light_profiles.csv` file in your config dir.
|
||||
|
||||
Preferred way to setup the Philips Hue platform is through the [the discovery component]({{site_root}}/components/discovery/). For the Wink light platform enable [the wink component]({{site_root}}/components/wink/).
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
layout: page
|
||||
title: "MySensors Light"
|
||||
description: "Instructions how to integrate MySensors lights into Home Assistant."
|
||||
date: 2016-03-02 18:20 +0100
|
||||
date: 2016-04-13 14:20 +0100
|
||||
sidebar: true
|
||||
comments: false
|
||||
sharing: true
|
||||
|
@ -33,5 +33,80 @@ V_TYPES with a star (\*) denotes required V_TYPES. Use either V_LIGHT or V_STATU
|
|||
|
||||
For more information, visit the [serial api] of MySensors.
|
||||
|
||||
### {% linkable_title Example sketch %}
|
||||
|
||||
```cpp
|
||||
/*
|
||||
* Documentation: http://www.mysensors.org
|
||||
* Support Forum: http://forum.mysensors.org
|
||||
*
|
||||
* http://www.mysensors.org/build/dimmer
|
||||
*/
|
||||
|
||||
#include <MySensor.h>
|
||||
#include <SPI.h>
|
||||
|
||||
#define SN "DimmableRGBLED"
|
||||
#define SV "1.0"
|
||||
#define CHILD_ID 1
|
||||
#define LED_PIN 5
|
||||
|
||||
MySensor gw;
|
||||
|
||||
char rgb[7] = "ffffff"; // RGB value.
|
||||
int currentLevel = 0; // Current dimmer level.
|
||||
MyMessage dimmerMsg(CHILD_ID, V_PERCENTAGE);
|
||||
MyMessage lightMsg(CHILD_ID, V_STATUS);
|
||||
MyMessage rgbMsg(CHILD_ID, V_RGB);
|
||||
|
||||
void setup()
|
||||
{
|
||||
gw.begin(incomingMessage);
|
||||
gw.sendSketchInfo(SN, SV);
|
||||
gw.present(CHILD_ID, S_RGB_LIGHT);
|
||||
// Send initial values.
|
||||
gw.send(lightMsg.set(currentLevel > 0 ? 1 : 0));
|
||||
gw.send(dimmerMsg.set(currentLevel));
|
||||
gw.send(rgbMsg.set(rgb));
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
gw.process();
|
||||
}
|
||||
|
||||
void incomingMessage(const MyMessage &message) {
|
||||
if (message.type == V_RGB) {
|
||||
// Retrieve the RGB value from the incoming message.
|
||||
// RGB LED not implemented, just a dummy print.
|
||||
String hexstring = message.getString();
|
||||
hexstring.toCharArray(rgb, sizeof(rgb));
|
||||
Serial.print("Changing color to ");
|
||||
Serial.println(rgb);
|
||||
gw.send(rgbMsg.set(rgb));
|
||||
}
|
||||
|
||||
if (message.type == V_STATUS || message.type == V_PERCENTAGE) {
|
||||
// Retrieve the light status or dimmer level from the incoming message.
|
||||
int requestedLevel = atoi(message.data);
|
||||
|
||||
// Adjust incoming level if this is a V_LIGHT update [0 == off, 1 == on].
|
||||
requestedLevel *= (message.type == V_STATUS ? 100 : 1);
|
||||
|
||||
// Clip incoming level to valid range of 0 to 100
|
||||
requestedLevel = requestedLevel > 100 ? 100 : requestedLevel;
|
||||
requestedLevel = requestedLevel < 0 ? 0 : requestedLevel;
|
||||
|
||||
// Change level value of LED pin.
|
||||
analogWrite(LED_PIN, (int)(requestedLevel / 100. * 255));
|
||||
currentLevel = requestedLevel;
|
||||
|
||||
// Update the gateway with the current V_STATUS and V_PERCENTAGE.
|
||||
gw.send(lightMsg.set(currentLevel > 0 ? 1 : 0));
|
||||
gw.send(dimmerMsg.set(currentLevel));
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
[main component]: /components/mysensors/
|
||||
[serial api]: https://www.mysensors.org/download/serial_api_15
|
||||
|
|
|
@ -21,10 +21,4 @@ To use your TellStick device in your installation, add the following to your `co
|
|||
# Example configuration.yaml entry
|
||||
light:
|
||||
platform: tellstick
|
||||
signal_repetitions: 3
|
||||
```
|
||||
|
||||
Configuration variables:
|
||||
|
||||
- **signal_repetitions** *Optional*: Because the tellstick sends its actions via radio and from most receivers it's impossible to know if the signal was received or not. Therefore you can configure the switch to try to send each signal repeatedly.
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ Supported devices:
|
|||
|
||||
- Denon DRA-N5
|
||||
- Denon RCD-N8 (untested)
|
||||
- Denon RCD-N9 (partial support)
|
||||
|
||||
To add a Denon Network Receiver to your installation, add the following to your `configuration.yaml` file:
|
||||
|
||||
|
|
|
@ -80,13 +80,13 @@ automation:
|
|||
|
||||
input_select:
|
||||
receiver_source:
|
||||
name: Source
|
||||
options:
|
||||
- HTPC
|
||||
- Chromecast
|
||||
- Wii U
|
||||
- Bluray
|
||||
- Raspberry Pi
|
||||
initial: None
|
||||
name: Source
|
||||
options:
|
||||
- HTPC
|
||||
- Chromecast
|
||||
- Wii U
|
||||
- Bluray
|
||||
- Raspberry Pi
|
||||
initial: None
|
||||
```
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ Currently known supported models:
|
|||
|
||||
- TX-P42STW50
|
||||
|
||||
If your model is not on the list then give it a test, if everything works correctly then add it to the list on [GitHub](https://github.com/balloob/home-assistant.io).
|
||||
If your model is not on the list then give it a test, if everything works correctly then add it to the list on [GitHub](https://github.com/home-assistant/home-assistant.io).
|
||||
|
||||
To add a TV to your installation, add the following to your `configuration.yaml` file:
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ Currently known supported models:
|
|||
- D8000
|
||||
- ES5500
|
||||
- ES6800
|
||||
- F6500
|
||||
|
||||
If your model is not on the list then give it a test, if everything works correctly then add it to the list on [GitHub](https://github.com/balloob/home-assistant.io).
|
||||
If your model is not on the list then give it a test, if everything works correctly then add it to the list on [GitHub](https://github.com/home-assistant/home-assistant.io).
|
||||
The two letters at the beginning of the model number represent the region, UE is Europe, UN is North America and UA is Asia & Australia. The two numbers following that represent the screen size. If you add your model remember to remove these before adding them to the list.
|
||||
|
|
|
@ -11,10 +11,6 @@ logo: yamaha.png
|
|||
ha_category: Media Player
|
||||
---
|
||||
|
||||
<p class='note warning'>
|
||||
Some users are experiencing errors loading the frontend while using this platform.
|
||||
</p>
|
||||
|
||||
The `yamaha` platform allows you to control [Yamaha Network Receivers](http://usa.yamaha.com/products/audio-visual/av-receivers-amps/rx) from Home Assistant.
|
||||
|
||||
Supported devices:
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
layout: page
|
||||
title: "MySensors"
|
||||
description: "Instructions how to integrate MySensors sensors into Home Assistant."
|
||||
date: 2016-02-18 20:13 +0100
|
||||
date: 2016-04-13 14:20 +0100
|
||||
sidebar: true
|
||||
comments: false
|
||||
sharing: true
|
||||
|
@ -31,7 +31,7 @@ mysensors:
|
|||
debug: true
|
||||
persistence: true
|
||||
version: '1.5'
|
||||
optimistic: 'true'
|
||||
optimistic: false
|
||||
```
|
||||
|
||||
Configuration variables:
|
||||
|
|
|
@ -35,9 +35,17 @@ Once loaded, the `notify` platform will expose a service that can be called to s
|
|||
| `title` | yes | Title of the notification. Default is `Home Assistant`.
|
||||
| `target` | yes | Some platforms will allow specifying a recipient that will receive the notification. See your platform page if it is supported.
|
||||
|
||||
The notification component supports specifying [templates] for both the `message` and the `title`. This will allow you to use the current state of Home Assistant in your notifications.
|
||||
The notification component supports specifying [templates](/topics/templating/) for both the `message` and the `title`. This will allow you to use the current state of Home Assistant in your notifications.
|
||||
|
||||
[templates]: /topics/templating/
|
||||
In an [action](https://home-assistant.io/components/automation/#actions) of your [automation setup](/components/automation/) it could look like this with a customized subject.
|
||||
|
||||
```yaml
|
||||
action:
|
||||
service: notify.notify
|
||||
data:
|
||||
message: "Your message goes here"
|
||||
title: "Custom subject"
|
||||
```
|
||||
|
||||
### {% linkable_title Test if it works %}
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ notify:
|
|||
sender: YOUR_JID
|
||||
password: YOUR_JABBER_ACCOUNT_PASSWORD
|
||||
recipient: YOUR_RECIPIENT
|
||||
tls: False
|
||||
```
|
||||
|
||||
Configuration variables:
|
||||
|
@ -29,7 +30,8 @@ Configuration variables:
|
|||
- **name** (*Optional*): Setting the optional parameter `name` allows multiple notifiers to be created. The default value is `notify`. The notifier will bind to the service `notify.NOTIFIER_NAME`.
|
||||
- **sender** (*Required*): The Jabber ID (JID) that will act as origin of the messages. Add your JID including the domain, eg. your_name@jabber.org.
|
||||
- **password** (*Required*): The password for your given Jabber account.
|
||||
- **priority** (*Required*): The Jabber ID (JID) that will receive the messages.
|
||||
- **recipient** (*Required*): The Jabber ID (JID) that will receive the messages.
|
||||
- **tls** (*Optional*): Allow to disable TLS. Defaults to true.
|
||||
|
||||
All Jabber IDs (JID) must include the domain. Make sure that the password matches the account provided as sender.
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ sensor:
|
|||
platform: dweet
|
||||
name: Dweet.io Temperature
|
||||
device: THING_NAME
|
||||
value_template: '{{ value_json.VARIABLE }}'
|
||||
value_template: '{% raw %}{{ value_json.VARIABLE }}{% endraw %}'
|
||||
unit_of_measurement: "°C"
|
||||
```
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ You can then open your browser's console window, how you do this varies by brows
|
|||
|
||||
This should show something like
|
||||
|
||||
```javascript
|
||||
```yaml
|
||||
client_ip: "127.0.0.1"
|
||||
gas_secret: "GAS_SECRET"
|
||||
gas_serial: "GAS_SERIAL"
|
||||
|
@ -44,8 +44,8 @@ Now you have the keys, add the following lines to your `configuration.yaml`, rep
|
|||
# Example configuration.yaml entry
|
||||
sensor:
|
||||
platform: loopenergy
|
||||
electricity_serial: ELECRITCAL_SERIAL
|
||||
electricity_secret: ELECTRICAL_OFFSET
|
||||
electricity_serial: ELECTRICAL_SERIAL
|
||||
electricity_secret: ELECTRICAL_SECRET
|
||||
gas_serial: GAS_SERIAL
|
||||
gas_secret: GAS_SECRET
|
||||
gas_type: metric
|
||||
|
@ -63,3 +63,4 @@ Configuration variables:
|
|||
|
||||
The electricity readings are updated every 10 seconds and the gas readings every 15 minutes.
|
||||
|
||||
The gas readings are experimental and not all gas meters are properly supported - so if the data you see doesn't agree with the readings you see via loop energy please report an issue.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
layout: page
|
||||
title: "MySensors Sensor"
|
||||
description: "Instructions how to integrate MySensors sensors into Home Assistant."
|
||||
date: 2016-02-28 01:20 +0100
|
||||
date: 2016-04-13 14:20 +0100
|
||||
sidebar: true
|
||||
comments: false
|
||||
sharing: true
|
||||
|
@ -58,5 +58,53 @@ By using V_UNIT_PREFIX, it's possible to set a custom unit for any sensor. The s
|
|||
|
||||
For more information, visit the [serial api] of MySensors.
|
||||
|
||||
### {% linkable_title Example sketch %}
|
||||
|
||||
```cpp
|
||||
/**
|
||||
* Documentation: http://www.mysensors.org
|
||||
* Support Forum: http://forum.mysensors.org
|
||||
*
|
||||
* http://www.mysensors.org/build/light
|
||||
*/
|
||||
|
||||
#include <SPI.h>
|
||||
#include <MySensor.h>
|
||||
#include <BH1750.h>
|
||||
#include <Wire.h>
|
||||
|
||||
#define SN "LightLuxSensor"
|
||||
#define SV "1.0"
|
||||
#define CHILD_ID 1
|
||||
unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds)
|
||||
|
||||
BH1750 lightSensor;
|
||||
MySensor gw;
|
||||
MyMessage msg(CHILD_ID, V_LEVEL);
|
||||
MyMessage msgPrefix(CHILD_ID, V_UNIT_PREFIX); // Custom unit message.
|
||||
uint16_t lastlux = 0;
|
||||
|
||||
void setup()
|
||||
{
|
||||
gw.begin();
|
||||
gw.sendSketchInfo(SN, SV);
|
||||
gw.present(CHILD_ID, S_LIGHT_LEVEL);
|
||||
lightSensor.begin();
|
||||
gw.send(msg.set(lastlux));
|
||||
gw.send(msgPrefix.set("lux")); // Set custom unit.
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
uint16_t lux = lightSensor.readLightLevel(); // Get Lux value
|
||||
if (lux != lastlux) {
|
||||
gw.send(msg.set(lux));
|
||||
lastlux = lux;
|
||||
}
|
||||
|
||||
gw.sleep(SLEEP_TIME);
|
||||
}
|
||||
```
|
||||
|
||||
[main component]: /components/mysensors/
|
||||
[serial api]: https://www.mysensors.org/download/serial_api_15
|
||||
|
|
|
@ -103,3 +103,4 @@ switch:
|
|||
offcmd: 'curl -k "https://ipaddress:443/cgi-bin/CGIProxy.fcgi?cmd=setMotionDetectConfig&isEnable=0&usr=admin&pwd=password"'
|
||||
statecmd: 'curl -k --silent "https://ipaddress:443/cgi-bin/CGIProxy.fcgi?cmd=getMotionDetectConfig&usr=admin&pwd=password" | grep -oP "(?<=isEnable>).*?(?=</isEnable>)"'
|
||||
value_template: '{{ value == "1" }}'
|
||||
```
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
layout: page
|
||||
title: "MySensors Switch"
|
||||
description: "Instructions how to integrate MySensors switches into Home Assistant."
|
||||
date: 2016-03-02 18:20 +0100
|
||||
date: 2016-04-13 14:20 +0100
|
||||
sidebar: true
|
||||
comments: false
|
||||
sharing: true
|
||||
|
@ -40,5 +40,50 @@ S_MOISTURE | V_ARMED
|
|||
|
||||
For more information, visit the [serial api] of MySensors.
|
||||
|
||||
### {% linkable_title Example sketch %}
|
||||
|
||||
```cpp
|
||||
/*
|
||||
* Documentation: http://www.mysensors.org
|
||||
* Support Forum: http://forum.mysensors.org
|
||||
*
|
||||
* http://www.mysensors.org/build/relay
|
||||
*/
|
||||
|
||||
#include <MySensor.h>
|
||||
#include <SPI.h>
|
||||
|
||||
#define SN "Relay"
|
||||
#define SV "1.0"
|
||||
#define CHILD_ID 1
|
||||
#define RELAY_PIN 3
|
||||
|
||||
MySensor gw;
|
||||
MyMessage msgRelay(CHILD_ID, V_STATUS);
|
||||
|
||||
void setup()
|
||||
{
|
||||
gw.begin(incomingMessage);
|
||||
gw.sendSketchInfo(SN, SV);
|
||||
// Initialize the digital pin as an output.
|
||||
pinMode(RELAY_PIN, OUTPUT);
|
||||
gw.present(CHILD_ID, S_BINARY);
|
||||
gw.send(msgRelay.set(0));
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
gw.process();
|
||||
}
|
||||
|
||||
void incomingMessage(const MyMessage &message)
|
||||
{
|
||||
if (message.type == V_STATUS) {
|
||||
// Change relay state.
|
||||
digitalWrite(RELAY_PIN, message.getBool() ? 1 : 0);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
[main component]: /components/mysensors/
|
||||
[serial api]: https://www.mysensors.org/download/serial_api_15
|
||||
|
|
|
@ -21,10 +21,4 @@ To use your TellStick device in your installation, add the following to your `co
|
|||
# Example configuration.yaml entry
|
||||
switch:
|
||||
platform: tellstick
|
||||
signal_repetitions: 3
|
||||
```
|
||||
|
||||
Configuration variables:
|
||||
|
||||
- **signal_repetitions** *Optional*: Because the tellstick sends its actions via radio and from most receivers it's impossible to know if the signal was received or not. Therefore you can configure the switch to try to send each signal repeatedly.
|
||||
|
||||
|
|
|
@ -21,3 +21,8 @@ To get started, add the devices to your `configuration.yaml` file.
|
|||
tellstick:
|
||||
signal_repetitions: X
|
||||
```
|
||||
|
||||
Configuration variables:
|
||||
|
||||
- **signal_repetitions** *Optional*: Because the tellstick sends its actions via radio and from most receivers it's impossible to know if the signal was received or not. Therefore you can configure the switch and light to try to send each signal repeatedly.
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ logo: vera.png
|
|||
ha_category: Hub
|
||||
---
|
||||
|
||||
The [Vera](http://getvera.com) hub is a controller ainly connecting to Z-Wave devices.
|
||||
The [Vera](http://getvera.com) hub is a controller mainly connecting to Z-Wave devices.
|
||||
|
||||
Switches, Lights (inc Dimmers), Sensors and Binary sensors are supported - and will be automaticaly added when HA connects to your Vera controller.
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ Configuration variables:
|
|||
- **longitude** (*Required*): Longitude of the center point of the zone.
|
||||
- **radius** (*Optional*): Optional radius in meters. Defaults to 100 meters.
|
||||
- **icon** (*Optional*): Optional icon to show instead of name.
|
||||
|
||||
- **passive** (*Optional*): Optional boolean to only use the zone for automation and hide it from the UI and not use the zone for device tracker name. Defaults to false.
|
||||
|
||||
#### {% linkable_title Home zone %}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue