I have now dealt with Profiles for the first time and have read the documentation: Items | openHAB.
It was unclear to me whether, for example, the hysteresis value is also set back to OFF in a certain situation (which I presumed), but this is not explicitly mentioned in the doc, so I looked at the code and yes, this happens in mapValue.
This Profile can be used to trigger alarms when number values exceed a given lower bound - sends ON to the Switch Item.
I’m always for having the docs be explicit and complete. This does seem like an important part that’s missing.
What does upper and high default to? Given this code snippet I don’t see how the upper check can be skipped. These have to have some value so it’s not a half hysteresis, it just defaults the high bound. documenting what that default is would be useful though.
Given that, the mapValue will return low or previousType which is set to UNDEF. But that can only work in cases where a stateUpdate is sent to the Item. If the Profile is configured to sendCommand, the UNDEF is ignored because it’s not a Command.
My reading of the docs indicated that it always sends the command so indeed, without the upper defined, it will only send low as a command or nothing at all.
At least that’s how I read the code, but I wonder under what circumstances, if any public void onStateUpdateFromHandler(State state) would ever be called. If there is one, than the behavior is the Item will be updated to low or UNDEF. Maybe whether it’s a command or update depends on whether the Channel is sending a command or posting an update.