This is a known bug: https://kb.sitecore.net/articles/828414
Install a hotfix corresponding to your Sitecore Experience Platform version:
For Sitecore XP 9.0 rev. 171002 (Initial Release): https://dl.sitecore.net/hotfix/SC Hotfix 204620-1 Sitecore CES 2.1.0.zip
For Sitecore XP 9.0 rev. 171219 (Update-1): https://dl.sitecore.net/hotfix/SC Hotfix ...
Generally, checking for bots through the User Agent is not very accurate as it can be easily forged.
Use Robot Detection
Using the Robot Detection feature from Sitecore Analytics, you will have more accurate results as it doesn't only analyze a single request but considers the visitor's behaviour during the current session.
By default, on the first page ...
Setting up a proxy from my web.config solved the issue. Traffic sent through the proxy got access to the database service and the device cache was formed. Was able to see devices in Sitecore analytics afterwards.