Sonoff POWCT add values from eWeLink app to HA
The Sonoff POWCT meter values (power, current etc) are available in HA through the integration, the eWeLink app shows more values like the daily power supplied. Would like to have the additional values available too
I have no idea what device you talking about. Show device diagnostics.
Please see below screenshots of the HA integration and the eWeLink app - the app has more "sensors"available.
I don't use any eWeLink power devices, so screenshots aren't very helpful.
Does this help ?
{
"version": 1,
"minor_version": 1,
"key": "sonoff/xxxxxxxxx",
"data": [
{
"name": "POWCT",
"deviceid": "10023xxxx",
"apikey": "91086efb-d6xxxxxxxxxxx",
"extra": {
"model": "SN-ESP32D0-POWCT-01",
"mac": "d0:xxxxxxxx",
"apmac": "d0:xxxxxxx",
"uiid": 190,
"ui": "POWR3-显示屏版本",
"modelInfo": "6523cc0cdxxxxxx",
"brandId": "5c4c1aee3a7dxxxxx",
"itCredential": "QQ25Yxxxxxxx",
"description": "",
"manufacturer": "深圳松诺技术有限公司",
"staMac": "AC:xxxxxxx"
},
"brandName": "SONOFF",
"brandLogo": "https://eu-ota.coolkit.cc/logo/q62Pxxxxxxxx.jpg",
"showBrand": true,
"productModel": "POWCT",
"tags": {
"m_8855_xxxx": "on"
},
"devConfig": {},
"settings": {
"opsNotify": 0,
"opsHistory": 1,
"alarmNotify": 1,
"wxAlarmNotify": 0,
"wxOpsNotify": 0,
"wxDoorbellNotify": 0,
"appDoorbellNotify": 1
},
"devGroups": [],
"family": {
"familyid": "680b4d1xxxxxxxx",
"index": -2,
"members": [],
"guests": []
},
"shareTo": [],
"devicekey": "7d3b803b-dc96-xxxxxxxxx",
"online": true,
"params": {
"bindInfos": {},
"version": 8,
"current": 1547,
"fwVersion": "1.3.1",
"power": 357476,
"voltage": 23238,
"demNextFetchTime": 1762275600000,
"bssid": "xxxxxxx",
"ssid": "xxxxxxxx",
"uiActive": 60,
"timeZone": 7,
"dayKwh": 1102,
"monthKwh": 5154,
"overload_00": {
"minAP": {
"en": 0,
"val": 10
},
"maxAP": {
"en": 1,
"val": 2400000
},
"minV": {
"en": 0,
"val": 16500
},
"maxV": {
"en": 0,
"val": 27700
},
"maxC": {
"en": 1,
"val": 10100
},
"minC": {
"en": 0,
"val": 10
}
},
"configure": [
{
"startup": "off",
"outlet": 0
}
],
"pulses": [
{
"pulse": "off",
"switch": "off",
"outlet": 0,
"width": 500
}
],
"rssi": -83,
"sledOnline": "on",
"staMac": "xx:xx:18:E8:xx:xx",
"switches": [
{
"switch": "off",
"outlet": 0
}
],
"threshold": {
"actPow": {
"min": 10,
"max": 2400000
},
"voltage": {
"min": 16500,
"max": 27700
},
"current": {
"min": 10,
"max": 10100
}
},
"getHoursKwh": {
"start": 0,
"end": 719
},
"only_device": {
"ota": "success",
"ota_fail_reason": 0
},
"TZ": "Asia/Bangkok",
"detectionMode": 1,
"yesterdayKwh": 1460,
"dayPowerSupply": 2728,
"monthPowerSupply": 5352,
"supplyCurrent": 0,
"supplyPower": 0,
"yesterdayPowerSupply": 1393
},
"denyFeatures": [
"userManual"
],
"isSupportGroup": true,
"isSupportedOnMP": false,
"isSupportChannelSplit": false,
"deviceFeature": {}
},
Se qualcun altro ne ha bisogno, ecco come farlo. Modificare il file "custom_components/sonoff/sensor.py" in modo che abbia questo codice
DEVICE_CLASSES = { "battery": SensorDeviceClass.BATTERY, "battery_voltage": SensorDeviceClass.VOLTAGE, "current": SensorDeviceClass.CURRENT, "humidity": SensorDeviceClass.HUMIDITY, "outdoor_temp": SensorDeviceClass.TEMPERATURE, "power": SensorDeviceClass.POWER, "rssi": SensorDeviceClass.SIGNAL_STRENGTH, "temperature": SensorDeviceClass.TEMPERATURE, "voltage": SensorDeviceClass.VOLTAGE, "supplyPower": SensorDeviceClass.POWER, }
UNITS = { "battery": PERCENTAGE, "battery_voltage": UnitOfElectricPotential.VOLT, "current": UnitOfElectricCurrent.AMPERE, "humidity": PERCENTAGE, "outdoor_temp": UnitOfTemperature.CELSIUS, "power": UnitOfPower.WATT, "rssi": SIGNAL_STRENGTH_DECIBELS_MILLIWATT, "temperature": UnitOfTemperature.CELSIUS, "voltage": UnitOfElectricPotential.VOLT, "water": UnitOfVolume.LITERS, "supplyPower": UnitOfPower.WATT, } e modificare il file "custom_components/sonoff/core/devices.py" in modo che abbia questo codice
190: [ XSwitchPOWR3, LED, RSSI, spec(XSensor100, param="current"), spec(XSensor100, param="power"), spec(XSensor100, param="voltage"), spec(XSensor100, param="supplyPower"), spec(XEnergyTotal, param="dayKwh", uid="energy_day", multiply=0.01, round=2), spec( XEnergyTotal, param="monthKwh", uid="energy_month", multiply=0.01, round=2 ), spec(XEnergyTotal, param="dayPowerSupply", uid="energy_day_out", multiply=0.01, round=2), spec(XEnergyTotal, param="monthPowerSupply", uid="energy_month_out", multiply=0.01, round=2), spec( XEnergySensorPOWR3, param="hoursKwhData", uid="energy", get_params={"getHoursKwh": {"start": 0, "end": 24 * 30 - 1}}, ), ], Quindi rimuovere e reinstallare questo componente personalizzato e reinstallare il Pow Ring in HA
Thanks to Lorenzo Zappa
Works like a charm - thank you for posting!