t0bst4r / matterbridge-home-assistant

Apache License 2.0
30 stars 2 forks source link

Feature request: sensor and binary_sensor #130

Open akatsuki-meigetsu opened 3 days ago

akatsuki-meigetsu commented 3 days ago

Domain

No response

What is actually missing?

sensor is important in IoT, if matterbridge support sensor, we can use it to create more various automations in different platforms.

t0bst4r commented 3 days ago

@bassrock already started working on it (https://github.com/t0bst4r/matterbridge-home-assistant/pull/118) for binary sensors.

what exactly are you missing? What kind of sensors? What values do they have? Can you provide their attributes?

akatsuki-meigetsu commented 2 days ago

Like air quality sensor, temperature sensor, humidity sensor, I noticed Matterbridge could support this type sensor, thus hoping matterbridge-home-assistant plugin supporting them.

t0bst4r commented 21 hours ago

@akatsuki-meigetsu Basic support for binary sensors (occupancy, doors, contact sensors) was added by @bassrock in #118 We just merged it and it'll be released as 1.4.0 in some minutes.

@bassrock Let's proceed the sensor discussion over here. The main problem is, that home assistant provides each entity on its own. At the moment we have no clue, if multiple entities are related to each other. Actually... how does it work with apple homekit or alexa integrations?

bassrock commented 21 hours ago

@t0bst4r The homekit and alexa integrations use the device registry to grab all linked sensors/entities as needed for things like Battery state https://github.com/home-assistant/core/blob/dev/homeassistant/components/homekit/__init__.py#L1152

As far as I can tell, it looks like the homeassistant js websocket library doesn't support grabbing device ids or linked devices

t0bst4r commented 21 hours ago

Okay, i am also using the device registry. So we could group entities by their related device and build matter-devices from those groups. But that's definetly a larger change 😁

bassrock commented 21 hours ago

Oh i totally missed that you are pulling that info! So probably in the bootup where things are ignored there needs to be a "linking" of sorts based on device id. Then the matter devices could get more hardware info, battery state, energy usage etc!

akatsuki-meigetsu commented 20 hours ago

I tested 1.5.0 version, however, it crushed on docker type Matterbridge(1.3.7), seemed caused by light.

t0bst4r commented 19 hours ago

Just released a bug fix. Please test with 1.5.1

akatsuki-meigetsu commented 6 hours ago

now working successfully, thanks !