I used it this way before, but there i sometimes get errors:
rule "Alle Stromzähler auslesen"
when
Time cron "0/30 * * * * ?"
then
// getting the payload of the meter
var String meter_payload = executeCommandLine("/usr/src/sml_server /dev/lesekopf0",5000)
var String solar_meter_payload = executeCommandLine("/usr/src/sml_server1 /dev/lesekopf1",5000)
...
So i got the values from both power meters inside the rule.
Now i tested your way with the exec-command in a thing. It works much better and i nearly every time get values send. But the problem is, i need the values from the same time, so that i can calculate the power consumption of my house.
At night it is no plroblem. Then i can use the power usage from my first power meter, but on day when the sun is shining, i have to calculate the first wit the second powermeter, so that i get power usage and not the power which i send to the electricity network.
I made this things-file:
Thing exec:command:powermeter0 [ command="/usr/src/sml_server /dev/lesekopf0", interval=30, timeout=5 ]
Thing exec:command:powermeter1 [ command="/usr/src/sml_server1 /dev/lesekopf1", interval=30, timeout=5 ]
It works very good, but the two exec-commands are fired one on another and not at the same time. So i get a little bit difference in time. I logged this with some loginfo-lines in my rules.
When i use my rule above, the two commands are fired nearly at the same time and do their work at the same time (2 running instances) instead of the thing-exec-command (i think only 1 running instance?).
Also if i use a rule to calculate the two values, i have to wait until both values are updated. If i don´t wait, maybe i calculate with one new value and one old value from 30 seconds ago. And i don´t know how i can check if both values are new.
I think, the best way would be, if i can start the execution of the exec-command in the thing from my rule and not to let the thing execute it all 30 seconds. But i don´t think, that is possible. So i have to use my old rule which did the job (but sometimes i get no values received).