Hey everyone, I wanted to share my recent experience integrating the P1 Monitor software with Openhab 3. I’ve been using P1 Monitor on a Raspberry Pi Zero to track my power and gas consumption, and I’ve been eager to bring those metrics into my Openhab setup for better monitoring and automation.Initially, I stumbled upon a solution for Home Assistant, which was a great starting point. The idea was to use the REST API provided by P1 Monitor to pull the consumption data into Openhab. However, since I’m not very familiar with Home Assistant, I needed to translate that solution into something that works seamlessly with Openhab 3.After some research and trial and error, I managed to set up a REST binding in Openhab to fetch the data from P1 Monitor. Here’s a quick rundown of what I did:1. Configuring the REST Binding: I set up a REST endpoint pointing to the P1 Monitor API URL. This involved specifying the correct URL and ensuring that the data format was compatible with Openhab.2. Creating Items: I created items in my Openhab configuration to represent the different consumption metrics like power usage, gas consumption, and production values. This allowed me to map the JSON data from the API to these items.3. Testing and Fine-Tuning: I tested the setup to ensure that the data was being fetched correctly and that the items were updating in real-time. It took a bit of tweaking to get the JSON paths right, but once everything was aligned, it worked like a charm.4. Visualizing the Data: To make the data more accessible, I designed a widget for the main UI that mirrors the look and feel of the native P1 Monitor interface. This involved some custom styling and layout adjustments to ensure it fit seamlessly into my existing dashboard.The end result is fantastic! I now have real-time energy consumption data integrated into my Openhab setup, which opens up a world of possibilities for automation and monitoring. For instance, I can now set up rules to track high energy usage periods or even integrate this data into my home’s energy management system.I’d like to give a shoutout to the Openhab community for their incredible resources and support. Without the forums and documentation, I wouldn’t have been able to pull this off. If anyone else is looking to integrate P1 Monitor or similar tools, I’d be happy to share more details or help troubleshoot any issues you might encounter.Happy automating everyone! ![]()