Coder Social home page Coder Social logo

Comments (23)

torpex77 avatar torpex77 commented on July 19, 2024 2

I turned up debugging this morning and I think I found this.

My OpenHab item:

Dimmer Kitchen_Island_Light_Level

My Homebridge accessory:

        {
          "name": "Island",
          "type": "light",
          "item": "Kitchen_Island_Light_Level"
        }

I say "Hey Siri, turn on the Island LIghts".
What happens: The light level is set to 0.

Here are the logs:

[7/14/2019, 10:49:07 AM] [openHAB2-Complete] Change binary target state of Island to true
[7/14/2019, 10:49:07 AM] [openHAB2-Complete] Preparing commit
[7/14/2019, 10:49:07 AM] [openHAB2-Complete] Received commit with object {"binary":true}
[7/14/2019, 10:49:07 AM] [openHAB2-Complete] Commiting light state with vectors (B,H,S,B): true,undefined,undefined,0

Here's the code from SetAndCommitLight.js

        this._log.debug(`Commiting light state with vectors (B,H,S,B): ${binary},${hue},${saturation},${brightness}`);
        if(binary === undefined && hue === undefined && saturation === undefined && brightness === undefined) {
            command = new Error("Unable to commit state, since necessary information are missing");
        } else if (hue === undefined && saturation === undefined && brightness === undefined) {
            command = binary ? "ON" : "OFF";
        } else if (hue === undefined && saturation === undefined) {
            command = binary ? `${brightness}` : "OFF";
        } else {
            command = binary ? `${hue},${saturation},${brightness}` : "OFF";
        }

Basically, homekit is setting binary as true, but brightness as 0. Which executes:

command = binary ? `${brightness}` : "OFF";

setting the light to 0, instead of turning the light ON

I ran a few more tests, it looks like when I say "turn the island light on" and "turn the island light off" the value in brightness is the current brightness setting, not the target. Only binary matters.

I don't have a Color device to test hue, saturation, brightness with.

But it seems like at least for a dimmer that when it receives a binary true it should send an ON, not set the light level to the brightness setting received.

Thanks,

Doug

from homebridge-openhab2-complete.

steilerDev avatar steilerDev commented on July 19, 2024 1

Merged PR that should fix the problem.

from homebridge-openhab2-complete.

steilerDev avatar steilerDev commented on July 19, 2024

Seems to be related to #12

from homebridge-openhab2-complete.

steilerDev avatar steilerDev commented on July 19, 2024

Could you please manually install the latest commit on the master branch and check if this fixes your issue?

from homebridge-openhab2-complete.

extric99 avatar extric99 commented on July 19, 2024

Happy to do so but not sure how exactly. I tried to google and came up with

npm install --save
https://github.com/steilerDev/homebridge-openhab2-complete/tarball/master
Would that be correct? Just want to be sure i am acrually testing a new version

from homebridge-openhab2-complete.

steilerDev avatar steilerDev commented on July 19, 2024

Since you are also running homebridge inside the docker container, do the following:

  1. Remove the current installation
    This depends on how you added the plugin in the first place. If you installed it via docker exec <container name or id> npm install homebridge-openhab2-complete you need to docker exec <container name or id> npm remove homebridge-openhab2-complete or just remove the docker container (docker stop <container name or id> && docker rm <container name or id>). Otherwise remove the relevant line from startup.sh, in order to be sure, remove the container anyway.

  2. Download the latest version:
    Navigate to your homebridge volume, create a folder (I am using custom_node_modules). Then download the repository:

git clone https://github.com/steilerDev/homebridge-openhab2-complete.git
  1. Install the downloaded version:
    Add the following line to your startup.sh
npm install -g /homebridge/custom_node_modules/homebridge-openhab2-complete/

Let me know if you run into any issues.

from homebridge-openhab2-complete.

extric99 avatar extric99 commented on July 19, 2024

I think I need to resolve a permission issue for the download directory as it complains about missing write access

/homebridge # npm install -g dowload/homebridge-openhab2-complete/
npm WARN checkPermissions Missing write access to /homebridge/dowload/homebridge-openhab2-
complete/node_modules/@types/node

from homebridge-openhab2-complete.

steilerDev avatar steilerDev commented on July 19, 2024

The easiest way would be sudo chmod -R ugo+rwx <your folder> :P

from homebridge-openhab2-complete.

steilerDev avatar steilerDev commented on July 19, 2024

Did you have the time to test this? The other issue was reported to be fixed, I'm curious if this is also the case for you.

from homebridge-openhab2-complete.

extric99 avatar extric99 commented on July 19, 2024

I tried earlier this week but was unable to get it installed. Was abroad until today so i will try to test over the weekend.

from homebridge-openhab2-complete.

steilerDev avatar steilerDev commented on July 19, 2024

Unfortunately I broke the current master branch, if you want to test it anyway you should go to the 4687d56 commit.

from homebridge-openhab2-complete.

extric99 avatar extric99 commented on July 19, 2024

Didn’t manage over the weekend as we are renovating the downstairs and back abroad this week so i will try asap when i return

from homebridge-openhab2-complete.

steilerDev avatar steilerDev commented on July 19, 2024

No worries :)

from homebridge-openhab2-complete.

jewesta avatar jewesta commented on July 19, 2024

I did some tests today. While I had to use your current 0.10.0 release because I didn't know how to use the master I "manually" changed SetAndCommitLight.js and alternated between "0" and "OFF". Unfortunately the dimmer is switched to "0%" either way.

This is what I'm getting with "0" in the code:

"Hey Siri, Licht im Wohnzimmer auf 25%"

[3/31/2019, 1:43:24 PM] [openHAB2-Complete] Updating state of Licht im Wohnzimmer with item DimmerLivingRoom to 25
[3/31/2019, 1:43:24 PM] [openHAB2-Complete] Received push with new state for item DimmerLivingRoom: 25
[3/31/2019, 1:43:24 PM] [openHAB2-Complete] Received push with new state for item DimmerLivingRoom: 25
[3/31/2019, 1:43:24 PM] [openHAB2-Complete] Received push with new state for item DimmerLivingRoom: 1
[3/31/2019, 1:43:24 PM] [openHAB2-Complete] Received push with new state for item DimmerLivingRoom: 1
[3/31/2019, 1:43:27 PM] [openHAB2-Complete] Received push with new state for item DimmerLivingRoom: 25
[3/31/2019, 1:43:27 PM] [openHAB2-Complete] Received push with new state for item DimmerLivingRoom: 25

"Hey Siri, Licht im Wohnzimmer ausschalten."

[3/31/2019, 1:43:43 PM] [openHAB2-Complete] Updating state of Licht im Wohnzimmer with item DimmerLivingRoom to OFF
[3/31/2019, 1:43:43 PM] [openHAB2-Complete] Received push with new state for item DimmerLivingRoom: 0
[3/31/2019, 1:43:43 PM] [openHAB2-Complete] Received push with new state for item DimmerLivingRoom: 0
[3/31/2019, 1:43:43 PM] [openHAB2-Complete] Received push with new state for item DimmerLivingRoom: 24
[3/31/2019, 1:43:43 PM] [openHAB2-Complete] Received push with new state for item DimmerLivingRoom: 24
[3/31/2019, 1:43:45 PM] [openHAB2-Complete] Received push with new state for item DimmerLivingRoom: 0
[3/31/2019, 1:43:45 PM] [openHAB2-Complete] Received push with new state for item DimmerLivingRoom: 0

"Hey Siri, Licht im Wohnzimmer einschalten."

[3/31/2019, 1:45:29 PM] [openHAB2-Complete] Updating state of Licht im Wohnzimmer with item DimmerLivingRoom to 0

Here's the same with "OFF" in the code:

"Hey Siri, Licht im Wohnzimmer auf 25%"

[3/31/2019, 1:59:05 PM] [openHAB2-Complete] Updating state of Licht im Wohnzimmer with item DimmerLivingRoom to 25
[3/31/2019, 1:59:05 PM] [openHAB2-Complete] Received push with new state for item DimmerLivingRoom: 25
[3/31/2019, 1:59:05 PM] [openHAB2-Complete] Received push with new state for item DimmerLivingRoom: 25
[3/31/2019, 1:59:05 PM] [openHAB2-Complete] Received push with new state for item DimmerLivingRoom: 0
[3/31/2019, 1:59:05 PM] [openHAB2-Complete] Received push with new state for item DimmerLivingRoom: 0
[3/31/2019, 1:59:07 PM] [openHAB2-Complete] Received push with new state for item DimmerLivingRoom: 25
[3/31/2019, 1:59:07 PM] [openHAB2-Complete] Received push with new state for item DimmerLivingRoom: 25

"Hey Siri, Licht im Wohnzimmer ausschalten."

[3/31/2019, 1:59:14 PM] [openHAB2-Complete] Updating state of Licht im Wohnzimmer with item DimmerLivingRoom to OFF
[3/31/2019, 1:59:14 PM] [openHAB2-Complete] Received push with new state for item DimmerLivingRoom: 0
[3/31/2019, 1:59:14 PM] [openHAB2-Complete] Received push with new state for item DimmerLivingRoom: 0
[3/31/2019, 1:59:14 PM] [openHAB2-Complete] Received push with new state for item DimmerLivingRoom: 24
[3/31/2019, 1:59:14 PM] [openHAB2-Complete] Received push with new state for item DimmerLivingRoom: 24
[3/31/2019, 1:59:17 PM] [openHAB2-Complete] Received push with new state for item DimmerLivingRoom: 0
[3/31/2019, 1:59:17 PM] [openHAB2-Complete] Received push with new state for item DimmerLivingRoom: 0

"Hey Siri, Licht im Wohnzimmer einschalten."

[3/31/2019, 1:59:21 PM] [openHAB2-Complete] Updating state of Licht im Wohnzimmer with item DimmerLivingRoom to 0

What's really weird is that the brightness level is changing a couple of times after each command (except the final "switch on" command). This is only visible on the console. The "real" light is not showing those inbetween brightness states.

Hope that helps! Will do further experiments, if you want.

Cheers,
Jens

from homebridge-openhab2-complete.

steilerDev avatar steilerDev commented on July 19, 2024

I just released V0.10.1, could you please check if the issue still exists? @jewesta @extric99

from homebridge-openhab2-complete.

jewesta avatar jewesta commented on July 19, 2024

I tested 0.10.1 and I'm very sorry to report that the issue still exists. Unfortunately I also noticed that if I use a slider in Apple's Home app to adjust a dimmer, then the dimmer changes rapidly between various brightness settings. It looks like an endless loop at first but after a couple of seconds the constant changing stops at a certain (seemingly random) level. Not sure if this behavior is new.

from homebridge-openhab2-complete.

steilerDev avatar steilerDev commented on July 19, 2024

I noticed this behavior as well (with the random reduction if set through the slider and below 50%). I actually don't have a clue what is causing this.

But the original issue (using Siri to set a specific value) still does not work?

from homebridge-openhab2-complete.

extric99 avatar extric99 commented on July 19, 2024

I finally figured out how to update :-(

Just tested with 0.10.1 and it still has the issue unfortunately. When you ask Siri to turn something on that is a dimmer the value is set to 0%

from homebridge-openhab2-complete.

torpex77 avatar torpex77 commented on July 19, 2024

For what it's worth, I can confirm this behavior in the current version.
I installed fresh using docker, then added "npm install homebridge-openhab2-complete" to startup.sh. Then added a couple of my dimmers.

Let me know if there is anything I can do to help test/debug.

Doug

from homebridge-openhab2-complete.

jewesta avatar jewesta commented on July 19, 2024

Is there anything I can do to assist in terms of the slider / value changing back and forth issue? Unfortunately this issue is beginning to significantly lower the homekit acceptance factor in my house. ;-) I am also observing it with roller shutters where it is a real pain in the butt. The shutters can sometimes start moving up and down for minutes if I am making the mistake of using a homekit slider. Because of this I have stopped using sliders in homekit altogether.

Would it help to peek into the code of homekit-openhab2 where the sliders do not show this strange behavior? Sorry, just grasping for straws here. I know you have probably done this already.

from homebridge-openhab2-complete.

steilerDev avatar steilerDev commented on July 19, 2024

I just stopped using the slider or just adjust and immediately quit the view.

I tried to hunt down the problem and I Wasn't able to track it down. Feel free to look at the logs and everything I am happy about every hint. The problem is that it seems that homekit actually sends the request for the new values. The one thing I can image is a rounding error. Maybe I'll get around to look at this again.

from homebridge-openhab2-complete.

steilerDev avatar steilerDev commented on July 19, 2024

Based on @grzegorz914 pull request (thank you very much for that one!) I added some adjustments. Please test my latest commit and let me know if this fixes the issue: fc33b50

from homebridge-openhab2-complete.

grzegorz914 avatar grzegorz914 commented on July 19, 2024

Hi,
after some test not fixed #43, fixed only #13.
With Your code send value 100 or 0/OFF, with my code send ON/100 and 0/OFF always.
If U look on my rule in #43 state ON enabled light and set to the latest state of brightness(value 100 is ignored), with Your code the light is enabled with 100% of brightness.

from homebridge-openhab2-complete.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.