Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
1-wire to mqtt Camel route
<!-- Read temperatures from the owfs directory structure. -->
<from uri="file:/Users/mark/work/test?noop=true&amp;readLock=none&amp;idempotent=false&amp;delay=10000&amp;antInclude=*/temperature&amp;recursive=true" />
<!-- Get temp and add date/time -->
<simple>${bodyAs(String)} at ${date:now:yyyy-MM-dd hh:mm:ss}</simple>
<log message="Got ${body} from ${file:parent}" />
<!-- Send to topic temperatures/[position] where position taken from the file path -->
<recipientList ignoreInvalidEndpoints="true" >
'mqtt:test?publishTopicName=temperatures.' + request.getHeaders().get('CamelFileName').split('/')[0];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.