I have made a sidemap item to control my wake-up alarm The times are converted to the minute in the day
Selection item=WekkerTijd mappings=[420="07:00", 435="07:15", 450="07:30", 405="06:45", 390="06:30"]
The WekkerTijd Item is as follows
Number WekkerTijd "Wekker is ingesteld voor [JS(numtotime.js):%s]" <alarm_clock> {channel="mqtt:topic:MQTTgeneric:wekkerTijd"}
The numtotime mapping is to bring back the original time (435 = 07:15)
(function(i) {
if (input >= 0 && input <= 1439) {
var hr = Math.floor(input / 60);
var min = input - hr * 60;
return (hr < 10 ? "0" : "") + hr + ":" + (min < 10 ? "0" : "") + min;
} else {
return "12:00";
}
})(input);
When I change the selection in the UI The Item receives the command and is changed back to UNDEF
2019-11-29 09:28:04.543 [ome.event.ItemCommandEvent] - Item 'WekkerTijd' received command 435
2019-11-29 09:28:04.549 [nt.ItemStatePredictedEvent] - WekkerTijd predicted to become 435
2019-11-29 09:28:04.563 [vent.ItemStateChangedEvent] - WekkerTijd changed from UNDEF to 435
2019-11-29 09:28:04.574 [vent.ItemStateChangedEvent] - WekkerTijd changed from 435 to UNDEF
How can I prevent this behaviour.
Many thanks for any help.