Merge branch 'current' into next

This commit is contained in:
Franck Nijhof 2022-10-25 08:41:12 +02:00
commit 39152f349c
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3
9 changed files with 116 additions and 18 deletions

View File

@ -44,10 +44,14 @@ ifttt:
key: ["nope"] key: ["nope"]
mqtt: mqtt:
broker: 127.0.0.1 sensor:
- name: "test sensor 1"
state_topic: "test/some_topic1"
- name: "test sensor 2"
state_topic: "test/some_topic2"
``` ```
As with the core snippet, indentation makes a difference. The integration headers (`mqtt:`) should be fully left aligned (aka no indent), and the parameters (`broker:`) should be indented two (2) spaces. As with the core snippet, indentation makes a difference. The integration headers (`mqtt:`) should be fully left aligned (aka no indent), and the key (`sensor:`) should be indented two (2) spaces. The list `-` under the key `sensor` should be indented another two (2) spaces followed by a single space. The `mqtt` sensor list contains two (2) configurations containing two (2) keys each.
While some of these integrations can technically be moved to a separate file they are so small or "one off's" where splitting them off is superfluous. Also, you'll notice the # symbol (hash/pound). This represents a "comment" as far as the commands are interpreted. Put another way, any line prefixed with a `#` will be ignored. This makes breaking up files for human readability really convenient, not to mention turning off features while leaving the entry intact. While some of these integrations can technically be moved to a separate file they are so small or "one off's" where splitting them off is superfluous. Also, you'll notice the # symbol (hash/pound). This represents a "comment" as far as the commands are interpreted. Put another way, any line prefixed with a `#` will be ignored. This makes breaking up files for human readability really convenient, not to mention turning off features while leaving the entry intact.

View File

@ -119,7 +119,7 @@ Your Home Assistant instance needs to be connected to the same network as the Go
Your Google Assistant devices will still communicate via the internet to: Your Google Assistant devices will still communicate via the internet to:
- Get credentials to establish a local connection. - Get credentials to establish a local connection.
- Send commands that involve a [secure device](#secure-device). - Send commands that involve a [secure device](#secure-devices).
- Send commands if local fulfillment fails. - Send commands if local fulfillment fails.
<div class='note'> <div class='note'>

View File

@ -106,6 +106,18 @@ The following is a description of the various diagnostic error sensors and what
The IFT module can suffer a variety of issues that will render it inoperable. Some of these have been confirmed by the manufacturer and some appear to be random. There are two paths to try when attempting to reset the module: The IFT module can suffer a variety of issues that will render it inoperable. Some of these have been confirmed by the manufacturer and some appear to be random. There are two paths to try when attempting to reset the module:
#### Enabling Debugging
To turn on debug logging modify your `configuration.yaml` file in the `/config` directory and add the following:
```yaml
logger:
logs:
homeassistant.components.intellifire: debug
intellifire4py: debug
```
#### Issue a Soft Reset #### Issue a Soft Reset
There is a debug web interface available at [iftapi.net/webaccess](http://iftapi.net/webaccess/login.html). From here you can log in and then navigate to your individual fireplace unit and issue a **Soft Reset** as follows: There is a debug web interface available at [iftapi.net/webaccess](http://iftapi.net/webaccess/login.html). From here you can log in and then navigate to your individual fireplace unit and issue a **Soft Reset** as follows:

View File

@ -22,15 +22,15 @@ ha_quality_scale: platinum
ha_dhcp: true ha_dhcp: true
--- ---
The LIFX integration automatically discovers [LIFX](https://www.lifx.com) bulbs on your network and adds them to Home Assistant. The LIFX integration automatically discovers [LIFX](https://www.lifx.com) lights on each network that is enabled in Home Assistant's [network configuration](/integrations/network). Suppose any of your LIFX lights are not automatically discovered. In that case, you can add them manually using the user interface by following the configuration steps below for each light you want to add:
{% include integrations/config_flow.md %} {% include integrations/config_flow.md %}
## Set state ## Set state
The LIFX bulbs allow a change of color and brightness even when they are turned off. This way you can control the light during the day so its settings are correct when events for turning on are received, for example from motion detectors or external buttons. LIFX lights allow a change of color and brightness even when they are turned off. This way, you can control the light during the day, so its settings are correct when events for turning on are received, for example, from motion detectors or external buttons.
The normal `light.turn_on` call cannot be used for this because it always turns the power on. Thus, LIFX has its own service call that allows color changes without affecting the current power state. The normal `light.turn_on` call cannot be used for this because it always turns the power on. Thus, LIFX has its own `set_state` service that allows color changes without affecting the current power state.
### Service `lifx.set_state` ### Service `lifx.set_state`
@ -40,10 +40,18 @@ Change the light to a new state.
| ---------------------- | ----------- | | ---------------------- | ----------- |
| `entity_id` | String or list of strings that point at `entity_id`s of lights. Use `entity_id: all` to target all. | `entity_id` | String or list of strings that point at `entity_id`s of lights. Use `entity_id: all` to target all.
| `transition` | Duration (in seconds) for the light to fade to the new state. | `transition` | Duration (in seconds) for the light to fade to the new state.
| `zones` | List of integers for the zone numbers to affect (each LIFX Z strip has 8 zones, starting at 0). | `zones` | List of integers for the zone numbers to affect. See **Calculating zones to affect** below for more detail.
| `power` | Turn the light on (`True`) or off (`False`). Leave out to keep the power as it is. | `power` | Turn the light on (`True`) or off (`False`). Leave out to keep the power as it is.
| `...` | Use `color_name`, `brightness` etc. from [`light.turn_on`](/integrations/light/#service-lightturn_on) to specify the new state. | `...` | Use `color_name`, `brightness` etc. from [`light.turn_on`](/integrations/light/#service-lightturn_on) to specify the new state.
#### Calculating zones to affect
The LIFX Z and LIFX Lightstrip each have eight (8) zones per segment. You can connect up to ten (10) segments to a single controller, which results in a maximum zone count of 80.
The LIFX Beam has ten (10) zones per segment and one (1) zone per corner piece. You can connect up to eight (8) segments and two (2) corner pieces to a single controller, which results in a maximum zone count of 82.
All devices start counting zones at zero (0), which means the zone numbers for the `zones` attribute of the `lifx.set_state` service range from 0 to 79 for the LIFX Z and Lightstrip and 0 to 81 for the LIFX Beam.
## Set HEV cycle state ## Set HEV cycle state
You can control the HEV LEDs in LIFX Clean bulbs using the `set_hev_cycle_state` service. The service can start or stop a HEV (or "Clean") cycle either using the default duration configured on the bulb or for a custom duration specified when calling the service. Home Assistant will return or log an error if an incompatible bulb is specified when calling the service. You can control the HEV LEDs in LIFX Clean bulbs using the `set_hev_cycle_state` service. The service can start or stop a HEV (or "Clean") cycle either using the default duration configured on the bulb or for a custom duration specified when calling the service. Home Assistant will return or log an error if an incompatible bulb is specified when calling the service.

View File

@ -50,7 +50,7 @@ sources:
Notes: Notes:
- Some Pioneer AVRs use the port 23 default and some are reported to use 8102. - Some Pioneer AVRs use the port 23 default and some are reported to use 8102. Depending on the model you may be able to configure the port setting through the receiver's HTTP interface, e.g. `http://192.168.0.10/1000/port_number.asp`. On models that can listen to multiple ports you could consider leaving the default port for use by hardcoded tools, and open another port for configurable tools such as Home Assistant.
- `timeout` is a socket level option and should only be configured if you know what you are doing. - `timeout` is a socket level option and should only be configured if you know what you are doing.
### Source codes ### Source codes

View File

@ -55,6 +55,21 @@ To use a specific Pushover device, set it using `target`. If one of the entered
priority: 0 priority: 0
``` ```
To use the highest priority, which repeats the notification every x seconds (`retry`) for the duration of y seconds (`expire`), you MUST specify these parameters. The minimal time for the `retry` parameter is 30 seconds. The `expire` parameter has a maximum of 10800 seconds (3 hours). If you target more than one device, make sure to enable the advanced option "Notification dismissal sync" in the app to be able to dismiss the alert on all devices simultaneously.
```yaml
- service: notify.entity_id
data:
message: "This is the message"
title: "Title of message"
target:
- iphone11pro
data:
priority: 2
sound: "siren"
expire: 300
retry: 30
```
To use notifications, please see the [getting started with automation page](/getting-started/automation/). To use notifications, please see the [getting started with automation page](/getting-started/automation/).

View File

@ -16,6 +16,12 @@ This integration allows you to write Python scripts that are exposed as services
| `hass` | The Home Assistant object. Access is only allowed to call services, set/remove states and fire events. [API reference][hass-api] | `hass` | The Home Assistant object. Access is only allowed to call services, set/remove states and fire events. [API reference][hass-api]
| `data` | The data passed to the Python Script service call. | `data` | The data passed to the Python Script service call.
| `logger` | A logger to allow you to log messages: `logger.info()`, `logger.warning()`, `logger.error()`. [API reference][logger-api] | `logger` | A logger to allow you to log messages: `logger.info()`, `logger.warning()`, `logger.error()`. [API reference][logger-api]
| `time` | The stdlib `time` available as limited access.
| `datetime` | The stdlib `datetime` available as limited access.
| `dt_util` | The ` homeassistant.util.dt` module.
Other imports like `min`, `max` are available as builtins. See the [python_script](https://github.com/home-assistant/core/blob/dev/homeassistant/components/python_script/__init__.py) source code for up-to-date information on the available objects inside the script.
[hass-api]: /developers/development_hass_object/ [hass-api]: /developers/development_hass_object/
[logger-api]: https://docs.python.org/3.7/library/logging.html#logger-objects [logger-api]: https://docs.python.org/3.7/library/logging.html#logger-objects
@ -26,31 +32,79 @@ It is not possible to use Python imports with this integration. If you want to d
</div> </div>
## Writing your first script ## Writing your first script, reading input and logging the activity
This is a simplified example that does no real work.
It is created as a first step, to help with:
- Demonstrate how to setup the script
- How to process the input data
- How to log the script activity
- How to troubleshoot / manually call the script.
Start by enabling the Python script and create the first script.
- Add to `configuration.yaml`: `python_script:` - Add to `configuration.yaml`: `python_script:`
- Create folder `<config>/python_scripts` - Create folder `<config>/python_scripts`
- Create a file `hello_world.py` in the folder and give it this content: - Create a file `<config>/python_scripts/hello_world.py` in the folder and give it this content:
```python ```python
# `data` is available as builtin and is a dictionary with the input data.
name = data.get("name", "world") name = data.get("name", "world")
logger.info("Hello %s", name) # `logger` and `time` are available as builtin without the need of explicit import.
hass.bus.fire(name, {"wow": "from a Python script!"}) logger.info("Hello {} at {}".format(name, time.time()))
``` ```
- Start Home Assistant - Start Home Assistant to reload the script configuration.
- Call your new {% my developer_call_service service="python_script.hello_world" %} service (with parameters) from the {% my developer_services %}. - Call your new {% my developer_call_service service="python_script.hello_world" %} service (with parameters) from the {% my developer_services %}, using the YAML mode.
```yaml ```yaml
name: you service: python_script.hello_world
data:
name: "Input-Text"
``` ```
<div class='note'> <div class='note'>
Running this script show absolutely no output on the screen, but it logs with level `info`. You must have the [Logger](/integrations/logger/) enabled at least for level `info`. Running this script show absolutely no output on the screen, but it logs with level `info`. You must have the [Logger](/integrations/logger/) enabled at least for level `info`.
Your `confiuration.yaml` should include something like this.
```yaml
logger:
default: info
```
</div> </div>
## Triggering events
The following example shows how to trigger a custom event over the `hass.bus`.
This example uses the `hello_world.py` from the previous example.
Edit the file and the code listed below to the end of the file.
There is no need to reload the configuration or restart Home Assistant.
```python
hass.bus.fire("hello_world_event", {"wow": "from a Python script!"})
```
This script doesn't output anything. However, you can view the events being fired in the Developer tools.
From a separate browser window or tab, go to `Developer Tools -> Events` and at `Listen to events` type `hello_world_event` and then press `Start listening`. You should see something like this:
```yaml
event_type: hello_world_event
data:
wow: from a Python script!
origin: LOCAL
time_fired: "2022-09-19T16:15:39.613378+00:00"
context:
id: 01GDB8H9JXJ1N23Q62SHX6PTBK
parent_id: null
user_id: null
```
## Calling Services ## Calling Services
The following example shows how to call a service from `python_script`. This script takes two parameters: `entity_id` (required), `rgb_color` (optional) and calls `light.turn_on` service by setting the brightness value to `255`. The following example shows how to call a service from `python_script`. This script takes two parameters: `entity_id` (required), `rgb_color` (optional) and calls `light.turn_on` service by setting the brightness value to `255`.
@ -100,6 +154,10 @@ Available services: `reload`.
### Service `python_script.reload` ### Service `python_script.reload`
Reload all available python_scripts from the `<config>/python_scripts` folder. Use this when creating a new Python script and you're not restarting Home Assistant. Reload all available python_scripts from the `<config>/python_scripts` folder, as a quicker alternative to restarting Home Assistant.
Use this when creating a new Python script, or after updating the `<config>/python_scripts/services.yaml` file.
You don't have to call this service when you change an existing Python script.
This service takes no service data attributes. This service takes no service data attributes.

View File

@ -133,6 +133,8 @@ Click the created project to enter the `Project Overview` page and get the `Auth
- Your cloud project on the [Tuya IoT Development Platform](https://iot.tuya.com) should be created after May 25, 2021. Otherwise, you need to create a new project. - Your cloud project on the [Tuya IoT Development Platform](https://iot.tuya.com) should be created after May 25, 2021. Otherwise, you need to create a new project.
- This error can often be resolved by unlinking the app from the project (`Devices` tab > `Link Tuya App Account` > `Unlink`) and [relinking it again](#link-devices-by-app-account).
"28841105: No permissions. This project is not authorized to call this API": "28841105: No permissions. This project is not authorized to call this API":
description: > description: >
Some APIs are not authorized, please [Subscribe](https://developer.tuya.com/en/docs/iot/applying-for-api-group-permissions?id=Ka6vf012u6q76#title-2-Subscribe%20to%20cloud%20products) then [Authorize](https://developer.tuya.com/en/docs/iot/applying-for-api-group-permissions?id=Ka6vf012u6q76#title-3-Authorize%20projects%20to%20call%20the%20cloud%20product). The following APIs must be subscribed for this tutorial: Some APIs are not authorized, please [Subscribe](https://developer.tuya.com/en/docs/iot/applying-for-api-group-permissions?id=Ka6vf012u6q76#title-2-Subscribe%20to%20cloud%20products) then [Authorize](https://developer.tuya.com/en/docs/iot/applying-for-api-group-permissions?id=Ka6vf012u6q76#title-3-Authorize%20projects%20to%20call%20the%20cloud%20product). The following APIs must be subscribed for this tutorial:

View File

@ -19,8 +19,7 @@ This can also be done with the CLI, by running the following command:
ha supervisor restart ha supervisor restart
``` ```
If this does not help, you can try to reboot the host. If this does not help or you do not have any way to access the CLI, you can try to reboot the host. This can be done by going to {% my hardware title="Settings -> System -> Hardware" %}, opening the menu in the top right corner, and selecting "Reboot Host".
If you are running Home Assistant Operating System, this can be done from the "System" tab in the Supervisor panel. On the card for "Host System", there is a button to reboot the host.
To help us make the setup more robust, please enable the sharing of diagnostics and crash logs on the {% my analytics title="Settings > System > Analytics" %} panel. To help us make the setup more robust, please enable the sharing of diagnostics and crash logs on the {% my analytics title="Settings > System > Analytics" %} panel.