Seeed-Solution / SenseCAP_Indicator_ESP32

SenseCAP Indicator SDK.
https://wiki.seeedstudio.com/SenseCAP_Indicator_How_To_Flash_The_Default_Firmware/#ESP-IDF
Apache License 2.0
32 stars 22 forks source link

Indicator matter #24

Open Timo614 opened 10 months ago

Timo614 commented 10 months ago

Adds "indicator_matter" which is a version of indicator_basis with support for matter provisioning and some basic features requested via the call for help project page.

Primarily:

Just pushing up for now as part of the project deliverables (will link this PR from the project request page).

https://photos.google.com/share/AF1QipNSgP0x3VHC4D1SGsiRcTuWa9qzAcE7PdVfn3XSmnu2Wm38uMu8VvHdaM1O17W-fw?key=d1VPV3JkRlVyd3M4MzFmd1dpb1dvdEsxOGN1c3RR

Timo614 commented 10 months ago

I pushed up an additional commit to clean up the logic a bit further. I shouldn't need to touch it again just was removing some earlier iteration elements and combining a view event loop to reduce the memory usage a bit further.

Timo614 commented 10 months ago

Going to close this out, apologies here, the approach taken here was to create devices and then trigger automation based on that but the desired state is to have the matter app handle controlling other matter devices directly via the binding logic. Given this doesn't do that and I'm not sure of a way to do it on Google Home or Apple closing in favor of letting another developer with more experience grab the underlying issue.

alistair23 commented 3 months ago

What's the status here? The documentation states that this is supported

Timo614 commented 3 months ago

Worked for me without issue -- the reviewer was having some issues connecting with their home assistant device at the time. Matter support in the environment was fairly new at the time I had worked on this so it was in a bit of a flux from a home assistant support perspective. I imagine various home assistant support for Matter is much better now though if they want to take another look.

I have a little time in a day or so and can confirm if things still work from a fresh install / environment.

Timo614 commented 3 months ago

I took a look into the repository and the underlying ESP version (5.0.1) that was used here for the indicator at the time is now broken because of some incompatibility. They patched that with a commit but only to the release branch for 5.0 versus the individual versions.

That said it looks like this repo has been updated since this PR to move away from the need to use the patch and it should be able for us to use a more recent ESP IDF version as a result. I'll take a look at updating this PR time permitting to work with the latest versions and update the demo to reflect some of the more recent updates made to the merged examples over the next week or so.

Timo614 commented 2 months ago

I made a few modifications to the branch and added the experimental env var. I'm able to connect and still operate the demo on my end with esp idf's 5.1 version. Let me know if anyone runs into any issues.

alistair23 commented 2 months ago

Tested against IDF 5.3 and I can add the device to a Matter network.

I'm looking at customising it a bit to show different information. Any hints on where to start to display information from Home Assistant and to send custom information?

Love4yzp commented 2 months ago

Any hints on where to start to display information from Home Assistant and to send custom information?

To works with it, as there is no integration, so we could use API. I just used MQTT, RESTful and websocket.

Timo614 commented 2 months ago

For the matter related stuff in particular:

The callbacks from the controller: https://github.com/Timo614/SenseCAP_Indicator_ESP32/blob/timo614-indicator-matter/examples/indicator_matter/main/model/indicator_matter.cpp#L181 Here I took the value, stored it, and triggered an event related to the dashboard data being updated.

The endpoints are configured here: https://github.com/Timo614/SenseCAP_Indicator_ESP32/blob/timo614-indicator-matter/examples/indicator_matter/main/model/indicator_matter.cpp#L465

And it's handling the view events here: https://github.com/Timo614/SenseCAP_Indicator_ESP32/blob/timo614-indicator-matter/examples/indicator_matter/main/model/indicator_matter.cpp#L357

So with the Home Assistant setup for Matter it can provision whatever endpoints are connected to the device and then add it to a dashboard etc. There are standard device types out there which make it easier to connect to various systems and some clients restrict features / devices. I found the esp-idf way of handling Matter a lot more intuitive than the zaptool personally.