There are a couple of different issues here, I suspect. First, @opus is correct. Because you are still on OH3, unless you have manually updated the helper libraries, you must still use the getItem syntax. Forms like this
Were introduced into JSscripting for OH4.
Next, in JSscripting, if you get the state of an item it has already been converted to a string. You have to use a different property, rawState, to get the state in it’s original, non-string, type. Calling toString on a string isn’t a problem, it’s just not necessary.
Lastly, however, if you just use Nap_allas.toString, that is referencing thetoString function, not calling it. This means that your Nap_allas variable has now become the function itself, not the output of the function! Not surprisingly, sendCommand doesn’t know what to do when you give it a function for input instead of the string it is expecting. To make sure you get the function’s output, you need () after the function name: Nap_allas.toString().