nibi79 / worxlandroid

openHAB Binding for Worx Landroid
60 stars 20 forks source link

0 Minutes in Schedule are returned as Null #18

Closed DonStefano closed 4 years ago

DonStefano commented 4 years ago

I'm using org.openhab.binding.worxlandroid-2.5.3-SNAPSHOTv0.2.jar binding version.

My Landroid mowing StartMinute for Sunday is defined as Number:Time Landroid_Mowing_Plan_Sunday_StartMinute "[%.0f min]" (Landroid_Status_Info_Plan) { channel="worxlandroid:mower:xxxxxxxxxxxxxxxxxx:datScSunday#scheduleStartMinute"} When a value of 0 Minutes is defined in the Worx Landoid app the binding returns null instead of 0 Minutes. To retrieve the intValue of that Minutes to create a DateTime I have to do various transformations: var Integer Landroid_Mowing_Plan_StartMinute = 0 if (Landroid_Mowing_Plan_Sunday_Duration.state instanceof Number) Landroid_Mowing_Plan_Duration = (Landroid_Mowing_Plan_Sunday_Duration.state as Number).intValue var DateTime Mowing_Plan_Start = now.withTime(Landroid_Mowing_Plan_StartHour, Landroid_Mowing_Plan_StartMinute, 0, 0) I'm using this to start a timer to power up my Landroid in the morning that it is not charged during night: val DateTime Mowing_Plan_Start_Power = Mowing_Plan_Start.minusMinutes(30) RobbyTimer = createTimer(Mowing_Plan_Start_Power, [| RobbyTimer = null Garden_Landroid_Power.sendCommand(ON) ])

As null is usually used to express a non initialized value, please change 0 Minutes to 0 as a value returned from binding. Thanks, Stefan

int5749 commented 4 years ago

Hi Stefan, I've kust tried to reproduce this, but I can set 0 either for minutes or duration and both is reported as 0. Any hint, how to reproduce this or where to see this issue? Rgds, Joerg

DonStefano commented 4 years ago

Hi Joerg, I have set the start time in Worx App and it is reported as null in binding. Thank you! Stefan

int5749 commented 4 years ago

Good Morning Stefan, I'v set 17:00 - 18:00 in Worx App on iOS but all is reports as 0 in openHAB :-/

"d
":[["17:00",60,0],["18:30",180,0],["18:00",150,1],["20:15",105,1],["16:30",180,1],["16:30",180,0],["15:45",255,1]]

Even if I start at midnight, als is reported as 0

"d
":[["00:00",180,0],["18:30",180,0],["18:00",150,1],["20:15",105,1],["16:30",180,1],["16:30",180,0],["15:45",255,1]]

I might be doing something different than you?

Regards Joerg

DonStefano commented 4 years ago

Sorry,I discovered that it was my fault. I had an 's' missing at the end of the channel name in my .items file. So the real channel was never read.