I’m trying to create items with channel profiles.
My transformation works and have tested it when creating a new item through the UI. However, when I create the item using a text file, the transformation doesn’t work.
I have compared the two items, one created in UI and one created in text file, and cannot see a reason why it won’t work in the text file.
When I save the items file, I get this error in the log
Neither 'toItemScript' nor 'toHandlerScript' defined in link 'H1_SolarEdge_TotalImportPower -> modbus:meter-wye-phase:solaredge1:meter:acGeneral#ac-total-real-power'. Profile will discard all states and commands.
I can’t find any difference that would stop the transformation working…
Any ideas?
@florian-h05 - I noticed that you are changing code around that line logging the error:
Neither 'toItemScript' nor 'toHandlerScript' defined in link 'H1_SolarEdge_TotalImportPower -> modbus:meter-wye-phase:solaredge1:meter:acGeneral#ac-total-real-power'. Profile will discard all states and commands.
in:
Perhaps you have an idea what could be the issue here?
I am using .items files as well and I do not have that problem.
IMO the problem itself is really weird - the log message should only be logged if both config fields are blank, and one of them obviously isn’t.
It seems that somehow the ConfigParser uses else when trying to parse the config.
I think so. I’ve been trying to figure it out before replying.
Maybe it was just a case of the items not clearing and reloading properly. I have restarted since then and the following seems to be working for me now
I think there is a similar issue with things text files. I have to restart to apply updates to a handful of modbus things I have in text files.
When I omit toHandlerScript=“” it shows ‘NA’ in the UI instead of just a blank space. Haven’t tested this specifically if it actually works when omitted, but it looks different to a UI configured item
I’ve also just submitted a PR to fix update behaviour with .things file. However, the problem was that everything in the file got updated instead of just the one being changed. So if you changed something, it would’ve been applied without restarting openhab.
If you could provide steps to reproduce your .things file issue, please let me know, maybe open a separate topic?