opctim / homebridge-espresense

Homebridge implementation for using ESPresense node data as occupancy sensors in HomeKit. This plugin is an alternative to using HomeAssistant, as ESPresense is primarily built for HA.
Apache License 2.0
8 stars 1 forks source link

Plugin Doesn't detect devices #2

Open Rahulsharma0810 opened 2 years ago

Rahulsharma0810 commented 2 years ago

Config file with devices.

        {
            "name": "homebridge-espresense",
            "platform": "ESPresense",
            "mqtt": {
                "url": "mqtt://192.168.0.24:1883",
                "options": {}
            },
            "roomSettings": [
                {
                    "name": "officeroom",
                    "maxDistance": 4,
                    "absorption": 3.5,
                    "activeScan": true,
                    "timeout": 6000,
                    "devices": [
                        "irk:ec4a9f44be8338bd17e908f4f9bd0d2c",
                        "irk:3c4809a0b1608442d8be28d2a86e254a"
                    ]
                }
            ]
        }

Mqtt getting devices

image
[9/19/2022, 1:21:49 PM] Homebridge v1.5.0 (HAP v0.10.3) (Homebridge) is running on port 51766.
[9/19/2022, 1:21:49 PM] [homebridge-espresense] Connected to MQTT.
[9/19/2022, 1:21:57 PM] [homebridge-espresense] Initialized Characteristics for room officeroom
[9/19/2022, 1:21:57 PM] [homebridge-espresense] [officeroom] Turned active_scan OFF
[9/19/2022, 1:21:57 PM] [homebridge-espresense] [officeroom] Subscribed to device topic.Room ready. Device timeout: 5000
[9/19/2022, 1:21:57 PM] [homebridge-espresense] [officeroom] Listening to presence data. Watched devices: []
[9/19/2022, 1:21:59 PM] [Homebridge UI] Changes to config.json saved.
[9/19/2022, 1:22:02 PM] [homebridge-espresense] [officeroom] Found: []

The strange part is if I removed roomSettings block it still shows the same output. Any configurations I am missing ?

opctim commented 2 years ago

Hi @Rahulsharma0810 ,

what exactly is the issue here? I can see that devices are detected in MQTT. Are you concerned about the empty console info output?

Rahulsharma0810 commented 2 years ago

I am not able to get the accessories as sensors in homebridge.

magically after some time it magically started working.

9/19/2022, 4:52:33 PM] [homebridge-espresense] Connected to MQTT.
[9/19/2022, 4:52:38 PM] [homebridge-espresense] Initialized Characteristics for room officeroom
[9/19/2022, 4:52:38 PM] [homebridge-espresense] [officeroom] Turned active_scan ON
[9/19/2022, 4:52:38 PM] [homebridge-espresense] [officeroom] Set absorption to 3.5
[9/19/2022, 4:52:38 PM] [homebridge-espresense] [officeroom] Set max_distance to 4
[9/19/2022, 4:52:38 PM] [homebridge-espresense] [officeroom] Subscribed to device topic.Room ready. Device timeout: 6000
[9/19/2022, 4:52:38 PM] [homebridge-espresense] [officeroom] Listening to presence data. Watched devices: ["irk:ec4a9f44be8338bd17e908f4f9bd0d2c","irk:3c4809a0b1608442d8be28d2a86e254a"]
[9/19/2022, 4:52:40 PM] [homebridge-espresense] [officeroom] Found: ["irk:3c4809a0b1608442d8be28d2a86e254a"]
[9/19/2022, 4:52:40 PM] [homebridge-espresense] [officeroom] Updated sensor to "1"
[9/19/2022, 4:52:43 PM] [homebridge-espresense] [officeroom] Found: ["irk:3c4809a0b1608442d8be28d2a86e254a","irk:ec4a9f44be8338bd17e908f4f9bd0d2c"]

However there are no Accessories in the homebridge tab, also when I tried to pair the homekit with the homebridge, the occupancy sensor reported IMG_06CDA79EDDA2-1

ncls-fcs commented 1 year ago

I´ve got the exact same issue as you. Did you restart home bridge to get it to work or did you let homebridge run for some time and then it started to magically work?

caarlos0 commented 1 year ago

for me it was the room name in the espresense config and the homebridge-espresense plugin config had a typo in it

make sure both configs have the same room name

once I fixed that, it started working