[Astro2] Error AstroThingHandler "Can't update state for channel #kilometer"

OH Version: 2.4.0-SNAPSHOT (#1443)

Fir about a week now versions of this error keep appearing in my log.

2018-11-25 16:30:11.255 [ERROR] [ding.astro.handler.AstroThingHandler] - Can't update state for channel astro:moon:local:apogee#kilometer : org.eclipse.smarthome.binding.astro.internal.model.MoonDistance.getKilometer()

I see both ā€˜milesā€™ and ā€˜kilometerā€™ errors.

Is anyone else seeing these? Is there something I can do to solve it?

Thanks!
=C=

I am also on S1443 and I donā€™t see this error

how is your Item defined?

Number          Moon_Distance   "Moon Distance [%.1f km]"       (gAstro)        {channel="astro:moon:local:distance#kilometer"}

(I havenā€™t tried to use UoM)

I just realized that I was using the wrong channel (from an oooold config) but it was still working

The correct Item definition (works also) is:

Number:Length   Moon_Distance   "MoonDistance [%.1f %unit%]"    (gAstro)        { channel="astro:moon:local:distance#distance" }

And for Apogee:

Number:Length   Moon_Apogee_Distance    "ApogeeMoonDistance [%.1f %unit%]"      (gAstro)        { channel="astro:moon:local:apogee#distance" }

edit: following an apt installation of OH2.4.0.S you get the following message:

Listing important changes for version 2.4.0:
  Warning:  Astro Binding: The 'kilometer' and 'miles' channels have been replaced by a new 'distance' channel
  Warning:  Jeelink Binding: The 'currentWatt' and 'maxWatt' channels have been replaced with 'currentPower' and 'maxPower' channels
  Warning:  WeatherUnderground Binding: A bridge has been added on top of the current things, you need to add a bridge containing your api-key.
  Warning:  ZWave Binding: Major changes have been merged to support features such as security. All things must be deleted and re-added. Refer to https://community.openhab.org/t/zwave-binding-updates/51080 for further information.
  Warning:  Synop Binding is now using UoM. 'wind-speed-ms' and 'wind-speed-knots' channels have been replaced by a single 'wind-speed' channel.```

Thanks for replying. Where are these defined? I donā€™t seen anything like those in any of my Items files.

Cheers! :slight_smile:
=C=

These are defined in the $conf/items/*.items file
In my case: /etc/openhab2/items/Astro.items

If you used PaperUI to create your Items, de-link the existing Item from the Channel and relink it to the new Channel (ā€˜distanceā€™)

Yup. Used PaperUI and that was the kicker. Iā€™ve unlinked the miles/kilometer channels and the errors have gone away.

There were 3 sections that had Miles and Kilometer channels, Apogee, Perigee, and Distance. I unlinked them both in all 3 sections. I do not however see a new channel just called ā€˜Distanceā€™. I can add it (them?) via Things I guess or will it show up on PaperUI eventually?

Thanks for your help. :slight_smile:
=C=

The new Channels should appear by themselves in PaperUI
Maybe try to restart your OH2 service? (or delete the existing Things and re-discover them)

I donā€™t have the Channels manually declared in my things fileā€¦ only the Things (and the Channels will appear auto-magically in PaperUI under these Things :slight_smile:)

astro:sun:local		"Local Sun"		@	"Astro"	[geolocation="xx.xxx,yy.yyy,z", interval=60]
astro:moon:local	"Local Moon"	@	"Astro"	[geolocation="xx.xxx,yy.yyy,z", interval=60]

I have the same problems, my setup:
openHABianPi , openHAB 2.4.0-1

After i updated my system from 2.3 to 2.4 , i got the errors in the log:

2018-12-23 13:15:02.317 [ERROR] [ding.astro.handler.AstroThingHandler] - Can't update state for channel astro:moon:local:perigee#kilometer : org.eclipse.smarthome.binding.astro.internal.model.MoonDistance.getKilometer()
2018-12-23 13:15:02.462 [ERROR] [ding.astro.handler.AstroThingHandler] - Can't update state for channel astro:moon:local:apogee#kilometer : org.eclipse.smarthome.binding.astro.internal.model.MoonDistance.getKilometer()
2018-12-23 13:15:02.315 [ERROR] [ding.astro.handler.AstroThingHandler] - Can't update state for channel astro:moon:local:perigee#miles : org.eclipse.smarthome.binding.astro.internal.model.MoonDistance.getMiles()
2018-12-23 13:15:02.311 [ERROR] [ding.astro.handler.AstroThingHandler] - Can't update state for channel astro:moon:local:distance#kilometer : org.eclipse.smarthome.binding.astro.internal.model.MoonDistance.getKilometer()
2018-12-23 13:15:02.718 [ERROR] [ding.astro.handler.AstroThingHandler] - Can't update state for channel astro:moon:local:distance#miles : org.eclipse.smarthome.binding.astro.internal.model.MoonDistance.getMiles()
2018-12-23 13:15:02.398 [ERROR] [ding.astro.handler.AstroThingHandler] - Can't update state for channel astro:moon:local:apogee#miles : org.eclipse.smarthome.binding.astro.internal.model.MoonDistance.getMiles()
2018-12-23 13:15:02.894 [ERROR] [ding.astro.handler.AstroThingHandler] - Can't update state for channel astro:moon:local:distance#kilometer : org.eclipse.smarthome.binding.astro.internal.model.MoonDistance.getKilometer()
2018-12-23 13:15:03.110 [ERROR] [ding.astro.handler.AstroThingHandler] - Can't update state for channel astro:moon:local:perigee#miles : org.eclipse.smarthome.binding.astro.internal.model.MoonDistance.getMiles()
2018-12-23 13:15:03.238 [ERROR] [ding.astro.handler.AstroThingHandler] - Can't update state for channel astro:moon:local:perigee#kilometer : org.eclipse.smarthome.binding.astro.internal.model.MoonDistance.getKilometer()
2018-12-23 13:15:03.370 [ERROR] [ding.astro.handler.AstroThingHandler] - Can't update state for channel astro:moon:local:apogee#miles : org.eclipse.smarthome.binding.astro.internal.model.MoonDistance.getMiles()
2018-12-23 13:15:03.519 [ERROR] [ding.astro.handler.AstroThingHandler] - Can't update state for channel astro:moon:local:apogee#kilometer : org.eclipse.smarthome.binding.astro.internal.model.MoonDistance.getKilometer()
2018-12-23 13:15:03.759 [ERROR] [ding.astro.handler.AstroThingHandler] - Can't update state for channel astro:moon:local:distance#miles : org.eclipse.smarthome.binding.astro.internal.model.MoonDistance.getMiles()
2018-12-23 13:15:03.774 [ERROR] [ding.astro.handler.AstroThingHandler] - Can't update state for channel astro:moon:local:distance#kilometer : org.eclipse.smarthome.binding.astro.internal.model.MoonDistance.getKilometer()
2018-12-23 13:15:03.787 [ERROR] [ding.astro.handler.AstroThingHandler] - Can't update state for channel astro:moon:local:perigee#miles : org.eclipse.smarthome.binding.astro.internal.model.MoonDistance.getMiles()
2018-12-23 13:15:03.801 [ERROR] [ding.astro.handler.AstroThingHandler] - Can't update state for channel astro:moon:local:perigee#kilometer : org.eclipse.smarthome.binding.astro.internal.model.MoonDistance.getKilometer()
2018-12-23 13:15:03.815 [ERROR] [ding.astro.handler.AstroThingHandler] - Can't update state for channel astro:moon:local:apogee#miles : org.eclipse.smarthome.binding.astro.internal.model.MoonDistance.getMiles()
2018-12-23 13:15:03.828 [ERROR] [ding.astro.handler.AstroThingHandler] - Can't update state for channel astro:moon:local:apogee#kilometer : org.eclipse.smarthome.binding.astro.internal.model.MoonDistance.getKilometer()

i removed the thing astro:moon and added it again, but the error appears again. After that, i removed the astro:moon and astro:son and also removed the astro binding. Then i reinstalled the service and the things, but the error appears in the log file.

So i stopped my openhab cleared the cache and started ist again. But unfortunately the error is alway there.

Any idea how i can solve tis issue?

Greeting Detlev.

Itā€™s not an ideal solution and it requires being comfortable with the command line interface, but I eventually solved it. I discuss it over here.

HTH,
=C=

Do you have any Rules running, using it ?

The new Astro Binding distance channel was changed from ā€œastro:moon:local:distance#kilometerā€ to ā€œastro:moon:local:distance#distanceā€, just update your .items file and it will works again.

1 Like

You talked about the directory /etc/openhab2 on my openhabian?

There are no manually added item definitions with

openhabian@openHABianPi:/etc/openhab2$ grep -ir astro:moon *
items/astro.items:Number      Moon_Elevation       "Moon Elevation [%.1f Ā°]"                         <moon>   (Astro) {channel="astro:moon:0070ca98:position#elevation"}
items/astro.items:String      Moon_Phase           "Moon Phase [MAP(astro.map):%s]"                  <moon>   (Astro) {channel="astro:moon:0070ca98:phase#name"}
items/astro.items:DateTime    Moon_Next_Full       "Next Full Moon [%1$td.%1$tm.%1$tY, %1$tH:%1$tM]" <moon>   (Astro) {channel="astro:moon:0070ca98:phase#full"}
items/astro.items:DateTime    Moon_Next_New        "Next New Moon [%1$td.%1$tm.%1$tY, %1$tH:%1$tM]"  <moon>   (Astro) {channel="astro:moon:0070ca98:phase#new"}

Did you follow the instructions above? remove the add-on, use the cli to remove all the items, reinstall ?

=C=

No, i found astro:moon:local:* in Paper UI under Configuration Things. I removed them an everything was ok.
Detlev.