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

Vallhorn motion sensor always reported as "clear" #26

Closed
Enchufa2 opened this issue Mar 30, 2024 · 5 comments
Closed

Vallhorn motion sensor always reported as "clear" #26

Enchufa2 opened this issue Mar 30, 2024 · 5 comments
Assignees

Comments

@Enchufa2
Copy link

Thanks for this integration. I installed this to incorporate a Vallhorn motion sensor to some automations, but unfortunately it's always reported as "clear" when e.g. the Google Home app correctly reports the activity.

I've dumped the JSON with and without motion being detected and I noticed that this sensor does not use the isOn attribute, but the isDetected one instead. Here's the dump while I'm standing in front of the sensor:

{
   "id":[redacted],
   "relationId":[redacted],
   "type":"sensor",
   "deviceType":"motionSensor",
   "createdAt":"2024-03-29T02:18:45.000Z",
   "isReachable":true,
   "lastSeen":"2024-03-30T12:13:56.000Z",
   "attributes":{
      "customName":[redacted],
      "firmwareVersion":"1.0.64",
      "hardwareVersion":"1",
      "manufacturer":"IKEA of Sweden",
      "model":"VALLHORN Wireless Motion Sensor",
      "productCode":"E2134",
      "serialNumber":[redacted],
      "batteryPercentage":87,
      "isOn":false,
      "isDetected":true,
      "motionDetectedDelay":20,
      "identifyPeriod":0,
      "identifyStarted":"2000-01-01T00:00:00.000Z",
      "permittingJoin":false,
      "sensorConfig":{
         "scheduleOn":false,
         "onDuration":600,
         "schedule":{
            "onCondition":{
               "time":"22:00"
            },
            "offCondition":{
               "time":"06:00"
            }
         }
      },
      "circadianPresets":[
         
      ]
   },
   "capabilities":{
      "canSend":[
         
      ],
      "canReceive":[
         "customName"
      ]
   },
   "room":{
      [redacted]
   },
   "deviceSet":[
      
   ],
   "remoteLinks":[
      
   ],
   "isHidden":false
}

Note the isDetected attribute set to true, which is false when the view is clear. Is there a quick way to patch my installation to use this attribute while a proper fix is implemented?

@Enchufa2
Copy link
Author

Enchufa2 commented Mar 30, 2024

Answering my question, yes, there's a quick workaround. For reference:

And now it works perfectly. This works for me because I'm planning on using Vallhorn sensors only, but a proper fix would probably be a bit more involved.

@sanjoyg
Copy link
Owner

sanjoyg commented Mar 30, 2024

Just to clarify, so the value to read is is_on and not is_detected is that correct?

@sanjoyg
Copy link
Owner

sanjoyg commented Mar 30, 2024

Try release 1.3.5.1 and let know. The issue should be fixed

@Enchufa2
Copy link
Author

I confirm it works perfectly, thanks!

@sanjoyg
Copy link
Owner

sanjoyg commented Apr 2, 2024

Great, closing the issues

@sanjoyg sanjoyg closed this as completed Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants