From 28554a1849746d9d210cff87b612acece2f47a7e Mon Sep 17 00:00:00 2001 From: jeremysherriff Date: Sun, 19 Dec 2021 17:38:30 +1300 Subject: [PATCH 1/4] Add scan interval information to README To accompany PR rospogrigio/localtuya#549 --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a4ccf04..20ff98f 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,8 @@ localtuya: local_key: xxxxx friendly_name: Tuya Device protocol_version: "3.3" + scan_interval: # optional, only needed if energy monitoring values are not updating + seconds: 30 # Values less than 10 seconds may cause stability issues entities: - platform: binary_sensor friendly_name: Plug Status @@ -112,9 +114,13 @@ select one of these, or manually input all the parameters. ![discovery](https://github.com/rospogrigio/localtuya-homeassistant/blob/master/img/1-discovery.png) If you have selected one entry, you only need to input the device's Friendly Name and the localKey. + +Setting the scan interval is optional, only needed if energy/power values are not updating frequently enough by default. Values less than 10 seconds may cause stability issues. + Once you press "Submit", the connection is tested to check that everything works. -![device](https://github.com/rospogrigio/localtuya-homeassistant/blob/master/img/2-device.png) +![image](https://user-images.githubusercontent.com/1082213/146663895-41e1902b-4f09-4b21-b9d7-067d9cd67069.png) + Then, it's time to add the entities: this step will take place several times. First, select the entity type from the drop-down menu to set it up. After you have defined all the needed entities, leave the "Do not add more entities" checkbox checked: this will complete the procedure. @@ -140,6 +146,7 @@ You can obtain Energy monitoring (voltage, current) in two different ways: Note: Voltage and Consumption usually include the first decimal. You will need to scale the parament by 0.1 to get the correct values. 1) Access the voltage/current/current_consumption attributes of a switch, and define template sensors Note: these values are already divided by 10 for Voltage and Consumption +1) On some devices, you may find that the energy values are not updating frequently enough by default. If so, set the scan interval (see above) to an appropriate value. Settings below 10 seconds may cause stability issues, 30 seconds is recommended. ``` sensor: From 0d14df976d8cfa28f3b934bc5e0fbca6aa015486 Mon Sep 17 00:00:00 2001 From: jeremysherriff Date: Sun, 19 Dec 2021 17:41:02 +1300 Subject: [PATCH 2/4] Tweak image sizing --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 20ff98f..7e4d690 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ Setting the scan interval is optional, only needed if energy/power values are no Once you press "Submit", the connection is tested to check that everything works. -![image](https://user-images.githubusercontent.com/1082213/146663895-41e1902b-4f09-4b21-b9d7-067d9cd67069.png) +![image](https://user-images.githubusercontent.com/1082213/146664103-ac40319e-f934-4933-90cf-2beaff1e6bac.png) Then, it's time to add the entities: this step will take place several times. First, select the entity type from the drop-down menu to set it up. From 5542d83e31d1e13234264517843b02b60c685de5 Mon Sep 17 00:00:00 2001 From: jeremysherriff Date: Sun, 19 Dec 2021 17:46:34 +1300 Subject: [PATCH 3/4] Add scan interval information to info.md To accompany PR rospogrigio/localtuya#549 --- info.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/info.md b/info.md index 3c69026..b59ba35 100644 --- a/info.md +++ b/info.md @@ -43,6 +43,8 @@ localtuya: local_key: xxxxx friendly_name: Tuya Device protocol_version: "3.3" + scan_interval: # optional, only needed if energy monitoring values are not updating + seconds: 30 # Values less than 10 seconds may cause stability issues entities: - platform: binary_sensor friendly_name: Plug Status @@ -98,9 +100,12 @@ select one of these, or manually input all the parameters. ![discovery](https://github.com/rospogrigio/localtuya-homeassistant/blob/master/img/1-discovery.png) If you have selected one entry, you just have to input the Friendly Name of the Device, and the localKey. -Once you press "Submit", the connection will be tested to check that everything works, in order to proceed. -![device](https://github.com/rospogrigio/localtuya-homeassistant/blob/master/img/2-device.png) +Setting the scan interval is optional, only needed if energy/power values are not updating frequently enough by default. Values less than 10 seconds may cause stability issues. + +Once you press "Submit", the connection is tested to check that everything works. + +![image](https://user-images.githubusercontent.com/1082213/146663895-41e1902b-4f09-4b21-b9d7-067d9cd67069.png) Then, it's time to add the entities: this step will take place several times. Select the entity type from the drop-down menu to set it up. After you have defined all the needed entities leave the "Do not add more entities" checkbox checked: this will complete the procedure. @@ -122,7 +127,8 @@ After all the entities have been configured, the procedure is complete, and the Energy monitoring (voltage, current...) values can be obtained in two different ways: 1) creating individual sensors, each one with the desired name. Note: Voltage and Consumption usually include the first decimal, so 0.1 as "scaling" parameter shall be used in order to get the correct values. -2) accessing the voltage/current/current_consumption attributes of a switch, and then defining template sensors like this (please note that in this case the values are already divided by 10 for Voltage and Consumption): +2) accessing the voltage/current/current_consumption attributes of a switch, and then defining template sensors like this (please note that in this case the values are already divided by 10 for Voltage and Consumption) +3) On some devices, you may find that the energy values are not updating frequently enough by default. If so, set the scan interval (see above) to an appropriate value. Settings below 10 seconds may cause stability issues, 30 seconds is recommended. ``` sensor: From 38b9c675441fa4daaa1315307af7291b21310363 Mon Sep 17 00:00:00 2001 From: jeremysherriff Date: Sun, 19 Dec 2021 17:48:28 +1300 Subject: [PATCH 4/4] Tweak image sizing --- info.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/info.md b/info.md index b59ba35..ca0b487 100644 --- a/info.md +++ b/info.md @@ -105,7 +105,7 @@ Setting the scan interval is optional, only needed if energy/power values are no Once you press "Submit", the connection is tested to check that everything works. -![image](https://user-images.githubusercontent.com/1082213/146663895-41e1902b-4f09-4b21-b9d7-067d9cd67069.png) +![image](https://user-images.githubusercontent.com/1082213/146664103-ac40319e-f934-4933-90cf-2beaff1e6bac.png) Then, it's time to add the entities: this step will take place several times. Select the entity type from the drop-down menu to set it up. After you have defined all the needed entities leave the "Do not add more entities" checkbox checked: this will complete the procedure.