CLI Export

When I run via the CLI smartthings devices:history I seem to get the full history of the device. When I export to json I don’t seem to be getting the full history, just over the last few hours what gives?

Many of the API endpoints page their output. The history endpoint seems to default to 20 events. When you use the CLI interactively it will make an API call to get the first 20 events, and then ask if you want to see more. If you do it will make another API call for the next 20, and so on.

If you request JSON or YAML output you just get the first 20 as there is no mechanism to ask for the next page. You can use the -L or --limit flag to get more (smartthings devices:history --help). The maximum I see seems to be 300 per page. You can also specify a time window on the events but I’d imagine the paging limit still applies.