Hello there, {{experience.user.firstName}}!
You have access to the following devices:
-
{{#each pageData.devices}}
{{component "deviceLink"}}
{{/each}}
### Get Device Counts - GET Request Example (URL) Source: https://docs.losant.com/rest-api/me Example URL to retrieve device counts by day for a specified time range. Optional 'start' and 'end' query parameters can be provided as milliseconds since epoch. ```url https://api.losant.com/me/deviceCounts?start=0&end=1465790400000 ``` -------------------------------- ### Python MQTT Client Example - Connect, Send State, Subscribe to Commands Source: https://docs.losant.com/mqtt/python A fundamental example showcasing the Losant Python MQTT Client. It demonstrates how to initialize a device client, establish a connection, define a callback for incoming commands, send device state updates, and maintain the connection in a loop. ```python import time from losantmqtt import Device # Construct device device = Device("my-device-id", "my-app-access-key", "my-app-access-secret") def on_command(device, command): print("Command received.") print(command["name"]) print(command["payload"]) # Listen for commands. device.add_event_observer("command", on_command) # Connect to Losant. device.connect(blocking=False) # Send temperature once every second. while True: device.loop() if device.is_connected(): temp = call_out_to_your_sensor_here() # Placeholder for actual sensor reading device.send_state({"temperature": temp}) time.sleep(1) ``` -------------------------------- ### Example Layout Structure in HTML Source: https://docs.losant.com/experiences/views Demonstrates a complete HTML layout structure for a Losant experience. It includes essential elements like doctype, head with meta tags and stylesheets, body with common UI components (header, footer), and the crucial `{{page}}` helper for rendering page content. It also shows how to use `{{section}}` helpers for dynamic content like page titles and per-page styles/scripts. ```html
This is an example Experience View we've built for you. It provides many of the common components that most web pages have, like a header, footer, and navigation. You can use this as a launching point for your own custom user interfaces.
All Experiences Views start with a Layout. The layout includes common items found on all pages, like a header and footer. Pages are then rendered inside the layout.
Most pages return custom HTML that you define; what you're reading now is an example of this. However, you can also create a Dashboard page, which allows you to embed an existing dashboard as an easy way to publish data to your Experience Users.
For additional information, please read the Experience View Walkthrough, which includes detailed instructions for how to build a complete example that includes both custom and dashboard pages.
This example is created using Twitter Bootstrap, which provides many components, styles, and utilities that make building web pages simple.
You have access to the following devices: