I’ve been trying to port the OH2.5 Eagle 200 binding to OH3. The Eagle 200 is a device that lets you read the current values of your SmartMeter, and having that in openhab (and also persisted to influx/grafana, via openhab) is really handy.
I’m way out of date on Java and the tool chain has been a struggle, but the code itself is good. Thomas Hentschel, the original author, wrote nice clean code and I haven’t had any trouble understanding it, just trying to get Eclipse and the build tools to do things like include a module. The OSGI environment is large and complex and I’ve spent a lot of time lost at sea in it.
I’ve finally got the whole system running, all of the errors cleared up and all but a handful of the warnings. My test system is cheerfully chugging along, talking to my device and noticing the data updates.
At least, according to the log files it’s noticing the updates. I’m seeing two issues that I haven’t been able to untangle yet.
This may be more useful for me to find out: I also don’t know the best way to share a chunk of code with people here to let them look at it in larger chunks and see if they can spot the thing I’m missing. What’s the preferred method? I can fork the openhab-addons on Github and check my changes in there, which is probably the simplest way to let people look at the whole binding. Is there a preference?
This module works by using a bridge Thing that talks to the Eagle 200 device, and then creating each item the Eagle 200 knows about as a Thing connected to that bridge. Pretty straightforward.
The Eagle 200 doesn’t know what values the devcies it shares will offer, and different power meters offer different values. So the binding doesn’t try and have a fixed set of channels for the meters. It has a generic “numeric” one and a generic “string” one, and when the meter Thing is created it updates the channel list by querying the device. As data comes in, it updates the channels it created.
When the device is discovered and added as a Thing, I can see in the log it creates the channels, and then I can see data being added to them. If I use the Felix console in Eclipse and run “openhab:things show” on the electric meter thing, I can see all channels listed there.
But the UI never shows those channels anywhere. I can’t see them on the Thing, and I can’t add them to an Item. The REST interface does not see them listed.
Is this just a reload issue in the UI, or have I missed something to make a channel visible?
If I shut down the program and restart it, it re-creates the bridge Thing and the meter Thing, but the channels are never being created on the meter Thing.
Watching the initialization run, the code finds the channel already exists, so does not create it, but if you show the Thing with openhab:things show, no channels are defined.
Somehow it’s checking and thinking they’ve been persisted, but then they don’t show in the system.
Where can I go to get more technical advice on what I’m seeing here?