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

[BUG] No up-to-date light and temperature values in Homebridge anymore #123

Closed
qx54 opened this issue Nov 21, 2020 · 6 comments
Closed

[BUG] No up-to-date light and temperature values in Homebridge anymore #123

qx54 opened this issue Nov 21, 2020 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@qx54
Copy link

qx54 commented Nov 21, 2020

Describe the bug
Temperature and light don't get updated in Homebridge and Home app anymore, although http://<PIR-IP>/api/v1/sensors shows up-to-date temperature and light values.

To Reproduce
Steps to reproduce the behavior:

  1. In the Homebridge GUI navigate to Accessories
  2. Light will have an old value
  3. Open http://<PIR-IP>/api/v1/sensors in browser
  4. Light value will be different, but correct

Expected behavior
The light and temperature values in Homebridge should have the same values as the ones provided by the API.

Plugin environment:

  • myStrom PIR Firmware Version: 3.8.2
  • Homebridge Server: Raspberry Pi 4
  • Plugin Version: 1.8.0
  • Node.js Version: 14.15.1
  • Homebridge Version: 1.1.6

Additional context
The issue appears only after some time. Upon re-starting Homebridge it works again, but will stop working after a couple of hours.

@qx54 qx54 added the bug Something isn't working label Nov 21, 2020
@johannrichard
Copy link
Owner

The change related to reachability (73298a5) introduced in v1.8.0 seems to break quite a few things, but only after some time running. 🤦 A downgrade to v1.7.1 should work around this while I work on a fix.

@johannrichard
Copy link
Owner

I've released homebridge-dingz@1.8.3-nightly.0 (homebridge-dingz@nightly) and am running it now. If you want to help with testing, feel free to install it and report back.

  • the nightly reverts some of the changes that might have caused some of the problems encountered here and elsewhere 🤕🤒

@qx54
Copy link
Author

qx54 commented Nov 22, 2020

I've installed 1.8.3 nightly and will report back 👍

@johannrichard
Copy link
Owner

In the meantime I've worked on a v2.0.0-nightly of the plug-in. If you reinstall the nightly w/ homebridge-dingz@nightly you should be upgraded to this version.

The functionality remains largely the same but the code is less cluttered and better structured so should generally run better. There might be bugs though but you can always downgrade to v1.8.3-nightly (although I think the newest nightlies are much more robust).

I've had it running over longer periods of time now on my production dingz. So far I could not observe any problems with temperature/brightness values not updating.

(The easiest way to test if it still works after a few hours is to use your phone's flashlight to illuminate or your hand to darken the illumination: the LUX value should change significantly 😄)

@johannrichard
Copy link
Owner

It's apparently still not fixed though. 🤦 😞 But I now have a clue where it happened (unreleased mutex locks on the request queue) in the code. :octocat:

private async getDeviceState(): Promise<DingzState> {
const getDeviceStateUrl = `${this.baseUrl}/api/v1/state`;
const release = await this.mutex.acquire();
try {
return await this.platform.fetch({
url: getDeviceStateUrl,
returnBody: true,
token: this.device.token,
});
} finally {
release();
}
}

@qx54
Copy link
Author

qx54 commented Nov 25, 2020

So far v2.0.0-nightly is working for me, but it has been running less than 24 hours.

johannrichard added a commit that referenced this issue Nov 28, 2020
- simplify device updates
- allows updating device info (core info) via platform
- implements (better) device recovery
- implements better error handling for devices
- streamlines code
- streamlines accessory interfaces & methods
- other small chores
- implements fixes #3, #103, #116, #123, #135
@johannrichard johannrichard reopened this Nov 28, 2020
johannrichard added a commit that referenced this issue Dec 12, 2020
- remove reference to #103, #116, #120, #123 (all implemented by now)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

2 participants