Items bound to a channel are empty / not updated

Hi there,

I’ve developed a new binding which reads out data of my sma inverter.

Everything is working fine so far but the items on my sitemap page are not showing anything and do not receive any updates…

So in my binding, if a value has changed for the current daily production value I update the state:

updateState(SMAInverterBindingConstants.CHANNEL_DAILY, new DecimalType(dailyProduction.doubleValue()));

My thing is properly configured:

Thing smainverter:inverter:tpl10k

My item has been added to the .items file:

Number SMA_Daily_Prod           "Daily production [%.1f kWh]"      <solarplant>      { channel="smainverter:inverter:tpl10K:daily" }

and my sitemap does contain the item:

Frame label="SMA Inverter" {
    Text item=SMA_Current_Prod
    Text item=SMA_Daily_Prod
    Text item=SMA_Total_Prod
}

and of course my channel is exposed via pom.xml

<channels>
        <channel id="daily" typeId="daily" />
        <channel id="current" typeId="current" />
        <channel id="total" typeId="total" />
    </channels>

Images and text is shown fine, but no value is added, every label contains a “-”.
Am I missing anything?

Would really appreciate any help, thank you very much in advance

Does it show in the log it received updates? And do you have the code somewhere on GitHub, because based on the information you gave I can’t see what might be wrong.

I’ve uploaded the stuff to a repository here:


Unfortunately no update logs are shown even on TRACE level

Not sure if it causes your problem, but your channels are defined as QuantityType, but you pass a DecimalType as argument. Also don’t override updateState. The method has a variant with ChannelUID as argument and if you would call that instead of the String variant it would bypass your override method and cause unexpected behavior.

So I changed my item type to energy (as already defined in the channel)

Number:Energy SMA_Current_Prod         "Current production [%.1f kWh]"    <solarplant>      { channel="smainverter:inverter:tpl10K:current" }     
Number:Energy SMA_Daily_Prod           "Daily production [%.1f kWh]"      <solarplant>      { channel="smainverter:inverter:tpl10K:daily" }       
Number:Energy SMA_Total_Prod           "Total production [%.1f kWh]"      <solarplant>      { channel="smainverter:inverter:tpl10K:total" }       

And now do not pass DecimalType but

return new QuantityType<Energy>(value, SmartHomeUnits.KILOWATT_HOUR);

Unfortunately this does not change anything.

I really don’t get what I am missing

Sorry but I am still having trouble with this issue - nothing is getting updated (btw even the yahoo weather channel which is included in the demo app):
Number:Temperature Weather_Temperature "Outside Temperature [%.1f °C]" <temperature> (Weather) { channel="yahooweather:weather:berlin:temperature" }

Is not receiving any updates

I do not get what I am missing, therefore I’d really appreciate any help :slight_smile:

Thanks in advance

What.do you use as ide? Did you install eclipse as described in the documentation: https://www.openhab.org/docs/developer/ide/eclipse.html

I’m asking because the Yahoo binding has been removed some time ago because they shutdown the API. And the Yahoo binding isn’t in the recent demo app. Also due to the build system changes you should use the ide as described in the instructions.

Yahoo weather API was retired nearly a year ago now. You’ll want to find a different simple test.

Okay sorry, you are right - the yahoo weather items are still in the demo sitemap but there is no binding, you are right…

I got it working now, but I do not really understand whats happening and why the framework channel seems to be different to the one I defined.

Here is what I’ve changed:

The handleCommand method is called with a refresh Command and the channel is smainverter:inverter:30284926:current

So I changed my item to listen to that channel:

`Number:Energy SMA_Current_Prod "Current Production [%.3f %unit%]" <solarplant> { channel="smainverter:inverter:30284926:current" }`

I do not know why the number 30284926 has been added, because I thought that there should be the thing_id instead. The thing_id I’ve defined in my demo.things file is:

Thing smainverter:inverter:tpl10k

So can someone tell me what’s wrong here?

The number is a thing identifier. As channels belong to things and you may have multiple things of same type in order to uniquely identify them their identifiers (ChannelUID) do contain also a thing id.