I have change my OpenHAB from 2.0 to 3.1 and now I will rewrite my rules
Ihav have in OpenHAB 2.0 this rule
Item raumtemp_og_sz_soll changed
og_siz_thermostat_soll.sendCommand(raumtemp_og_sz_soll.state as DecimalType)
This rule works fine.
Now I habe try this rules in OpenHAB 3.1 in ECMAScript:
events.sendCommand('og_siz_thermostat_soll', raumtemp_og_sz_soll.state as DecimalType);
but nothing works!
What do I wrong?
Have you tried sending a string?
Even in DSL, action
sendCommand("item","value") requires two strings.
yes, I have tested with a string to a text item and this works fine:
events.sendCommand('test_string', 'Hallo OpenHAB');
alright, let me be more explicit; send a string to any Item type you like.
I am not sure, that I understand your question, but I tried this:
and this works.
I have look via console, and the item raumtemp_og_sz_soll have a value 14
openhab> openhab:status raumtemp_og_sz_soll
Okay, that’s two different Items (siz / sz)
How about this?
var item = itemRegistry.getItem('raumtemp_og_sz_soll');
thank you, yes, now it works.
Exist a library of code example from OpenHAB3 with ECMAScript?
Where is the syntax definition of ECMA Script?