Design Pattern: Simple State Machine (e.g. Time Of Day)

Thanks for the update. That is interesting and completely inexplicable. Let me know if it at least transitions this evening and tomorrow morning so I can put that part of the weirdness to bed and focus on these new problems.

For whatever reason (maybe I did paste incorrectly, maybe the script was different), it seems to be working correctly now. It is a bit overeager on the transitions, though. It did transition only once this morning, but several times last night.

2020-12-15 17:00:00.002 [INFO ] [openhab.model.script.Rules.TimeOfDay] - Transitioning Time of Day from NOON to EVENING
2020-12-15 17:00:00.002 [INFO ] [openhab.model.script.Rules.TimeOfDay] - Transitioning Time of Day from NOON to EVENING
2020-12-15 17:00:00.029 [INFO ] [openhab.model.script.Rules.TimeOfDay] - Transitioning Time of Day from EVENING to EVENING
2020-12-15 21:00:00.001 [INFO ] [openhab.model.script.Rules.TimeOfDay] - Transitioning Time of Day from EVENING to NIGHT
2020-12-15 21:00:00.003 [INFO ] [openhab.model.script.Rules.TimeOfDay] - Transitioning Time of Day from EVENING to NIGHT
2020-12-15 21:00:00.004 [INFO ] [openhab.model.script.Rules.TimeOfDay] - Transitioning Time of Day from EVENING to NIGHT
2020-12-15 22:00:00.001 [INFO ] [openhab.model.script.Rules.TimeOfDay] - Transitioning Time of Day from NIGHT to BED
2020-12-15 22:00:00.003 [INFO ] [openhab.model.script.Rules.TimeOfDay] - Transitioning Time of Day from NIGHT to BED
2020-12-15 22:00:00.004 [INFO ] [openhab.model.script.Rules.TimeOfDay] - Transitioning Time of Day from NIGHT to BED
2020-12-16 00:00:31.104 [INFO ] [openhab.model.script.Rules.TimeOfDay] - Today is a default day.
2020-12-16 00:00:31.193 [INFO ] [openhab.model.script.Rules.TimeOfDay] - Moved Default_Morning to today.
2020-12-16 00:00:31.201 [INFO ] [openhab.model.script.Rules.TimeOfDay] - Moved Default_Night to today.
2020-12-16 00:00:31.203 [INFO ] [openhab.model.script.Rules.TimeOfDay] - Moved Default_Bed to today.
2020-12-16 00:01:01.210 [INFO ] [openhab.model.script.Rules.TimeOfDay] - Cancelling any existing timers
2020-12-16 00:01:01.214 [INFO ] [openhab.model.script.Rules.TimeOfDay] - Existing timers have been cancelled
2020-12-16 00:01:01.215 [INFO ] [openhab.model.script.Rules.TimeOfDay] - FUTURE: MORNING scheduleing timer for 2020-12-16T05:15-06:00
2020-12-16 00:01:01.221 [INFO ] [openhab.model.script.Rules.TimeOfDay] - FUTURE: DAY scheduleing timer for 2020-12-16T06:57-06:00
2020-12-16 00:01:01.222 [INFO ] [openhab.model.script.Rules.TimeOfDay] - FUTURE: EVENING scheduleing timer for 2020-12-16T17:00-06:00
2020-12-16 00:01:01.223 [INFO ] [openhab.model.script.Rules.TimeOfDay] - FUTURE: NIGHT scheduleing timer for 2020-12-16T21:00-06:00
2020-12-16 00:01:01.224 [INFO ] [openhab.model.script.Rules.TimeOfDay] - FUTURE: BED scheduleing timer for 2020-12-16T22:00-06:00
2020-12-16 00:01:01.225 [INFO ] [openhab.model.script.Rules.TimeOfDay] - FUTURE: NOON scheduleing timer for 2020-12-16T11:59-06:00
2020-12-16 00:01:01.226 [INFO ] [openhab.model.script.Rules.TimeOfDay] - Created 5 time of day timers
2020-12-16 00:01:01.226 [INFO ] [openhab.model.script.Rules.TimeOfDay] - The current time of day is BED
2020-12-16 05:15:00.003 [INFO ] [openhab.model.script.Rules.TimeOfDay] - Transitioning Time of Day from BED to MORNING
2020-12-16 06:57:00.002 [INFO ] [openhab.model.script.Rules.TimeOfDay] - Transitioning Time of Day from MORNING to DAY

I suspect that in copying and editing the rule it caused the already scheduled timers to become orphaned. So they were still sticking around and triggered at the appropriate time. With text based rules you can define a function that gets called when the script is unloaded where that stuff can be cleaned up, but I’ve not discovered an equivalent for rules stored in the JSONDB.

If it happens again, let me know. Also let me know if there is anything else not working. For now I’ll update the repo with this version of the rule and cross my fingers that all the bugs are fixed. Thanks a bunch for the help debugging!

No need to thank me, I’m thankful for your help to get it working.
I’ll watch the logs for a while and see what it is doing.
But it is still scheduling one less timer than there are FUTURE log entries, not sure if that is relevant.

If the timer is set for a date/time instead of a time only, those orphaned timers should only occur once, I suppose.

Let’s see if there is a consistent pattern for which Timer (if any) it’s not creating. I’ve some suspicions that my way of managing that run at midnight when the previous time of day was before midnight and the next time of day is after the rule runs might not cover all the cases.

I tried your tod script (js version on oh 3.0.0 M5), but seem to have a problem with the items metadata:

[ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID '94ae798d14' failed: Item Default_Bed. Invalid metadata for Item! Expected metadata in the form of etod="STATE"[type="daytype", set="dayset", file="uri"] where set is required if type is dayset and file is required if type is custom. Item's state is undefined in <eval> at line number 244 at column number 6

With metadata:

value: BED
config:
  type: default

Item was added by using Add Items from Textual Definition

I need to fix that log statement. It’s not the metadata, it’s the Item state (look at the last part of the log statement). It’s NULL or UNDEF. You need to set a valid DateTime to the Item prior to running the Rule. Otherwise it doesn’t know what to do with it.

Still working nicely, all transitions occurred correctly over the last 24 hours.
At 00:01, it does detect all five transition times as FUTURE, but says it created four timers. Still, all transitions occur when they should


Awesome! It’s really weird that it’s counting the timers wrong. That’s clearly something going wrong that I need to look into. But if it’s functional that means it’s lower priority. Thanks again for help debugging the code. It’s much better now and I hope lots of users will benefit from the fixes!

1 Like

Well, credit where credit’s due, you did the debugging, I just did beta-testing :wink:

Hello together,

after i upgrade to OH3.0 my Rules dont fire. I get the following Error.

==> /var/log/openhab/openhab.log <==

2020-12-23 21:37:56.776 [INFO ] [.openhab.core.model.script.Tageszeit] - Berechnen der Tageszeit


2020-12-23 21:37:56.780 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID ‘00_astro-1’ failed: An error occurred during the script execution: null in 00_astro

Rule

import org.joda.DateTime
val logName = “Tageszeit”
rule “Kalkulieren der Tageszeit”
when
System started or
Item SunriseTime received update ON or
Item EveningTime received update ON or
Item SunsetTime received update ON or
Time cron “0 0 4,12,22 * * ? *” or
Item CurrDateTime received update
then

logInfo(logName, “Berechnen der Tageszeit
”)
val morning = new DateTime(now.withTimeAtStartOfDay.plusHours(4).millis)
logInfo(logName, “Morgen”, morning)
val sunrise = new DateTime((SunriseTime.state as DateTimeType).getZonedDateTime.toInstant.toEpochMilli)
logInfo(logName, “Vormittag”, sunrise)
val afternoon = new DateTime(now.withTimeAtStartOfDay.plusHours(12).millis)
logInfo(logName, “Nachmittag”, afternoon)
val twilight = new DateTime((EveningTime.state as DateTimeType).getZonedDateTime.toInstant.toEpochMilli)
logInfo(logName, “DĂ€mmerung”, twilight)
val evening = new DateTime((SunsetTime.state as DateTimeType).getZonedDateTime.toInstant.toEpochMilli)
logInfo(logName, “Abend”, evening)
val night = new DateTime(now.withTimeAtStartOfDay.plusHours(22).millis)
logInfo(logName, “Nacht”, night)

var currPeriod = "Nacht"
if     (now.isAfter(morning)  	&& now.isBefore(sunrise))  	currPeriod = "Morgen"
  else if(now.isAfter(sunrise)  	&& now.isBefore(afternoon)) currPeriod = "Vormittag"
  else if(now.isAfter(afternoon)  && now.isBefore(twilight)) 	currPeriod = "Nachmittag"
  else if(now.isAfter(twilight) 	&& now.isBefore(evening))  	currPeriod = "DĂ€mmerung"
  else if(now.isAfter(evening)  	&& now.isBefore(night))    	currPeriod = "Abend"
  else if(now.isAfter(night))                              	currPeriod = "Nacht"

if(DayPhase.state.toString != currPeriod) {
  logInfo(logName, "Aktuelle Tagesphase ist: " + currPeriod)
      DayPhase.sendCommand(currPeriod)

}
end

Per the release notes with OH 3, all JodaDateTimes have been replaced with ZonedDateTime. See Design Pattern: Time Of Day - #508 by Tron above, the updates to the Rules docs page and the OH 3 release notes which provide the translations.

Daniel,

Rich is entirely correct, due to those changes the old TimeOfDay script does not work with OH3.
I can give you a modified one I wrote for the ZonedDateTime.
But Rich and I have been debugging his Ephemeris-based JavaScript rule, and that now works fine. You could try that first.

1 Like

Ive just updated to oh3 and ive tried to update my time of day rule as per the first post with no luck. please find the attached and also my logs. any help would be appreciated.


rule "Calculate time of day state" 
when
  System started or // run at system start in case the time changed when OH was offline
  Channel 'astro:sun:home:rise#event'    triggered START or
  Channel 'astro:sun:home:set#event'     triggered START or
  Channel 'astro:sun:minus90:set#event'  triggered START or
  Time cron "0 1 0 * * ? *" or // one minute after midnight so give Astro time to calculate the new day's times
  Time cron "0 0 6 * * ? *" or
  Item test7 changed from OFF to ON or
  Time cron "0 0 22 * * ? *" or
  Time cron "0 0 21 * * ? *"
then

  logInfo("Rick", "Calculating time of day...")

  // Calculate the times for the static tods and populate the associated Items
  // Update when changing static times
  // Jump to tomorrow and subtract to avoid problems at the change over to/from DST
  val morning_start = now.withTimeAtStartOfDay.plusDays(1).minusHours(18)
  vMorning_Time.postUpdate(morning_start.toString) 

  val night_start = now.withTimeAtStartOfDay.plusDays(1).minusHours(3)
  vNight_Time.postUpdate(night_start.toString)

  val bed_start = now.withTimeAtStartOfDay.plusDays(1).minusHours(2)
  vBed_Time.postUpdate(bed_start.toString)

  // Convert the Astro Items to Joda DateTime
  val day_start = new DateTime(vSunrise_Time.state.toString)
  val evening_start = new DateTime(vSunset_Time.state.toString)
  val afternoon_start = new DateTime(vEvening_Time.state.toString) 	

  // Calculate the current time of day
  var curr = "UNKNOWN"
  switch now {
  	case now.isAfter(morning_start)   && now.isBefore(day_start):       curr = "MORNING"
  	case now.isAfter(day_start)       && now.isBefore(afternoon_start): curr = "DAY"
  	case now.isAfter(afternoon_start) && now.isBefore(evening_start):   curr = "AFTERNOON"
  	case now.isAfter(evening_start)   && now.isBefore(night_start):     curr = "EVENING"
  	case now.isAfter(night_start)     && now.isBefore(bed_start):       curr = "NIGHT"
  	case now.isAfter(bed_start):                                      	curr = "BED"
  	case now.isBefore(morning_start):   					  			curr = "BED"
  }

  // Publish the current state
  logInfo("Rick", "Calculated time of day is " + curr)
  vTimeOfDay.sendCommand(curr)
end




rule "Time of day changed to MORNING"

when
  	Item vTimeOfDay changed to "MORNING" // does not work prior to OH 2.3 Release
then
	Dark_Outside.sendCommand(ON)
	Auto_Lock_Front_Door_On_Close.sendCommand(ON)
	Christmas_Tree.sendCommand(ON)
	Bedtime_Has_Run.sendCommand(OFF)
	MainLightsEntertainment.sendCommand(100)
	Echo_Living_Volume.sendCommand(70)
	Echo_Entrance_Volume.sendCommand(70)
	Echo_Master_Bed_Volume.sendCommand(70)
	Heating_AC_Time_Switch.sendCommand(ON)
end




rule "Time of day changed to DAY"

when
  	Item vTimeOfDay changed to "DAY" // does not work prior to OH 2.3 Release
then
	Auto_Lock_Front_Door_On_Close.sendCommand(ON)
	Christmas_Tree.sendCommand(ON)
	Bedtime_Has_Run.sendCommand(OFF)
	Dark_Outside.sendCommand(OFF)
	Echo_Living_Volume.sendCommand(80)
	Echo_Entrance_Volume.sendCommand(80)
	Echo_Master_Bed_Volume.sendCommand(80)
	Heating_AC_Time_Switch.sendCommand(ON)
end




rule "Time of day changed to AFTERNOON"

when
  	Item vTimeOfDay changed to "AFTERNOON" // does not work prior to OH 2.3 Release
then
	Auto_Lock_Front_Door_On_Close.sendCommand(ON)
	Dark_Outside.sendCommand(OFF)
	Echo_Living_Volume.sendCommand(80)
	Echo_Entrance_Volume.sendCommand(80)
	Echo_Master_Bed_Volume.sendCommand(80)
	Heating_AC_Time_Switch.sendCommand(ON)
end




rule "Time of day changed to EVENING"

when
  	Item vTimeOfDay changed to "EVENING" // does not work prior to OH 2.3 Release
then
	Auto_Lock_Front_Door_On_Close.sendCommand(ON)
	Dark_Outside.sendCommand(ON)
	Echo_Living_Volume.sendCommand(60)
	Echo_Entrance_Volume.sendCommand(60)
	Echo_Master_Bed_Volume.sendCommand(60)
	Heating_AC_Time_Switch.sendCommand(ON)
end





rule "Time of day changed to NIGHT"

when
  	Item vTimeOfDay changed to "NIGHT" // does not work prior to OH 2.3 Release
then
	Auto_Lock_Front_Door_On_Close.sendCommand(ON)
	Dark_Outside.sendCommand(ON)
	Echo_Living_Volume.sendCommand(50)
	Echo_Entrance_Volume.sendCommand(50)
	Echo_Master_Bed_Volume.sendCommand(50)
	Heating_AC_Time_Switch.sendCommand(ON)
end





rule "Time of day changed to BED"

when
  	Item vTimeOfDay changed to "BED" // does not work prior to OH 2.3 Release
then
	Auto_Lock_Front_Door_On_Close.sendCommand(ON)
	Christmas_Tree.sendCommand(OFF)
	Dark_Outside.sendCommand(ON)
	Echo_Living_Volume.sendCommand(30)
	Echo_Entrance_Volume.sendCommand(30)
	Echo_Master_Bed_Volume.sendCommand(30)
	Heating_AC_Time_Switch.sendCommand(OFF)
	Lounge_Heating_Cooling_Mode.sendCommand(0)
end






rule "Time of day changed to BED"

when
  	Item vTimeOfDay changed to "BED"
then
	Auto_Lock_Front_Door_On_Close.sendCommand(ON)

if	(Bedtime_Has_Run.state == OFF && Someones_Home.state == ON)
		{
		Goodnight.sendCommand("ON")
		}
end




rule "Turn On Riley Bed"

when
  	Time cron "0 0 19 * * ? *"
then
	Rileys_Bed_Time.sendCommand(ON)
end





rule "Turn Off Riley Bed"

when
  	Time cron "0 0 7 * * ? *"
then
	Rileys_Bed_Time.sendCommand(OFF)
end
2020-12-24 17:24:31.291 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'Time of Day copy.rules'
2020-12-24 17:24:33.028 [ERROR] [t.ide.server.concurrent.WriteRequest] - Error during request: 
java.util.concurrent.CompletionException: java.lang.IllegalArgumentException: Illegal character in path at index 24: file:///etc/openhab/Time of Day.rules
	at java.util.concurrent.CompletableFuture.encodeThrowable(Unknown Source) ~[?:?]
	at java.util.concurrent.CompletableFuture.andTree(Unknown Source) ~[?:?]
	at java.util.concurrent.CompletableFuture.andTree(Unknown Source) ~[?:?]
	at java.util.concurrent.CompletableFuture.andTree(Unknown Source) ~[?:?]
	at java.util.concurrent.CompletableFuture.allOf(Unknown Source) ~[?:?]
	at org.eclipse.xtext.ide.server.concurrent.RequestManager.cancel(RequestManager.java:114) ~[?:?]
	at org.eclipse.xtext.ide.server.concurrent.RequestManager.runWrite(RequestManager.java:80) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.runBuildable(LanguageServerImpl.java:453) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.didOpen(LanguageServerImpl.java:379) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:?]
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65) ~[?:?]
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.notify(GenericEndpoint.java:152) ~[?:?]
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleNotification(RemoteEndpoint.java:220) ~[?:?]
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:187) ~[?:?]
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194) ~[?:?]
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94) ~[?:?]
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:?]
	at java.util.concurrent.FutureTask.run(Unknown Source) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
	at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: java.lang.IllegalArgumentException: Illegal character in path at index 24: file:///etc/openhab/Time of Day.rules
	at java.net.URI.create(Unknown Source) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.toURI(MappingUriExtensions.java:162) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.guessClientPath(MappingUriExtensions.java:129) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.toUri(MappingUriExtensions.java:65) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.getURI(LanguageServerImpl.java:567) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.toBuildable(LanguageServerImpl.java:401) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$didChange$9(LanguageServerImpl.java:393) ~[?:?]
	at org.eclipse.xtext.ide.server.concurrent.WriteRequest.run(WriteRequest.java:50) [bundleFile:?]
	... 5 more
Caused by: java.net.URISyntaxException: Illegal character in path at index 24: file:///etc/openhab/Time of Day.rules
	at java.net.URI$Parser.fail(Unknown Source) ~[?:?]
	at java.net.URI$Parser.checkChars(Unknown Source) ~[?:?]
	at java.net.URI$Parser.parseHierarchical(Unknown Source) ~[?:?]
	at java.net.URI$Parser.parse(Unknown Source) ~[?:?]
	at java.net.URI.<init>(Unknown Source) ~[?:?]
	at java.net.URI.create(Unknown Source) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.toURI(MappingUriExtensions.java:162) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.guessClientPath(MappingUriExtensions.java:129) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.toUri(MappingUriExtensions.java:65) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.getURI(LanguageServerImpl.java:567) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.toBuildable(LanguageServerImpl.java:401) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$didChange$9(LanguageServerImpl.java:393) ~[?:?]
	at org.eclipse.xtext.ide.server.concurrent.WriteRequest.run(WriteRequest.java:50) ~[?:?]
	... 5 more
2020-12-24 17:24:33.037 [ERROR] [t.ide.server.concurrent.WriteRequest] - Error during request: 
java.lang.IllegalArgumentException: Illegal character in path at index 24: file:///etc/openhab/Time of Day copy.rules
	at java.net.URI.create(Unknown Source) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.toURI(MappingUriExtensions.java:162) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.guessClientPath(MappingUriExtensions.java:129) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.toUri(MappingUriExtensions.java:65) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.getURI(LanguageServerImpl.java:575) ~[bundleFile:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.toBuildable(LanguageServerImpl.java:388) ~[bundleFile:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$didOpen$8(LanguageServerImpl.java:379) ~[bundleFile:?]
	at org.eclipse.xtext.ide.server.concurrent.WriteRequest.run(WriteRequest.java:50) [bundleFile:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:?]
	at java.util.concurrent.FutureTask.run(Unknown Source) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
	at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: java.net.URISyntaxException: Illegal character in path at index 24: file:///etc/openhab/Time of Day copy.rules
	at java.net.URI$Parser.fail(Unknown Source) ~[?:?]
	at java.net.URI$Parser.checkChars(Unknown Source) ~[?:?]
	at java.net.URI$Parser.parseHierarchical(Unknown Source) ~[?:?]
	at java.net.URI$Parser.parse(Unknown Source) ~[?:?]
	at java.net.URI.<init>(Unknown Source) ~[?:?]
	... 13 more
2020-12-24 17:24:33.043 [ERROR] [xt.ide.server.concurrent.ReadRequest] - Error during request: 
java.lang.IllegalArgumentException: Illegal character in path at index 24: file:///etc/openhab/Time of Day copy.rules
	at java.net.URI.create(Unknown Source) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.toURI(MappingUriExtensions.java:162) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.guessClientPath(MappingUriExtensions.java:129) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.toUri(MappingUriExtensions.java:65) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.getURI(LanguageServerImpl.java:567) ~[bundleFile:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.documentSymbol(LanguageServerImpl.java:637) ~[bundleFile:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$documentSymbol$27(LanguageServerImpl.java:628) ~[bundleFile:?]
	at org.eclipse.xtext.ide.server.concurrent.ReadRequest.lambda$doRun$0(ReadRequest.java:66) [bundleFile:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:?]
	at java.util.concurrent.FutureTask.run(Unknown Source) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
	at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: java.net.URISyntaxException: Illegal character in path at index 24: file:///etc/openhab/Time of Day copy.rules
	at java.net.URI$Parser.fail(Unknown Source) ~[?:?]
	at java.net.URI$Parser.checkChars(Unknown Source) ~[?:?]
	at java.net.URI$Parser.parseHierarchical(Unknown Source) ~[?:?]
	at java.net.URI$Parser.parse(Unknown Source) ~[?:?]
	at java.net.URI.<init>(Unknown Source) ~[?:?]
	... 13 more
2020-12-24 17:24:41.030 [ERROR] [t.ide.server.concurrent.WriteRequest] - Error during request: 
java.util.concurrent.CompletionException: java.lang.IllegalArgumentException: Illegal character in path at index 24: file:///etc/openhab/Time of Day copy.rules
	at java.util.concurrent.CompletableFuture.encodeThrowable(Unknown Source) ~[?:?]
	at java.util.concurrent.CompletableFuture.andTree(Unknown Source) ~[?:?]
	at java.util.concurrent.CompletableFuture.allOf(Unknown Source) ~[?:?]
	at org.eclipse.xtext.ide.server.concurrent.RequestManager.cancel(RequestManager.java:114) ~[?:?]
	at org.eclipse.xtext.ide.server.concurrent.RequestManager.runWrite(RequestManager.java:80) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.runBuildable(LanguageServerImpl.java:453) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.didChange(LanguageServerImpl.java:393) ~[?:?]
	at jdk.internal.reflect.GeneratedMethodAccessor165.invoke(Unknown Source) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:?]
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65) ~[?:?]
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.notify(GenericEndpoint.java:152) ~[?:?]
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleNotification(RemoteEndpoint.java:220) ~[?:?]
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:187) ~[?:?]
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194) ~[?:?]
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94) ~[?:?]
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:?]
	at java.util.concurrent.FutureTask.run(Unknown Source) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
	at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: java.lang.IllegalArgumentException: Illegal character in path at index 24: file:///etc/openhab/Time of Day copy.rules
	at java.net.URI.create(Unknown Source) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.toURI(MappingUriExtensions.java:162) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.guessClientPath(MappingUriExtensions.java:129) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.toUri(MappingUriExtensions.java:65) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.getURI(LanguageServerImpl.java:575) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.toBuildable(LanguageServerImpl.java:388) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$didOpen$8(LanguageServerImpl.java:379) ~[?:?]
	at org.eclipse.xtext.ide.server.concurrent.WriteRequest.run(WriteRequest.java:50) [bundleFile:?]
	... 5 more
Caused by: java.net.URISyntaxException: Illegal character in path at index 24: file:///etc/openhab/Time of Day copy.rules
	at java.net.URI$Parser.fail(Unknown Source) ~[?:?]
	at java.net.URI$Parser.checkChars(Unknown Source) ~[?:?]
	at java.net.URI$Parser.parseHierarchical(Unknown Source) ~[?:?]
	at java.net.URI$Parser.parse(Unknown Source) ~[?:?]
	at java.net.URI.<init>(Unknown Source) ~[?:?]
	at java.net.URI.create(Unknown Source) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.toURI(MappingUriExtensions.java:162) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.guessClientPath(MappingUriExtensions.java:129) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.toUri(MappingUriExtensions.java:65) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.getURI(LanguageServerImpl.java:575) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.toBuildable(LanguageServerImpl.java:388) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$didOpen$8(LanguageServerImpl.java:379) ~[?:?]
	at org.eclipse.xtext.ide.server.concurrent.WriteRequest.run(WriteRequest.java:50) ~[?:?]
	... 5 more
2020-12-24 17:24:41.046 [ERROR] [t.ide.server.concurrent.WriteRequest] - Error during request: 
java.lang.IllegalArgumentException: Illegal character in path at index 24: file:///etc/openhab/Time of Day copy.rules
	at java.net.URI.create(Unknown Source) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.toURI(MappingUriExtensions.java:162) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.guessClientPath(MappingUriExtensions.java:129) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.toUri(MappingUriExtensions.java:65) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.getURI(LanguageServerImpl.java:567) ~[bundleFile:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.toBuildable(LanguageServerImpl.java:401) ~[bundleFile:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$didChange$9(LanguageServerImpl.java:393) ~[bundleFile:?]
	at org.eclipse.xtext.ide.server.concurrent.WriteRequest.run(WriteRequest.java:50) [bundleFile:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:?]
	at java.util.concurrent.FutureTask.run(Unknown Source) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
	at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: java.net.URISyntaxException: Illegal character in path at index 24: file:///etc/openhab/Time of Day copy.rules
	at java.net.URI$Parser.fail(Unknown Source) ~[?:?]
	at java.net.URI$Parser.checkChars(Unknown Source) ~[?:?]
	at java.net.URI$Parser.parseHierarchical(Unknown Source) ~[?:?]
	at java.net.URI$Parser.parse(Unknown Source) ~[?:?]
	at java.net.URI.<init>(Unknown Source) ~[?:?]
	... 13 more
2020-12-24 17:24:41.405 [ERROR] [xt.ide.server.concurrent.ReadRequest] - Error during request: 
java.lang.IllegalArgumentException: Illegal character in path at index 24: file:///etc/openhab/Time of Day copy.rules
	at java.net.URI.create(Unknown Source) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.toURI(MappingUriExtensions.java:162) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.guessClientPath(MappingUriExtensions.java:129) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.toUri(MappingUriExtensions.java:65) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.getURI(LanguageServerImpl.java:567) ~[bundleFile:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.documentSymbol(LanguageServerImpl.java:637) ~[bundleFile:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$documentSymbol$27(LanguageServerImpl.java:628) ~[bundleFile:?]
	at org.eclipse.xtext.ide.server.concurrent.ReadRequest.lambda$doRun$0(ReadRequest.java:66) [bundleFile:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:?]
	at java.util.concurrent.FutureTask.run(Unknown Source) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
	at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: java.net.URISyntaxException: Illegal character in path at index 24: file:///etc/openhab/Time of Day copy.rules
	at java.net.URI$Parser.fail(Unknown Source) ~[?:?]
	at java.net.URI$Parser.checkChars(Unknown Source) ~[?:?]
	at java.net.URI$Parser.parseHierarchical(Unknown Source) ~[?:?]
	at java.net.URI$Parser.parse(Unknown Source) ~[?:?]
	at java.net.URI.<init>(Unknown Source) ~[?:?]
	... 13 more
2020-12-24 17:24:45.280 [ERROR] [xt.ide.server.concurrent.ReadRequest] - Error during request: 
java.lang.IllegalArgumentException: Illegal character in path at index 24: file:///etc/openhab/Time of Day copy.rules
	at java.net.URI.create(Unknown Source) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.toURI(MappingUriExtensions.java:162) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.guessClientPath(MappingUriExtensions.java:129) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.toUri(MappingUriExtensions.java:65) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.getURI(LanguageServerImpl.java:567) ~[bundleFile:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.documentSymbol(LanguageServerImpl.java:637) ~[bundleFile:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$documentSymbol$27(LanguageServerImpl.java:628) ~[bundleFile:?]
	at org.eclipse.xtext.ide.server.concurrent.ReadRequest.lambda$doRun$0(ReadRequest.java:66) [bundleFile:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:?]
	at java.util.concurrent.FutureTask.run(Unknown Source) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
	at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: java.net.URISyntaxException: Illegal character in path at index 24: file:///etc/openhab/Time of Day copy.rules
	at java.net.URI$Parser.fail(Unknown Source) ~[?:?]
	at java.net.URI$Parser.checkChars(Unknown Source) ~[?:?]
	at java.net.URI$Parser.parseHierarchical(Unknown Source) ~[?:?]
	at java.net.URI$Parser.parse(Unknown Source) ~[?:?]
	at java.net.URI.<init>(Unknown Source) ~[?:?]
	... 13 more
2020-12-24 17:24:46.329 [ERROR] [xt.ide.server.concurrent.ReadRequest] - Error during request: 
java.lang.IllegalArgumentException: Illegal character in path at index 24: file:///etc/openhab/Time of Day.rules
	at java.net.URI.create(Unknown Source) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.toURI(MappingUriExtensions.java:162) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.guessClientPath(MappingUriExtensions.java:129) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.toUri(MappingUriExtensions.java:65) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.getURI(LanguageServerImpl.java:567) ~[bundleFile:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.documentSymbol(LanguageServerImpl.java:637) ~[bundleFile:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$documentSymbol$27(LanguageServerImpl.java:628) ~[bundleFile:?]
	at org.eclipse.xtext.ide.server.concurrent.ReadRequest.lambda$doRun$0(ReadRequest.java:66) [bundleFile:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:?]
	at java.util.concurrent.FutureTask.run(Unknown Source) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
	at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: java.net.URISyntaxException: Illegal character in path at index 24: file:///etc/openhab/Time of Day.rules
	at java.net.URI$Parser.fail(Unknown Source) ~[?:?]
	at java.net.URI$Parser.checkChars(Unknown Source) ~[?:?]
	at java.net.URI$Parser.parseHierarchical(Unknown Source) ~[?:?]
	at java.net.URI$Parser.parse(Unknown Source) ~[?:?]
	at java.net.URI.<init>(Unknown Source) ~[?:?]
	... 13 more
2020-12-24 17:24:52.786 [ERROR] [xt.ide.server.concurrent.ReadRequest] - Error during request: 
java.lang.IllegalArgumentException: Illegal character in path at index 24: file:///etc/openhab/Time of Day.rules
	at java.net.URI.create(Unknown Source) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.toURI(MappingUriExtensions.java:162) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.guessClientPath(MappingUriExtensions.java:129) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.toUri(MappingUriExtensions.java:65) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.getURI(LanguageServerImpl.java:567) ~[bundleFile:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.documentSymbol(LanguageServerImpl.java:637) ~[bundleFile:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$documentSymbol$27(LanguageServerImpl.java:628) ~[bundleFile:?]
	at org.eclipse.xtext.ide.server.concurrent.ReadRequest.lambda$doRun$0(ReadRequest.java:66) [bundleFile:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:?]
	at java.util.concurrent.FutureTask.run(Unknown Source) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
	at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: java.net.URISyntaxException: Illegal character in path at index 24: file:///etc/openhab/Time of Day.rules
	at java.net.URI$Parser.fail(Unknown Source) ~[?:?]
	at java.net.URI$Parser.checkChars(Unknown Source) ~[?:?]
	at java.net.URI$Parser.parseHierarchical(Unknown Source) ~[?:?]
	at java.net.URI$Parser.parse(Unknown Source) ~[?:?]
	at java.net.URI.<init>(Unknown Source) ~[?:?]
	... 13 more
2020-12-24 17:24:57.115 [ERROR] [xt.ide.server.concurrent.ReadRequest] - Error during request: 
java.lang.IllegalArgumentException: Illegal character in path at index 24: file:///etc/openhab/Time of Day.rules
	at java.net.URI.create(Unknown Source) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.toURI(MappingUriExtensions.java:162) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.guessClientPath(MappingUriExtensions.java:129) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.toUri(MappingUriExtensions.java:65) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.getURI(LanguageServerImpl.java:567) ~[bundleFile:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.getURI(LanguageServerImpl.java:559) ~[bundleFile:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.hover(LanguageServerImpl.java:708) ~[bundleFile:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$hover$30(LanguageServerImpl.java:700) ~[bundleFile:?]
	at org.eclipse.xtext.ide.server.concurrent.ReadRequest.lambda$doRun$0(ReadRequest.java:66) [bundleFile:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:?]
	at java.util.concurrent.FutureTask.run(Unknown Source) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
	at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: java.net.URISyntaxException: Illegal character in path at index 24: file:///etc/openhab/Time of Day.rules
	at java.net.URI$Parser.fail(Unknown Source) ~[?:?]
	at java.net.URI$Parser.checkChars(Unknown Source) ~[?:?]
	at java.net.URI$Parser.parseHierarchical(Unknown Source) ~[?:?]
	at java.net.URI$Parser.parse(Unknown Source) ~[?:?]
	at java.net.URI.<init>(Unknown Source) ~[?:?]
	... 14 more
2020-12-24 17:25:00.677 [ERROR] [org.influxdb.impl.BatchProcessor    ] - Batch could not be sent. Data will be lost
org.influxdb.InfluxDBException$FieldTypeConflictException: partial write: field type conflict: input field "value" on measurement "Rileys_Motion" is type integer, already exists as type float dropped=1
	at org.influxdb.InfluxDBException.buildExceptionFromErrorMessage(InfluxDBException.java:144) ~[bundleFile:?]
	at org.influxdb.InfluxDBException.buildExceptionForErrorState(InfluxDBException.java:173) ~[bundleFile:?]
	at org.influxdb.impl.InfluxDBImpl.execute(InfluxDBImpl.java:827) ~[bundleFile:?]
	at org.influxdb.impl.InfluxDBImpl.write(InfluxDBImpl.java:460) ~[bundleFile:?]
	at org.influxdb.impl.OneShotBatchWriter.write(OneShotBatchWriter.java:22) ~[bundleFile:?]
	at org.influxdb.impl.BatchProcessor.write(BatchProcessor.java:340) [bundleFile:?]
	at org.influxdb.impl.BatchProcessor$1.run(BatchProcessor.java:287) [bundleFile:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:?]
	at java.util.concurrent.FutureTask.run(Unknown Source) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
	at java.lang.Thread.run(Unknown Source) [?:?]
2020-12-24 17:25:04.026 [ERROR] [xt.ide.server.concurrent.ReadRequest] - Error during request: 
java.lang.IllegalArgumentException: Illegal character in path at index 24: file:///etc/openhab/Time of Day copy.rules
	at java.net.URI.create(Unknown Source) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.toURI(MappingUriExtensions.java:162) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.guessClientPath(MappingUriExtensions.java:129) ~[?:?]
	at org.openhab.core.model.lsp.internal.MappingUriExtensions.toUri(MappingUriExtensions.java:65) ~[?:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.getURI(LanguageServerImpl.java:567) ~[bundleFile:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.documentSymbol(LanguageServerImpl.java:637) ~[bundleFile:?]
	at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$documentSymbol$27(LanguageServerImpl.java:628) ~[bundleFile:?]
	at org.eclipse.xtext.ide.server.concurrent.ReadRequest.lambda$doRun$0(ReadRequest.java:66) [bundleFile:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:?]
	at java.util.concurrent.FutureTask.run(Unknown Source) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
	at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: java.net.URISyntaxException: Illegal character in path at index 24: file:///etc/openhab/Time of Day copy.rules
	at java.net.URI$Parser.fail(Unknown Source) ~[?:?]
	at java.net.URI$Parser.checkChars(Unknown Source) ~[?:?]
	at java.net.URI$Parser.parseHierarchical(Unknown Source) ~[?:?]
	at java.net.URI$Parser.parse(Unknown Source) ~[?:?]
	at java.net.URI.<init>(Unknown Source) ~[?:?]
	... 13 more

Again, the “old” JodaTime is no longer supported, it needs to be ZonedDateTime.

But the new JavaScript is working nicely now, why don’t you try that? You only have to:

  • copy the time_utils and timer_mgr scripts from Rich’s Github page to /etc/openhab/automation/
/
  • Set up items for the times you want with ephemeris metatags
  • manually set the times you want for those items (openhab:send from the console), only the time is needed and it’s only needed once
  • create a new rule from the openhab main ui and copy the ephem_tod script to it.

If you ever need to change a transition time, just send a new command to that time item.

Hi @ all,
like probably a lot of people got startet with the migration to OH3 during the hollidays and since relying on the TOD pattern quite a lot I just have a quick question regarding where to put the needed library folders and automation folders from the git repository.

As I understood it I have to clone the whole repo to my system, check.

Where do I put the modules and scrips I need? In the readme it says: Copy the automation folder under a given capability's folder to $OH_CONF.. Does that mean I put for example a folder called timer_mgr in the $OH_CONF Folder and copy the automation folder from the cloned git repo there? Or do I put erverything in a single folder called automation in the $OH_CONF Folder?

I guess I am being stupid but really want it to work and to learn. Thanks for your help and also @rlkoshak and the others for their tremendous work!

No, you do not need to clone the whole repository.
If you look at the start of the JS script, you’ll see that it loads its helper scripts from a specific directory:

load(OPENHAB_CONF+'/automation/lib/javascript/community/timerMgr.js');
load(OPENHAB_CONF+'/automation/lib/javascript/community/timeUtils.js');

So you’ll just need to copy those two .js files (found in Rich’s repository) to the right location.
For a standard linux, $OPENHAB_CONF resolves to /etc/openhab, so my scripts are here:

/etc/openhab/automation/lib/javascript/community

You maybe should chown the whole automation folder and its subfolders to the openhab user, but its probably not necessary.

Hi thanks for clearing up my question so fast! Now I understand :slight_smile: ! Always amazing how fast the community is! Thanks again!

You’re welcome. Tell us if you got it working.

Oh, btw., you’ll need to put your country/state/whatever in Openhab3/Settings/Ephemeris, otherwise it can’t get the holidays correctly.

EDIT

Ok, got the files in the right place and it seems that something happens since I get a value for the Default Evening item. Now the next questions is comming up 
 where do I define the start times of my default items? Is ist possible to define fixed time when a time of day is supposed to be starting?

I read in a post that you have to set times in the item itself but how? Just got the Default Day working by linking the Lokal Sun Data - Thing rise#start - Channel to the Default Day Item. Here post #542 it was mentioned to 


  • manually set the times you want for those items (openhab:send from the console), only the time is needed and it’s only needed once


 how do I do this? Is this the part where OH 3 Examples: How to boot strap the state of an Item comes into play?

Thanks again for enlightening input!

:man_facepalming: OK he who reads will get the info he seeks! The solution to the problem ist the boot strapping part!




OK, the boot strapping part probably is the right way but does not work as discribed. Unless I am missing something. Adding the metadata part works but unfortunatly when trying to set a time I need to put date and time in otherwise I get a error. When adding date and time the item state is not changed and remains NULL. Is there a need to uncomment or change something in the .yml rule?