What is targetFormat? Is this the format you want to send to the DateTime or the format you are expecting from the result of the transform?
DateTime Items already have a way to define it’s output format. All Items already have a way to control their output format. So defining the targetFormat in the profile doesn’t make sense.
If this is the format of the result of the transform, shouldn’t the transform output the format needed by the Item type in the first place? If this is what you mean than targetFormat is redundant.
I just don’t see the point of it. It seems like you are trying to reproduce functionality that already exists.
And we should expect an error in the log if you try.
That really is the root of the problem. I never really understood why that is the case, but I don’t look at the code so I assumed there is some technical limitation. But from a usability perspective, I at least expected Profiles to work like postUpdate or like using a transform in a Channel config (e.g. see MQTT, Exec, etc.). Yes, the transform only outputs a String but we can then pass that String to the Item that tries to parse it and apply it. And if it fails generates an error.
I still don’t see what the hint does or why it is needed. What is it providing the hint to? To the transform? What exactly would targetFormat="yyyy-MM-dd hh:mm"
mean to a JSONPATH transform? What would targetFormat="true"
mean to a MAP transform?
On the other hand, if you are trying to change what MyItem.state.toString outputs or how the Item appears on the sitemap, well we already have a way to format that. Two ways actually if you consider the fact that you can set the label on both the Item and in the sitemap. So this hint is not only duplicative of existing functionality, it is wholly inconsistent with how that functionality is already implemented.
If my complaint is that Profiles work against expectations based on how other parts of OH already work, I have to complain about this targetFormat too. It’s inconsistent.
I can’t forget about the map transform in this case because:
- That’s what I put into
profile="transform:XXC"
- That’s what MAP transformation was created for
- That what the MAP transformation is used for everywhere else in OH
The whole point of this exercise is to add the ability for the transform Profile to work with more Item types beyond just String Items. It isn’t to replace the existing transformations. If you want to create a separate and brand new Profile that does this sort of thing than maybe I could be on board. But from a usability perspective, it’s confusing and inconsistent and duplicative. It’s not an improvement IMHO.