bwp91 / homebridge-ewelink

Homebridge plugin to integrate eWeLink devices into HomeKit.
MIT License
384 stars 127 forks source link

Gate Sensor issue #391

Closed angyalz closed 1 year ago

angyalz commented 1 year ago

What issue do you have? Please be as thorough and explicit as possible.

Gate Sensor isn't working as well at HomeKit (always closed; see logs below). In eWeLink app it works fine. Gate works, but not as expected. Config not changed in HomeBridge. Maybe important: iOS 16.0 beta tvOS 16.0 beta

Details of your setup.

(1) HomeBridge UI-X

v1.5.0 (latest)

Raspberry Pi NodeJS v16.16.0 npm v8.11.0

v10.0.0 (latest) No (but it didn't cause any problems before)

Gate: Sonoff Mini (v1) Gate sensor: Sonoff Mini (v1)

Please paste any relevant logs below.


[eWeLink] Config entry [bridgesensors] has an invalid entry which will be ignored.

[eWeLink] [Gate Sensor] could not be initialised as Cannot read properties of undefined (reading '0') at default.initialiseDevice (file:///usr/lib/node_modules/homebridge-ewelink/lib/platform. js:790:58).
angyalz commented 1 year ago

Update: I recognized the first problem is I named the sensor to 'Gate Sensor', so I added 'gate' to the array. The next issue:


[eWeLink] [ Gate Sensor] device update failed as Cannot read properties of undefined (reading 'updateCharacteristic') at default.externalUpdate (file:///usr
/lib/node_modules/homebridge-ewelink/lib/device/simulation/sensor-visible.js:183:24).

Logged out:


[eWeLink]
Gate Sensor] initialising with optio ns {"logging": "standard"
', "lowBattThr
eshold":25}. hapchar:
Function: LockCurrentStat
e]{
UUID: '0000001D-0000-xxxx'
UNSECURED: 0,
SECURED: 1, JAMMED: 2, UNKNOWN:
3
} [Function: LockTargetState] {
UUID:
0000001E-0000-xxxx'
1
UNSECURED: 0,
SECURED: 1
}

DeviceID and SensorID are correct in config

bwp91 commented 1 year ago

Hi @angyalz

Can you try renaming your config item

[eWeLink] Config entry [bridgesensors] has an invalid entry which will be ignored.

from bridgesensors to bridgeSensors? And see if this makes things start working?

angyalz commented 1 year ago

Hi @bwp91,

It just my fault while copying the log (from the photo of log). In config this key named as right as well (by UI config)

image

bwp91 commented 1 year ago

Can you show me your config just for this device so I can get a sense of what you’re trying to do?

angyalz commented 1 year ago

@bwp91 Of course:


"singleDevices": [
                {
                    "label": "Gate",
                    "deviceId": "1000xxxxb4",
                    "deviceModel": "single",
                    "showAs": "gate",
                    "operationTime": 160,
                    "sensorId": "1000xxxxd5",
                    "hideSensor": false,
                    "overrideLogging": "debug"
                },
                {
                    "label": "Gate Sensor",
                    "deviceId": "1000xxxxd5",
                    "deviceModel": "single",
                    "showAs": "sensor",
                    "sensorType": "contact",
                    "overrideLogging": "debug"
                }
            ],
            "bridgeSensors": [
                {
                    "type": "motion"
                }
            ],
angyalz commented 1 year ago

@bwp91 My first attempt was to adding 'gate' string to the sensorId array in platform.js at line 788 (but I realized it was not the best idea. At the same time, the sensor started to show real status, but not the gate) PS: do you need the value of any variable?

bwp91 commented 1 year ago

Does the gate sensor have an on/off status based on whether the gate is open or closed? If so you would would be better to use the show as '1 Garage Door' option rather than Gate. They both show the same accessory type in HomeKit.

The 'gate' simulation is not (yet) coded to take advantage of using a separate sensor for status

angyalz commented 1 year ago

@bwp91 Thanks for the fast reply! I changed the type to garage door, it works as expected. But the error log from sensor-visible.js:178 stays. (But I can live with it) Of course the 'gate' string was removed from array of sensorId at platform.js Thanks for your help!

bwp91 commented 1 year ago

If you update to beta version 10.0.1-beta.1 do you still get this warning in the log?

angyalz commented 1 year ago

@bwp91 Yes

bwp91 commented 1 year ago

When the plugin initialises, in which order do your devices appear in the first list? I just need to know which comes first, the “gate” device or “gate sensor” device?

angyalz commented 1 year ago

@bwp91 By the log the order is other devices, Gate Sensor, other devices, Gate, other devices

stale[bot] commented 1 year ago

This issue has been automatically marked as inactive because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

bwp91 commented 1 year ago

Hi, Closing this just as been a little overwhelmed with issues recently. If this is still an issue or a feature you would like implemented then please do re-open this ticket! Thanks for your understanding!