From 9717d75b0573f05da492b924c4cc82c85e42bc8a Mon Sep 17 00:00:00 2001 From: Chris Nussbaum Date: Mon, 10 Jan 2022 04:13:43 -0600 Subject: [PATCH] Add an action for pzemac to reset the total energy (#1522) --- components/sensor/pzemac.rst | 13 +++++++++++++ guides/automations.rst | 1 + 2 files changed, 14 insertions(+) diff --git a/components/sensor/pzemac.rst b/components/sensor/pzemac.rst index 90f8a8896..942a4543d 100644 --- a/components/sensor/pzemac.rst +++ b/components/sensor/pzemac.rst @@ -83,6 +83,19 @@ Configuration variables: the same UART bus. You will need to set the address of each device manually. Defaults to ``1``. - **modbus_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the Modbus hub. +.. _pzemac-reset_energy_action: + +``pzemac.reset_energy`` Action +****************************** + +This action resets the total energy value of the pzemac device with the given ID when executed. + +.. code-block:: yaml + + on_...: + then: + - pzemac.reset_energy: pzemac_1 + See Also -------- diff --git a/guides/automations.rst b/guides/automations.rst index 6fd3ad228..5765fcd3f 100644 --- a/guides/automations.rst +++ b/guides/automations.rst @@ -381,6 +381,7 @@ All Actions - :ref:`rf_bridge.learn ` - :ref:`ds1307.read_time ` / :ref:`ds1307.write_time ` - :ref:`cs5460a.restart ` +- :ref:`pzemac.reset_energy ` - :ref:`number.set ` .. _config-condition: