i try to set the nextDuration channel of the openSprinkler binding. The corresponding item is a Number:Time item and i did not manage to set the value.
I get errors like that: “Ignoring implausible non-QuantityType command for NEXT_DURATION” using the Basic UI with selection or Setpoint
Trying a sendCommand gives me a NumberFormatException: java.lang.NumberFormatException in Jython.
2020-06-27 20:00:36.938 [WARN ] [ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value '600' of item RB_BM_SC_SprinklerValve01_NextDuration with format '%.0f %unit%': Conversion = 'u'
2020-06-27 20:25:04.785 [INFO ] [.handler.OpenSprinklerStationHandler] - Ignoring implausible non-QuantityType command for NEXT_DURATION
2020-06-27 20:25:04.794 [WARN ] [ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value '600' of item RB_BM_SC_SprinklerValve01_NextDuration with format '%s %unit%': Conversion = 'u'
2020-06-27 20:25:04.817 [WARN ] [ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value '3300' of item RB_BM_SC_SprinklerValve01_NextDuration with format '%s %unit%': Conversion = 'u'
The Second error come from the current value. unfortunately i have no idea how to set the value with a sendCommand
That right acording to the docs. There is a channel for Next_Duration. The channel definition ist not the problem, because it is copied from the thing.
The problem ist how to send a proper value to a Number:Time item.
From my point of view there was a problem, but it causes a java error. I get and info message. So iopened an issue on that.
Your hint to use a postUpdate does not work for me. The next duration switches for two or three second to the desired value, but than back to aroun 50 minutes.
It’s an odd one - the postUpdate command avoids the exception for me, but no matter what value I set (and verify through the API), when I activate the zone the duration is always 18 hours.
The same code was working fine a day ago, now it’s not. Something’s up with the binding for sure.
I’ve been using OpenSprinkler for about a month now, including weather adjustments. I am using HABPanel and Sitemaps/BasicUI without issue. I am using a Setpoint for the NextDuration items, and I am able to use sendCommand(duration) without issue from rules as shown below.
I am running OH2.5.4 with OpenSprinkler2.5.6 and everything is working great so far, exceeding my expectations. Perhaps what I’m doing will provide additional insight and a workaround for your issues.
.rules
when
Member of gSprinklerDurationMin changed
then
var durationMin = vStation01NextDurationMin.state as Number
var durationSec = (durationMin*60)/60
vStation01NextDuration.sendCommand(durationSec)
durationMin = vStation02NextDurationMin.state as Number
durationSec = (durationMin*60)/60
vStation02NextDuration.sendCommand(durationSec)
durationMin = vStation03NextDurationMin.state as Number
durationSec = (durationMin*60)/60
vStation03NextDuration.sendCommand(durationSec)
durationMin = vStation04NextDurationMin.state as Number
durationSec = (durationMin*60)/60
vStation04NextDuration.sendCommand(durationSec)
durationMin = vStation05NextDurationMin.state as Number
durationSec = (durationMin*60)/60
vStation05NextDuration.sendCommand(durationSec)
durationMin = vStation06NextDurationMin.state as Number
durationSec = (durationMin*60)/60
vStation06NextDuration.sendCommand(durationSec)
end
Thanks for your feedback. Firts view does not show any unusual differences. I don’t understand your durationSec calculation. You multiply the minutes by 60 and then you divide by 60. Technicalls you do nothing with the minutes.
Yes I know that is odd, and probably not required but it works to generate a pure number without units and so I just left it. When I get more time I’ll play with this a bit more and improve the code.
Not yet. As I said I have only been using opensprinkler for about a month, and this was my initial code to get NextDurations functioning in both HABPanel and sitemaps. As I get more time I will explore further, but right now everything is working as it should and with the heat of summer upon us, I’m reluctant to fix what isn’t broken. However I am always tinkering, so I’m sure this will be improved with time. I guess the point of my contribution here is that I don’t have any issues with the binding or using sendCommand to set NextDuration, so I’m not sure it is a binding bug.
Sending the values over as ‘300 s’ instead of 300 gets past the:
Ignoring implausible non-QuantityType command for NEXT_DURATION
…error for me. There seems to be some other side effects, like my sitemap doesn’t display the next_duration value that has been selected, but I’m sure it’s all wrapped up in a unit conversion somewhere.
@Dibbler42 You must have missed this in my post above because I didn’t explicitly call it it out as part of my sitemap, but this setpoint works for me. I have set a max time of 35 mins and increments of 1 min.