Hi,
I’m trying to create a chart/graph using the data sent by an Arduino. The warning code, items, sitemap and rules config is below.
Data is updated on events.log but the data won’t show on the sitemap (i.e. if Arduino sends a value 20, the sitemap doesn’t show the number 20, it remains blank). Chart also doesn’t show up.
The warning code:
2016-04-19 15:52:28.657 [ERROR] [o.o.c.s.ScriptExecutionThread ] - Error during the execution of rule ‘Arduino sends to Openhab’: Could not invoke constructor: java.lang.Integer.Integer(java.lang.String)
2016-04-19 15:52:28.701 [WARN ] [o.o.u.w.i.render.ChartRenderer] - Chart cannot be rendered as item ‘Weight’ does not exist.
Items:
String Arduino “Arduino [%s]” (arduino) {serial="/dev/ttyACM0"}
Number Weigth “[Weight %s]” (arduino)
Sitemap:
Text label=“Arduino” item=Arduino
Chart label=“Weight” item=Weight period=h refresh=2000
Rules:
rule "Arduino sends to Openhab"
when
Item Arduino received update
then
var Integer Weight = new Integer(Arduino)
Weigth.sendUpdate(Weight)
end rule