Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add description of enphase_envoy get_raw_tariff action #36740

Open
wants to merge 5 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 84 additions & 1 deletion source/_integrations/enphase_envoy.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,12 @@ This integration provides several values suitable for the energy dashboard:

## Actions

Available actions are: `switch.turn_on`, `switch.turn_off`, `switch.toggle`, [`number.set_value`](#action-numberset_value), [`select.select`](#action-selectselect)
Available actions are:

- `switch.turn_on`, `switch.turn_off`, `switch.toggle`
- [`number.set_value`](#action-numberset_value)
- [`select.select`](#action-selectselect)
- [`enphase_envoy.get_raw_tariff`](#action-enphase_envoyget_raw_tariff)

### Action `switch.turn_on`/`switch.turn_off`/`switch.toggle`

Expand Down Expand Up @@ -274,6 +279,84 @@ data:
Technically `select.first`, `select.last`, `select.previous`, `select.next` are available as well, but as there's no logical sequence in the values to select, their use is not advocated.
{% endnote %}

### Action `enphase_envoy.get_raw_tariff`

Each time this integration updates its entities, it collects data from a set of endpoints in the Envoy. That set of data is referred to as `raw`. It contains more information as strictly needed for entity data. The raw data is cached until the next collection cycle, when it is replaced by a fresh dataset from the envoy.

The action `enphase_envoy.get_raw_tariff` returns tariff data from the `raw` data cache. To explore the cached tariff data use the [developer tools - actions](/docs/tools/dev-tools/#actions-tab) menu and use this action.

| Data attribute | Optional | Description |
| - | - | - |
| `config_entry_id` | no | Config entry id of the target Envoy. <br>In the UI select an Envoy from the dropdown list. <br>When switching to yaml mode the config_entry_id shows as numeric.|

Example with envoy entity:

```yaml
action: enphase_envoy.get_raw_tariff
data:
config_entry_id: 01JFG9B5GQRWW4RPE5CTVFGNS7
```

Response (partially)

```yaml
{
raw:
{
"tariff": {
"currency": {
"code": "EUR"
},
"logger": "mylogger",
"date": "1695744220",
"storage_settings": {
"mode": "self-consumption",
"operation_mode_sub_type": "",
"reserved_soc": 15.0,
"very_low_soc": 5,
"charge_from_grid": true,
"date": "1695598084"
},
"single_rate": {
"rate": 0.0,
"sell": 0.0
},
```

When used in automation or script actions, use `response_variable` to specify which variable will receive the returned data

{% raw %}

```yaml
alias: GetTariffSingleRate
description: Get tariff Single rate json from Cache
triggers: []
conditions: []
actions:
- action: enphase_envoy.get_raw_tariff
data:
config_entry_id: 01JFG9B5GQRWW4RPE5CTVFGNS7
response_variable: tariff_data
- action: notify.persistent_notification
metadata: {}
data:
message: |
{{ tariff_data["raw"]["tariff"]["single_rate"]}}
title: Tariff data
mode: single
```

Result:

```json
{"rate": 0.0, "sell": 0.0}

```

In the Developer tools - actions, automation or script UI, this action shows as: _Enphase Envoy: Tariff details_.

{% endraw %}

## Know issues and limitations

- [Envoy firmware](https://enphase.com/installers/resources/documentation/communication?&f[0]=document%3A217) versions come with changing behavior, features and issues. Firmware is pushed to the Envoy by Enphase, while 'not always communicated in detail upfront'. This may result in sudden changes in the Envoy behavior and is always accompanied by an outage while Envoy is being updated.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading