Foddy / node-red-contrib-huemagic

Philips Hue node to control bridges, lights, groups, motion sensors, temperature sensors and Lux sensors using Node-RED.
https://flows.nodered.org/node/node-red-contrib-huemagic
Apache License 2.0
200 stars 67 forks source link

Motion Activity broken with V4.2.2 (4.2.1 is OK) #384

Open spacewalker0815 opened 2 years ago

spacewalker0815 commented 2 years ago

Hello, unfortunately the new version 4.2.2 does not work for me. The motion function is disturbed.

I have two Philis Hue Motion sensors and switch with each of them a KNX lamp. The function msg.payload.motion does not provide correct values anymore. After restarting the node, the function returns once or twice the correct value (true / false) but stops the operation at some point, without error message. Then it reports no motion at all although the sensor works correctly.

In version 4.2.1 (I deleted the module and installed it against the old version) everything works again without any change.

Is the problem known ?

Tomas

jankokert commented 2 years ago

Hello, I have a very similar problem. In my case, the switch accessories (both tab switch and dimmer switch) stop working after about 10 second. Only a re-deploy of the flow will let it work for the next 10 seconds. No error messages are given.

I installed v4.2.1 via

cd ~/.node-red npm uninstall node-red-contrib-huemagic@4.2.2 npm install node-red-contrib-huemagic@4.2.1

everything works again.

Please check, what's going on here! Many thanks in advance!

jankokert commented 2 years ago

When I check the code differences from V4.2.1 to 4.2.2 ( https://github.com/Foddy/node-red-contrib-huemagic/commit/1473baae947bac9cf14b5aa0d360fdbc84f79ca4#diff-2506f6042d7e0a3f37030320ae9bf2a87e9b7b11b8b081102cf4facec664d0d6 ) there are some changes with a watchdog and there is a timeout of 10.000ms (=10s) defined. I think there is the issue...

adams-family commented 1 year ago

I confirm that motion events are not working in 4.2.2 :(

Except that downgrading to 4.2.1 nor to 3.0.0 did not solve the problem. I think something might have changed on the bridge with an update.

My bridge version is: swversion: "1953188020" apiversion: "1.53.0"

JSON returned by the bridge:

{
  sensors: {
    "1": {
      state: {
        presence: true,     // motion has been activated
        lastupdated: "2022-10-14T06:47:15"
      },
      swupdate: {
        state: "noupdates",
        lastinstall: "2019-09-02T12:22:50"
      },
      config: {
        on: true,
        battery: 1,
        reachable: true,
        alert: "lselect",
        ledindication: false,
        usertest: false,
        sensitivity: 2,
        sensitivitymax: 2,
        pending: array[0]
      },
      name: "My Sensor",
      type: "ZLLPresence",
      modelid: "SML001",
      manufacturername: "Signify Netherlands B.V.",
      productname: "Hue motion sensor",
      swversion: "6.1.1.27575",
      uniqueid: "xx:xx:xx:xx:xx:xx:xx:xx-xx-xxxx",    // stripped
      capabilities: {
        certified: true,
        primary: true,
      }
    }
  }
}

Hope this helps.

mauricedominic commented 1 year ago

For the time being I've created a fork and applied some fixes that should solve these issues. I have published it as a new node-red node contrib. You can find it as node-red-contrib-huemagic-fork.

sebastienvermeille commented 1 year ago

@mauricedominic great! I would like to use your fork but I cannot install it from node red it tells me it conflict with the original extension.

Is there a way to install it manually and "remove the old one" without having to reimport all my workflows etc ?

(via npm commands evtl?) Thank you

mauricedominic commented 1 year ago

@mauricedominic great! I would like to use your fork but I cannot install it from node red it tells me it conflict with the original extension.

Is there a way to install it manually and "remove the old one" without having to reimport all my workflows etc ?

(via npm commands evtl?) Thank you

Here below the steps you could take in order to use the fork contrib without having to re-create all of them:

  1. Create a backup of all flows that refer to the huemagic nodes
  2. Remove all the huemagic related flows
  3. Remove all the huemagic related configuration nodes
  4. Deploy all changes
  5. Remove the original huemagic nodes contrib
  6. Install the huemagic fork nodes contrib
  7. Import the backup created in step 1
  8. Deploy all changes

Cheers!