Mismatched input '' expecting RULE_ID

Hello, Maybe this is a beginner question but I can not find a hint.

mismatched input ‘’ expecting RULE_ID

Where can I find the description for RULE_ID

here is my items list

//Gruppe für den Chart
Group Strom_Chart

//Gruppe für die Sitemap-Einbindung
Group Strom

// Schalter, der den Status der Steckdose anzeigt (an/aus)
Switch Stromzaehler “Status Steckdose” (Strom) { channel=“avmfritz:FRITZ_DECT_200:32eb7005:outlet”}

// Der Gesamtverbrauch - jeweils auf zwei Nachkommastellen gerundet
Number Strom_Gesamtverbrauch “Gesamtverbrauch in Wh [%.2f Wh]” (Strom) { channel=“avmfritz:FRITZ_DECT_200:32eb7005:energy”}

// Leistung (W)
Number Strom_Leistung “Leistung [%.2f W]” (Strom, Strom_Chart) { channel=“avmfritz:FRITZ_DECT_200:32eb7005:power”}

// Spannung (V)
Number Strom_Spannung “Netzspannung [%.2f V]” (Strom) { channel=“avmfritz:FRITZ_DECT_200:32eb7005:voltage”}

// Temperatur ©
Number Strom_Temperatur " Temperatur [%.2f C]" (Strom, Strom_Chart) { channel="avmfritz:FRITZ_DECT_200:32eb7005:temperature "}

// Benoetigt, um die Zeitintervalle fuer die grafische Darstellung festlegen zu koennen
Number Strom_Chart_Intervall “Chart-Intervall”

// Die KWh werde ich in einer rule ausrechnen lassen
Number Strom_Gesamtverbrauch_KWH “Gesamtverbrauch in KWh [%.2f KWh]” (Strom)

// Preis pro KWh wird in der Rule errechnet
Number Strom_Summe “Bislang verursachte Kosten [%.2f Eur]” (Strom)

Could you show us the whole error message?
It doesn’t sound like anything to do with your items, but what is the filename of your ‘items list’? Have you any files with names like xxx.rules?

2019-06-09 18:42:05.186 [INFO ] [ebuilder.internal.HomeBuilderServlet] - Started Home Builder at /homebuilder

2019-06-09 18:42:05.237 [INFO ] [panel.internal.HABPanelDashboardTile] - Started HABPanel at /habpanel

2019-06-09 18:42:05.295 [INFO ] [ashboard.internal.HABotDashboardTile] - Started HABot at /habot

2019-06-09 18:42:20.875 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model ‘fritz.items’ has errors, therefore ignoring it: [28,8]: mismatched input ’ ’ expecting RULE_ID

[31,8]: extraneous input ’ ’ expecting RULE_ID

2019-06-09 18:42:21.840 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model ‘rrd4j.persist’

Yes I created a file with rules rrd4j.rules alternatively fritz.rules

import org.openhab.core.library.types.*
var Number Var_WH

var Number ESSL_KWH=0.25

rule “Berechne KWh”
when
Item Strom_Gesamtverbrauch changed
then
Var_WH = Strom_Gesamtverbrauch.state
var Number Var_KWH = Var_WH / 1000
Strom_Gesamtverbrauch_KWH.postUpdate(Var_KWH)
end

rule “Berechne Kosten Strom”
when
Item Strom_Gesamtverbrauch_KWH changed
then
var Number Var_KWH = Strom_Gesamtverbrauch_KWH.state
var Number Kosten = Var_KWH * ESSL_KWH
Strom_Summe.postUpdate(Kosten)
end

fritz.items
You didn’t use code fences in your first post, but when I paste your Items into VSCode not all the quote marks “” are the same. Only Strom_Temperatur has the correct plain " marks.

Thank you for helping.
After your comment I looked in VS Code. I found several no printable chars in the item definition. After deleting this chars everything was ok.

Thanks for the clue that helped me solve a similar problem.

I had copied some code before deleting it. Later I copied a snippet back. Apparently going between VS and MS Onenote, the spaces were transformed.

1 Like