Skip to content

Commit

Permalink
#7 - Added missing powerfactor for meter systems, changed powerfactor…
Browse files Browse the repository at this point in the history
… to show between -1 and +1
  • Loading branch information
muppet3000 committed Jul 10, 2023
1 parent 38f849c commit a83a3af
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions custom_components/grott/sensors/sensors_mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,7 @@ def datetime_formatter(mqtt_data):
"state_class": None,
"icon": "mdi:information-outline",
"func": lambda js: js['values']["powerfactor_l1"],
"divider": 10,
"divider": 1000,
"unique_name": "mqtt_100",
},
{
Expand All @@ -1110,7 +1110,7 @@ def datetime_formatter(mqtt_data):
"state_class": None,
"icon": "mdi:information-outline",
"func": lambda js: js['values']["powerfactor_l2"],
"divider": 10,
"divider": 1000,
"unique_name": "mqtt_101",
},
{
Expand All @@ -1120,9 +1120,19 @@ def datetime_formatter(mqtt_data):
"state_class": None,
"icon": "mdi:information-outline",
"func": lambda js: js['values']["powerfactor_l3"],
"divider": 10,
"divider": 1000,
"unique_name": "mqtt_102",
},
{
"name": "Power factor",
"device_class": None,
"unit_of_measurement": None,
"state_class": None,
"icon": "mdi:information-outline",
"func": lambda js: js['values']["powerfactor"],
"divider": 1000,
"unique_name": "mqtt_103",
},

#The following entries are out-of-order in the above list, be sure to check for the latest value for unique_name from both lists
#mqtt_066 - PV3 Voltage
Expand Down

0 comments on commit a83a3af

Please sign in to comment.