Add support for Topgreener Smart Round Plug-In (TGWF115PRM) #4436
+54
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://topgreener.com/product/round-smart-wi-fi-plug-in-10a-with-energy-monitoring-white/
Definitions from tuya currently missing scale=1 for cur_power and cur_voltage (see home-assistant/core#152295) so scaling by 10 in yaml.
[{"id": 1, "name": "switch_on", "type": "Boolean", "format": "{}", "enumMap": {}}, {"id": 2, "name": "countdown", "type": "Integer", "format": "{\"unit\":\"\",\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}", "enumMap": {}}, {"id": 4, "name": "cur_current", "type": "Integer", "format": "{\"unit\":\"mA\",\"min\":0,\"max\":30000,\"scale\":0,\"step\":1}", "enumMap": {}}, {"id": 5, "name": "cur_power", "type": "Integer", "format": "{\"unit\":\"W\",\"min\":0,\"max\":50000,\"scale\":0,\"step\":1}", "enumMap": {}}, {"id": 6, "name": "cur_voltage", "type": "Integer", "format": "{\"unit\":\"V\",\"min\":0,\"max\":2500,\"scale\":0,\"step\":1}", "enumMap": {}}]As this is an upstream thing being corrected in a dirty way downstream via this method, it may be preferable to leave the scaling alone and have users correct with template sensors. Otherwise I'll update the scaling when (if) Tuya ever fixes the problem on their end.