SensorPush Gateway Driver
This driver connects to the SensorPush cloud-based API to retrieve sensor readings.
SensorPush sell a temperature and humidity sensor with Bluetooth connectivity for connecting directly to a mobile phone / tablet to collect sensor readings. Each sensor is able to store up to 20 days worth of readings that can be downloaded when the mobile device is back in range. You can also purchase a gateway to allow readings to be sent to the SensorPush cloud storage, making these available away from home on your mobile phone and through the SensorPush API.
NOTE - This driver relies on the use of the SensorPush Gateway and the storage of sensor readings in the cloud, it cannot connect to SensorPush sensors directly.
How Does It Work?
The SensorPush Gateway driver connects to the SensorPush cloud-hosted API to retrieve the list of sensors configured on the gateway, setting up two child devices per sensor, one as a temperature sensor virtual device and another as a humidity sensor virtual device. Regular updates of the current sensor readings can be configured, either using the in-built polling options, or using an RM Rule to trigger a device refresh for the gateway device.
Installation and Setup
The driver code is located here
Installation still requires the standard / manual method as I haven't set this up in Package Manager yet.
Installing the SensorPush Gateway Driver
- Access the driver from the GitHub link above, clicking on the RAW button to open the text only view
- Copy the driver text from the RAW view
- On your HE hub, open the Drivers Code section of the HE Web UI
- Paste in the driver code
- Click Save to install the SensorPush Gateway driver
Before starting to call the SensorPush API you MUST access the web-based SensorPush Dashboard to accept their terms and conditions. Log into the dashboard with the same credentials used to setup the Gateway in the SensorPush app. Thanks to @Dread_Pirate_Roberts for reminding me of this.
Creating a SensorPush Gateway Virtual Device
- Open the Devices section of the HE Web UI
- Click the "Add Virtual Device" button on the top right of the page
- Enter a "Device Name" and select the SensorPush Gateway driver from the "Type" drop-down list
- Click the "Save Device" button to create the new device
- The Device Edit page will display
Configuring the SensorPush Gateway Virtual Device
- In the Preferences section, enter your Username / E-Mail and Password used when setting up the Gateway with SensorPush
- Choose whether to enable or disable the Automatic Sensor Polling option, and if enabled, the number of minutes between polling of sensor readings
- Adjust the various logging options to turn on and off the different levels of logging that can occur, e.g. Information, Error, Warning and Debug Logging. It is recommended to leave Error Logging enabled.
- Click "Save Preferences"
- Click the "Get Auth Token" button (command) at the top of the device edit page, this will authenticate with the SensorPush cloud-hosted system
- Click the "Refresh" button (command) for the device
- Refresh the browser
- Review the Device Details section at the bottom of the Device Edit page. Ensure the 2 Component Devices have been created for each sensor, one for Temperature, one for Humidity. If the Automatic Sensor Polling option is turned on, ensure the Schedule Job details are displayed.
Using the SensorPush Gateway / Sensor Devices
The child devices for each sensor can be used in a number of different ways, including displaying temperature and humidity readings on dashboards, in RM rules, in various community apps, as well exporting to external data logging and visualisation setups.
2021-02-27 - Temperature Conversion
- Updated samples method, replacing code to always convert to degrees C with a call to convertTemperatureIfNeeded to convert temperature readings based on HE hub temperature scale setting, including before and after debug logging for the temperature conversion
- Minor adjustments to some logging to include correct method references
- Adjusted notes on HE Community thread to include step to accept terms and conditions on SensorPush Dashboard web page - thanks @Dread_Pirate_Roberts
2021-04-17 - Automatic Polling Fix
- Corrected issue with the automatic polling, it now honours the interval minutes setting correctly
2021-05-16 - Automatic Polling Fix
- Corrected the CRON job setup again, somehow it was still wrong...