Breadcrumbs map using icloud binding

I want to create a breadcrumb map using the gps coordinates that I see in the events.log.

I found using a couple of searches that I could create a separate log file (the zwave example), but I’m still pretty new to openhab and linux. what I was hoping for was a way to do something like this in the rules file.

loginfo(“iCloud_Settings”,"Chase’s location " Chase_iPhone_Location.state as PointType)

and have that write to that separate file.
so the separate file would contain just gps coordinates, every 5 minutes when the iCloud binding ran.
this probably doesn’t make any sense but hopefully it does.

thanks in advance.
Chase

And then what? I ask because having this data in a text file isn’t really all that useful unless you have a tool that somehow knows how to ingest opneHAB log files.

Maybe a better approach would be to use Persistence and a database like MySQL or InfluxDB. Then you can use a tool like Grafana which has a map plug-in to show the locations on an actual map.

But to answer your specific answer, you follow the same approach as that zwave example you found but use “org.eclipse.smarthome.model.script.iCloud_Settings” as the logger name.

thanks Rich! I plan on taking the gps coordinates and uploading them into mapline.com to see those breadcrumbs. :slight_smile: I just wanted them all together in the file rather than trying to read through the events file and finding each entry…

I changed that one thing in the file but nothing is showing in the file… it is still 0 bytes. anything else you can recommend?

You don’t just change that “one” thing. Notice how “zwave” appears all over the place, on every line in fact, in the original example you found. You need to replace those as well.

so it should look like this?

# iPhone Logger
log4j2.logger.iCLoud.name = org.eclipse.smarthome.model.script.iCloud_Settings
log4j2.logger.iCloud.level = INFO
log4j2.logger.iCLoud.additivity = false
log4j2.logger.iCLoud.appenderRefs = iCloud
log4j2.logger.iCLoud.appenderRef.ZWave.ref = iCloud

# iPhone File Appender - iPhone.log
log4j2.appender.iCLoud.name = iCLoud
log4j2.appender.iCLoud.type = RollingRandomAccessFile
log4j2.appender.iCLoud.fileName = ${openhab.logdir}/iCLoud.log
log4j2.appender.iCLoud.filePattern = ${openhab.logdir}/iCLoud.log.%i
log4j2.appender.iCLoud.immediateFlush = true
log4j2.appender.iCLoud.append = true
log4j2.appender.iCLoud.layout.type = PatternLayout
log4j2.appender.iCLoud.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-36.36c] - %m%n
log4j2.appender.iCLoud.policies.type = Policies
log4j2.appender.iCLoud.policies.size.type = SizeBasedTriggeringPolicy
log4j2.appender.iCLoud.policies.size.size = 10MB
log4j2.appender.iCLoud.strategy.type = DefaultRolloverStrategy
log4j2.appender.iCLoud.strategy.max = 10

Be careful: “iCloud” versus “iCLoud”. Either one can be correct but you have to be consistent.

geez, I didn’t even notice that… :frowning: thanks Rick!

ok I went through and corrected all the iCLoud to iCloud, but the log is still 0 bytes, is there anything else that should be done? besides putting the above in the file /var/lib/openhab2/etc/org.ops4j.pax.logging.cfg?

Maybe a restart of OH to make sure it picked up the changes.

I did that…