Motion sensor in homebridge

Hi Guys,

I seem to have some troubles setting up my motion sensor to play nice with homebridge. Can anyone help me out?

The issue:
I’ve added a motion sensor to my home-assistant. This one is a mySensors motion sensor, should that matter. It works as expected in home-assistant (so nothing wrong with the basic setup there) but for some reason it won’t show up on my homebridge!

I’ve tried restarting the raspberry pi running both HA and homebridge, I’ve tried restarting homebridge at a later stage, … nothing worked.

If I’m reading the docs correctly, a motion sensor should have a device_class set, which seems to be set just fine in my customize section (can’t get my indent to work propperly on here):
binary_sensor.motion_sensor_1_1: friendly_name: Motion test device_class: motion

I’ve tried with motion in single and double quotes as well in the customize to no avail …

I have done it once before (using an mqtt motion sensor), I just don’t have the config anymore of that one :slight_smile:

For whomever it may concern, the fix was real simple:

  • the device class was needed in the binary sensor config, not the customization
  • my npm was acting up (read: i probably mistyped or something) and my homebride-homeassistant plugin was outdated.

Hey MrBramme!

Can i ask what you mean by “the device class was needed in the binary sensor config, not the customization”

I have tried to add mine like this and still not working

  • platform: mqtt
    state_topic: “bruh/sensornode1”
    name: “SN1 PIR”
    device_class: motion
    value_template: ‘{{ value_json.motion }}’


I had first added the device class parameter to the “customize” part of my HA config and not the binary sensor config.
After I removed it from my customize.yaml and added it to my binary_sensor.yaml (i’ve split up my config in portions :slight_smile: ) it still didn’t work. But that was when i realized the homebridge plugin that i was using was outdated. So I updated that one, reset my homebridge and presto. it showed up

It probably shouldn’t matter, but maybe the order is acting wierd? my config looks like this:

platform: mqtt state_topic: "test/sensor/motion" name: "Test movement" qos: 0 payload_on: 1 payload_off: 0 device_class: motion

I have some connectivity classes as well, for some reason I’ve always typed these last in my config.

So my best guess whould be to check your HA-homebridge plugin. Is it updated? if not, update and restart. If it is, try moving the device class to the bottom of that config part (but this shouldn’t matter). Also, what version of HA are you using?
Keep me posted please, am curious myself now :slight_smile:

@Cameron_Payne I had the exact same problem. I think we both followed the same video :wink:

Homebridge for some reason cannot detect a motion sensor but it can detect a binary sensor with motion as device class.

My configuration was as follows:

      - platform: mqtt
        state_topic: "bruh/sensornode1"
        name: "SN1 PIR"
        payload_on: "motion detected"
        payload_off: "standby"
        value_template: '{{ value_json.motion }}'
        device_class: motion

Hope that helps.

Thank you both so much for your help! :smiley:
Changing my sensor to binary sensor as advised by @delian7 worked perfect!

Thanks :slight_smile:

awesome! good to hear