Thanks. Unfortunately I haven’t figured out a solution to this trivial problem. I found in one post using .toHours method but it doesn’t work.
Latest version of my DSL script looks like this:
Var Hour = Etuvalot_Off.toHours.toString
Var Min = Etuvalot_Off.toMinutesPart.toString
logInfo("Etuvalot_Off", Etuvalot_Off.state.toString)
logInfo("Etuvalot_Off hour", Hour.state.toString)
logInfo("Etuvalot_Off min", Min.state.toString)
OHJ_Reg4.sendCommand(256)
OHJ_Reg2011.sendCommand(Hour)
OHJ_Reg4011.sendCommand(Min)
In the log I have errors:
2022-01-15 11:45:02.338 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'f35a36154a' failed: ___ Var ___ Hour = Etuvalot_Off. ___ toHours.toString
Var Min = Etuvalot_Off.toMinutesPart.toSt ___ ring ___
logInfo("Etuvalot_Off", Etuvalot_Off.state.toString)
logInfo("Etuvalot_Off hour", Hour.state.toString)
logInfo("Etuvalot_Off min", Min.state.toString)
OHJ_Reg4.sendCommand(256)
OHJ_Reg2011.sendCommand(Hour)
OHJ_Reg4011.sendCommand(Min)
1. The method or field Var is undefined; line 1, column 0, length 3
2. The method Hour(Object) is undefined; line 1, column 4, length 4
3. The method or field toHours is undefined for the type DateTimeItem; line 1, column 24, length 7
4. The method or field Var is undefined; line 2, column 41, length 3
5. The method Min(Object) is undefined; line 2, column 45, length 3
6. The method or field toMinutesPart is undefined for the type DateTimeItem; line 2, column 64, length 13
7. The method or field Hour is undefined; line 4, column 169, length 4
8. The method or field Min is undefined; line 5, column 220, length 3
9. The method or field Hour is undefined; line 8, column 296, length 4
10. The method or field Min is undefined; line 9, column 326, length 3
So obviously the method I have used is wrong.
Item Etuvalot_Off is a string:
1970-01-01T19:30:00.000+0200
So Hour should be 19 and Min 30.
I’m still runnning Homeseer and in VB scripting this issue is really trivial.