As @thex pointed out the problem is caused by requiring the luxtronilk2 module, but there is nothing wrong with your code. The actual guilty is a default parameter in the luxtronik function at https://github.com/coolchip/luxtronik2/blob/master/luxtronik.js#L19. As far as I understand this, the problem is that default parameters are not valid ECMAScript prior to version ES6. Coffeescript currently only supports ES5, however. To get around this you can do one of the following:

convince the author to make his code coffeescript-friendly (I have filed an issue for that)

use a tool like babel to transpile the package code to ES5

Of course, there may be other solutions I haven’t thought about. Personally, I’d avoid forrking the project to as this will creat an additional maintainance burden for you.

Actually, the luxtronic package has some more issues which I have tried to fix as far as I could test this (I have no heat pump to test with). A pull request is pending for that. Meanwhile you can trial my changes using “mwittig/luxtronik2” as part of package dependencies.

That’s great! Note, however, my pull request will fix some issues with error handling. You may see an unexpected exception causing pimatic to exit when the connection to the heat pump fails for some reason. @coolchip, the author of luxtronik2 has promised to review my PR tommorrow. So there is likely a new version 0.0.3 to be released soon.

"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law