Use script output in rule

It seems that this is working…


rule "Alle Stromzähler auslesen test2"
	when
			Item PowerMeter_new_test received update // String Item linked to exec:command channel that runs above script
	then
			var readings_lines = PowerMeter_new_test.state.toString.split('\n')
			if ((readings_lines.size('\n') == 10) {
					var test123_new = readings_lines.get(4).split('#').get(1)
					PowerMeter_new1.postUpdate(test123_new)
			}
end

How can i put the last two lines of the “if” into one single line?

Glad you got it working. I’ve been on travel and then was ill so have been away from the forums for a while.

PowerMeter_new1.postUpdate(readings_lines.get(4).split('#').get(1))