question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect rise of the humidity level

See original GitHub issue

With this sensor, the humidity reading is incorrect. For example, if the sensor’s screen displays a humidity level of 50%, the information returned is 5%.

{
  "id": 31,
  "type": "EndDevice",
  "ieeeAddr": "0xa4c13808cdabacde",
  "nwkAddr": 9031,
  "manufId": 4417,
  "manufName": "_TZ3000_ywagc4rj",
  "powerSource": "Battery",
  "modelId": "TS0201",
  "epList": [
    1
  ],
  "endpoints": {
    "1": {
      "profId": 260,
      "epId": 1,
      "devId": 770,
      "inClusterList": [
        1,
        3,
        1026,
        1029,
        57346,
        0
      ],
      "outClusterList": [
        3,
        25,
        10
      ],
      "clusters": {
        "msTemperatureMeasurement": {
          "attributes": {
            "measuredValue": 2508
          }
        },
        "msRelativeHumidity": {
          "attributes": {
            "measuredValue": 511
          }
        },
        "genBasic": {
          "attributes": {
            "65503": "\u0000\u0000\u0000\u0000\u0011\u0000\u0000\u0000\u0000\u0011\u0000\u0000\u0000\u0000\u0011\u0000\u0000\u0000\u0000\u0011\u0000\u0000\u0000\u0000\u0011\u0000\u0000\u0000\u0000\u0011\u0000\u0000\u0000\u0000\u0011\u0000\u0000\u0000\u0000\u0011",
            "65506": 51,
            "65508": 0,
            "65534": 0,
            "modelId": "TS0201",
            "manufacturerName": "_TZ3000_ywagc4rj",
            "powerSource": 3,
            "zclVersion": 3,
            "appVersion": 66,
            "stackVersion": 0,
            "hwVersion": 1,
            "dateCode": ""
          }
        },
        "genPowerCfg": {
          "attributes": {
            "batteryPercentageRemaining": 184,
            "batteryVoltage": 29
          }
        }
      },
      "binds": [],
      "configuredReportings": [],
      "meta": {}
    }
  },
  "appVersion": 66,
  "stackVersion": 0,
  "hwVersion": 1,
  "dateCode": "",
  "zclVersion": 3,
  "interviewCompleted": true,
  "meta": {
    "configured": 126974596
  },
  "lastSeen": 1662396642970,
  "defaultSendRequestWhen": "immediate"
}

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
Koenkkcommented, Sep 6, 2022

Great, pushed the fix!

1reaction
Koenkkcommented, Sep 6, 2022

Could you check if the issue is fixed with the following external converter:

const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const extend = require('zigbee-herdsman-converters/lib/extend');
const ota = require('zigbee-herdsman-converters/lib/ota');
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const color = require('zigbee-herdsman-converters/lib/color');
const e = exposes.presets;
const ea = exposes.access;

const fzLocal = {
    TS0201_battery: {
        cluster: 'genPowerCfg',
        type: ['attributeReport', 'readResponse'],
        convert: (model, msg, publish, options, meta) => {
            // https://github.com/Koenkk/zigbee2mqtt/issues/11470
            if (msg.data.batteryPercentageRemaining == 200 && msg.data.batteryVoltage < 30) return;
            return fz.battery.convert(model, msg, publish, options, meta);
        },
    },
    TS0201_humidity: {
        ...fz.humidity,
        convert: (model, msg, publish, options, meta) => {
            const result = fz.humidity.convert(model, msg, publish, options, meta);
            if (meta.device.manufacturerName === '_TZ3000_ywagc4rj') {
                result.humidity = result.humidity * 10;
            }
            return result;
        },
    },
};

const definition = {
    fingerprint: [{manufacturerName: '_TZ2000_a476raq2'}],
    zigbeeModel: ['TS0201', 'SNTZ003'],
    model: 'TS0201',
    vendor: 'TuYa',
    description: 'Temperature & humidity sensor with display',
    whiteLabel: [{vendor: 'BlitzWolf', model: 'BW-IS4'}],
    fromZigbee: [fzLocal.TS0201_battery, fz.temperature, fzLocal.TS0201_humidity],
    toZigbee: [],
    exposes: [e.battery(), e.temperature(), e.humidity(), e.battery_voltage()],
    configure: async (device, coordinatorEndpoint, logger) => {
        const endpoint = device.getEndpoint(1);
        await endpoint.read('genBasic', ['manufacturerName', 'zclVersion', 'appVersion', 'modelId', 'powerSource', 0xfffe]);
    },
};

module.exports = definition;

  • save this as file next to configuration.yaml as ext_converter.js
  • add it to configuration.yaml:
external_converters:
  - ext_converter.js
  • start z2m, check if issue is fixed
Read more comments on GitHub >

github_iconTop Results From Across the Web

How Incorrect Humidity Level Damages your Home and ...
Place containers of water on elevated surfaces to increase humidity in a room. · Boil water on the stove when you're at home....
Read more >
Incorrect Relative Humidity - Wiki
Relative Humidity is the amount of moisture in the air compared to how much moisture that air can hold at the same temperature....
Read more >
Causes of High Humidity in Your Home & How to Fix Humidity
Is your home too humid? Learn what might be causing your home's humidity & how to reduce it. Contact Home Climates to help...
Read more >
Agents of Deterioration: Incorrect Relative Humidity
Incorrect temperature and incorrect relative humidity work hand in hand as agents of deterioration because they affect each other, and co-habitate. They're a ......
Read more >
Discussion on Humidity - National Weather Service
A primary way water vapor increases in the atmosphere is through evaporation. ... SPECIFIC HUMIDITY refers to the weight (amount) of water vapor...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found