Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Power monitoring for ESP24's #165

Closed
xanderificnl opened this issue Jun 20, 2023 · 2 comments
Closed

Power monitoring for ESP24's #165

xanderificnl opened this issue Jun 20, 2023 · 2 comments

Comments

@xanderificnl
Copy link

Hi,

The Wiz app displays power measurements but with homeassistant (using pywizlight) the results are "unknown", perhaps someone can shine some light on this issue?

Below is the debug output from homeassistant, I've chosen not to redact anything since I'm not sure what kind of information may be useful/required; I'm hopeful it'll help.

e27 bulb

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2023.6.2",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.11.4",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/Amsterdam",
    "os_name": "Linux",
    "os_version": "6.1.34",
    "supervisor": "2023.06.2",
    "host_os": "Home Assistant OS 10.3",
    "docker_version": "23.0.6",
    "chassis": "embedded",
    "run_as_root": true
  },
  "custom_components": {
    "tapo": {
      "version": "1.6.1",
      "requirements": [
        "plugp100==2.5.1"
      ]
    },
    "mikrotik_router": {
      "version": "0.0.0",
      "requirements": [
        "librouteros>=3.2.0",
        "mac-vendor-lookup>=0.1.12"
      ]
    },
    "hacs": {
      "version": "1.32.1",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "powercalc": {
      "version": "v1.6.7",
      "requirements": [
        "numpy>=1.21.1"
      ]
    },
    "watchman": {
      "version": "0.5.1",
      "requirements": [
        "prettytable==3.0.0"
      ]
    },
    "nodered": {
      "version": "1.2.0",
      "requirements": []
    },
    "meross_lan": {
      "version": "4.2.0",
      "requirements": []
    }
  },
  "integration_manifest": {
    "domain": "wiz",
    "name": "WiZ",
    "codeowners": [
      "@sbidy"
    ],
    "config_flow": true,
    "dependencies": [
      "network"
    ],
    "dhcp": [
      {
        "registered_devices": true
      },
      {
        "macaddress": "A8BB50*"
      },
      {
        "macaddress": "D8A011*"
      },
      {
        "macaddress": "444F8E*"
      },
      {
        "macaddress": "6C2990*"
      },
      {
        "hostname": "wiz_*"
      }
    ],
    "documentation": "https://www.home-assistant.io/integrations/wiz",
    "iot_class": "local_push",
    "quality_scale": "platinum",
    "requirements": [
      "pywizlight==0.5.14"
    ],
    "is_built_in": true
  },
  "data": {
    "entry": {
      "title": "Bedroom",
      "data": {
        "host": "192.168.88.188"
      }
    },
    "data": {
      "state": {
        "mac": "d8a0111ed0d4",
        "rssi": -57,
        "src": "",
        "state": true,
        "sceneId": 0,
        "r": 18,
        "g": 10,
        "b": 4,
        "c": 0,
        "w": 41,
        "dimming": 10
      },
      "white_range": null,
      "extended_white_range": [
        2200.0,
        2700.0,
        6500.0,
        6500.0
      ],
      "bulb_type": {
        "features": {
          "color": true,
          "color_tmp": true,
          "effect": true,
          "brightness": true,
          "dual_head": false
        },
        "name": "ESP24_SHRGBC_01",
        "kelvin_range": {
          "max": 6500,
          "min": 2200
        },
        "bulb_type": "RGB",
        "fw_version": "1.29.1",
        "white_channels": 1,
        "white_to_color_ratio": 60
      },
      "last_push": 34070.282145875,
      "push_running": true,
      "version": "0.5.14",
      "history": {
        "receive": {
          "getSystemConfig": {
            "method": "getSystemConfig",
            "env": "pro",
            "result": {
              "mac": "d8a0111ed0d4",
              "homeId": "**REDACTED**",
              "roomId": "**REDACTED**",
              "rgn": "eu",
              "moduleName": "ESP24_SHRGBC_01",
              "fwVersion": "1.29.1",
              "groupId": 0,
              "ping": 0
            }
          },
          "getModelConfig": {
            "method": "getModelConfig",
            "env": "pro",
            "result": {
              "ps": 2,
              "pwmFreq": 1000,
              "pwmRes": 11,
              "pwmRange": [
                0,
                100
              ],
              "wcr": 60,
              "nowc": 1,
              "cctRange": [
                2200,
                2700,
                6500,
                6500
              ],
              "renderFactor": [
                200,
                255,
                150,
                255,
                0,
                0,
                40,
                0,
                0,
                0
              ],
              "drvIface": 0
            }
          },
          "getPilot": {
            "method": "getPilot",
            "env": "pro",
            "result": {
              "mac": "d8a0111ed0d4",
              "rssi": -57,
              "src": "",
              "state": true,
              "sceneId": 0,
              "r": 18,
              "g": 10,
              "b": 4,
              "c": 0,
              "w": 41,
              "dimming": 10
            }
          },
          "getPower": {
            "method": "getPower",
            "env": "pro",
            "result": {
              "power": 0
            }
          },
          "registration": {
            "method": "registration",
            "env": "pro",
            "result": {
              "mac": "d8a0111ed0d4",
              "success": true
            }
          }
        },
        "send": {
          "getSystemConfig": {
            "method": "getSystemConfig",
            "params": {}
          },
          "getModelConfig": {
            "method": "getModelConfig",
            "params": {}
          },
          "getPilot": {
            "method": "getPilot",
            "params": {}
          },
          "getPower": {
            "method": "getPower"
          },
          "registration": {
            "params": {
              "phoneIp": "192.168.88.207",
              "register": true,
              "phoneMac": "147ba75eaad5"
            },
            "method": "registration"
          }
        },
        "push": {
          "syncPilot": {
            "method": "syncPilot",
            "env": "pro",
            "params": {
              "mac": "d8a0111ed0d4",
              "rssi": -58,
              "src": "hb",
              "mqttCd": 0,
              "ts": 1687213445,
              "state": true,
              "sceneId": 0,
              "r": 18,
              "g": 10,
              "b": 4,
              "c": 0,
              "w": 41,
              "dimming": 10
            }
          }
        },
        "last_error": null
      },
      "push_manager": {
        "running": true,
        "fail_reason": null
      }
    }
  }
}

gu10 bulbs

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2023.6.2",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.11.4",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/Amsterdam",
    "os_name": "Linux",
    "os_version": "6.1.34",
    "supervisor": "2023.06.2",
    "host_os": "Home Assistant OS 10.3",
    "docker_version": "23.0.6",
    "chassis": "embedded",
    "run_as_root": true
  },
  "custom_components": {
    "tapo": {
      "version": "1.6.1",
      "requirements": [
        "plugp100==2.5.1"
      ]
    },
    "mikrotik_router": {
      "version": "0.0.0",
      "requirements": [
        "librouteros>=3.2.0",
        "mac-vendor-lookup>=0.1.12"
      ]
    },
    "hacs": {
      "version": "1.32.1",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "powercalc": {
      "version": "v1.6.7",
      "requirements": [
        "numpy>=1.21.1"
      ]
    },
    "watchman": {
      "version": "0.5.1",
      "requirements": [
        "prettytable==3.0.0"
      ]
    },
    "nodered": {
      "version": "1.2.0",
      "requirements": []
    },
    "meross_lan": {
      "version": "4.2.0",
      "requirements": []
    }
  },
  "integration_manifest": {
    "domain": "wiz",
    "name": "WiZ",
    "codeowners": [
      "@sbidy"
    ],
    "config_flow": true,
    "dependencies": [
      "network"
    ],
    "dhcp": [
      {
        "registered_devices": true
      },
      {
        "macaddress": "A8BB50*"
      },
      {
        "macaddress": "D8A011*"
      },
      {
        "macaddress": "444F8E*"
      },
      {
        "macaddress": "6C2990*"
      },
      {
        "hostname": "wiz_*"
      }
    ],
    "documentation": "https://www.home-assistant.io/integrations/wiz",
    "iot_class": "local_push",
    "quality_scale": "platinum",
    "requirements": [
      "pywizlight==0.5.14"
    ],
    "is_built_in": true
  },
  "data": {
    "entry": {
      "title": "East facing light",
      "data": {
        "host": "192.168.88.175"
      }
    },
    "data": {
      "state": {
        "mac": "d8a0110629f0",
        "rssi": -47,
        "src": "udp",
        "state": false,
        "sceneId": 0,
        "temp": 6500,
        "dimming": 100
      },
      "white_range": null,
      "extended_white_range": [
        2200.0,
        2700.0,
        6500.0,
        6500.0
      ],
      "bulb_type": {
        "features": {
          "color": true,
          "color_tmp": true,
          "effect": true,
          "brightness": true,
          "dual_head": false
        },
        "name": "ESP24_SHRGBC_01",
        "kelvin_range": {
          "max": 6500,
          "min": 2200
        },
        "bulb_type": "RGB",
        "fw_version": "1.29.1",
        "white_channels": 1,
        "white_to_color_ratio": 40
      },
      "last_push": 34866.868569889,
      "push_running": true,
      "version": "0.5.14",
      "history": {
        "receive": {
          "getSystemConfig": {
            "method": "getSystemConfig",
            "env": "pro",
            "result": {
              "mac": "d8a0110629f0",
              "homeId": "**REDACTED**",
              "roomId": "**REDACTED**",
              "rgn": "eu",
              "moduleName": "ESP24_SHRGBC_01",
              "fwVersion": "1.29.1",
              "groupId": 0,
              "ping": 0
            }
          },
          "getModelConfig": {
            "method": "getModelConfig",
            "env": "pro",
            "result": {
              "ps": 2,
              "pwmFreq": 1000,
              "pwmRes": 11,
              "pwmRange": [
                0,
                100
              ],
              "wcr": 40,
              "nowc": 1,
              "cctRange": [
                2200,
                2700,
                6500,
                6500
              ],
              "renderFactor": [
                200,
                255,
                160,
                255,
                0,
                0,
                40,
                0,
                0,
                0
              ],
              "drvIface": 0
            }
          },
          "getPilot": {
            "method": "getPilot",
            "env": "pro",
            "result": {
              "mac": "d8a0110629f0",
              "rssi": -47,
              "src": "",
              "state": false,
              "sceneId": 0,
              "temp": 6500,
              "dimming": 100
            }
          },
          "getPower": {
            "method": "getPower",
            "env": "pro",
            "result": {
              "power": 0
            }
          },
          "registration": {
            "method": "registration",
            "env": "pro",
            "result": {
              "mac": "d8a0110629f0",
              "success": true
            }
          },
          "setPilot": {
            "method": "setPilot",
            "env": "pro",
            "result": {
              "success": true
            }
          }
        },
        "send": {
          "getSystemConfig": {
            "method": "getSystemConfig",
            "params": {}
          },
          "getModelConfig": {
            "method": "getModelConfig",
            "params": {}
          },
          "getPilot": {
            "method": "getPilot",
            "params": {}
          },
          "getPower": {
            "method": "getPower"
          },
          "registration": {
            "params": {
              "phoneIp": "192.168.88.207",
              "register": true,
              "phoneMac": "147ba75eaad5"
            },
            "method": "registration"
          },
          "setPilot": {
            "method": "setPilot",
            "params": {
              "state": false
            }
          }
        },
        "push": {
          "syncPilot": {
            "method": "syncPilot",
            "env": "pro",
            "params": {
              "mac": "d8a0110629f0",
              "rssi": -48,
              "src": "hb",
              "mqttCd": 0,
              "ts": 1687219888,
              "state": false,
              "sceneId": 0,
              "temp": 6500,
              "dimming": 100
            }
          }
        },
        "last_error": null
      },
      "push_manager": {
        "running": true,
        "fail_reason": null
      }
    }
  }
}

Thanks for any help you can offer!

@krstlmnn
Copy link

I'm not very familiar with Home Assistant, but the getPower messages used by pywizlight are not available on all devices, in which case the official app uses alternative methods for computing the power consumption.

See:

@xanderificnl
Copy link
Author

Sorry for the late reply. Thanks for the explanation and the links!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants