Hi everyone,
I was planning to try to create a MCP Server to interface my OH instance to an LLM mainly to find out what it could do. Fortunately I found this little project here before I actually started implementing something myself:
It took me a while to set it up the way I was intending to use it (switch to http-transport and integrate it in Windsurf IDE/Cascade AI) but I must say I’m really impressed and pleased with what it can do. If you are interested I’m happy to do a write-up of what I needed to do to get this going in the end.
To learn more about this I also created a fork and added the functionality to query persistence data which gives a lot more fun use cases. What I tried/did so far:
- I don’t have any descriptions for my OH rules yet: Cascade is able to analyze my rules and update the rules with meaningful descriptions.
- Analyzing of persistence data: For example getting the highest/lowest or average temperature of an item within a given time frame works quite nicely.
- Get more complex information about the whole system: Which room is currently the warmest? The LLM did a mistake there and did not actually put the highest temperature on the list but you can get some insights that would take otherwise a lot of work to put together.
- Analyze naming convention breaches of my items and give me hints where my items seem to be diverging from otherwise similar configurations.
- Create simple rules: Switch on the bedroom light when I switch on the hallway light. It did generate Rule DSL script but it was working perfectly. It made sure to find the correct items first with my help (wasn’t able to find it by itself).
- Analyse my rules to find the ones with the highest code complexity.
Ultimately there are so many more options with further extensions of the MCP server. For example I think this could be used to do some time consuming work after replacing equipment to link the items to the new thing or to create new things and connected items when you add another device of a type that is already in your setup or to add a new custom metadata field to a lot of different items or rename items (aka delete, recreate and re-link)…