alienatedsec / yi-hack-v5

Even newer Custom Firmware for Xiaomi Cameras based on Hi3518ev200 Chipset. It includes free RTSP, ONVIF and other improvements based on the work by roleoroleo
GNU General Public License v3.0
803 stars 89 forks source link

Home assistant mqtt wifi_strength should be in dB or dBm, not % #245

Closed pkishino closed 1 year ago

pkishino commented 1 year ago

Describe the bug As per a few versions back, the unit of measure for wifi signals was finalized as dB or dBm. The config script here still uses % which triggers an issue with home assistant during discovery. The fix would be to stick to using dB which is, what I believe, is the default for the camera (the % uses a conversion formula)

To Reproduce current example wifi_strength config:

{
  "availability_topic": "yicam/status",
  "payload_available": "online",
  "payload_not_available": "offline",
  "device": {
    "identifiers": [
      "yi-cam"
    ],
    "manufacturer": "YI",
    "model": "YI Hack",
    "name": "Yi Camera",
    "sw_version": "0.3.7"
  },
  "qos": 1,
  "device_class": "signal_strength",
  "icon": "mdi:wifi",
  "state_topic": "yicam/telemetry",
  "name": "Yi Camera Wlan Strengh",
  "unique_id": "yi-cam-wlan_strength",
  "value_template": "{{ ((value_json.wlan_strength|int) * 100 / 70 )|int }}",
  "unit_of_measurement": "%",
  "platform": "mqtt"
}

Expected behaviour the above details should be something as below: "unit_of_measurement": "dB",

Screenshots N/A

Set Up Details (please complete the following information):

Additional context Add any other context about the problem here. If any other systems are involved, please complete the following:

Technical Details Please add any technical details (e.g., log files)

github-actions[bot] commented 1 year ago

This issue has been stale for 30 days - it will be closed within the next 7 days if not updated

pkishino commented 1 year ago

Still active, can try to look into creating a pr..

github-actions[bot] commented 1 year ago

This issue has been stale for 30 days - it will be closed within the next 7 days if not updated

pkishino commented 1 year ago

Haven’t gotten around to this yet…

alienatedsec commented 1 year ago

@pkishino Looking closer into recent fixes, this would not be relevant and the current unit is correct

Please check this https://github.com/alienatedsec/yi-hack-v5/issues/42#issuecomment-1672692347