WordPress Plugin

Download

ip-anemometer-wp-plugin-0.4.0.zip (2017-11-22)

To install the plugin, copy the ip-anemometer/ directory to wp-content/plugins/ip-anemometer/ and activate the plugin in the WordPress plugins page.

Overview

The WordPress plugin allows you to easily embed IP anemometer charts in WordPress content. Simply use a shortcode to specify the server URL and the charts/components to show.

For example, these shortcodes…

[ipa url="http://foo.bar/ipa/view/ipa.php"]
[ipa period_selector default="42" id="wind"]
[ipa wind_summary wind_speed period_id="wind"]

… will show a period selector (with a default of 42 minutes) with the ID “wind”, the wind summary table and the wind speed chart for the period specified:

Period:

Note that the shortcode for wind_summary and wind_speed references the above period selector. The URL parameter must only be specified once. It is valid for the entire page.

To show another chart somewhere else in the page (referencing the same period selector):

[ipa wind_histogram period_id="wind"]

To select an end date (other than the current time):

[ipa date_selector]
Date/time:

The end date will be valid for all charts. It should probably be placed at the top of the page, before the charts and period selectors.

To use a fixed duration instead of a period selector:

[ipa cpu_temp period="2h"]

Parameters

The ipa shortcode supports a number of parameters as described in the following sections.

Global Options

Global options are valid for the entire page.

  • url="http://some.where/ipa/view/ipa.php"
    The URL of the ipa.php file on the IP anemometer server. This must be specified for the first shortcode on the page.
  • spinner=0
    By default a spinner is shown while loading data, i.e. when the page loads initially and when the load button is clicked. This disables the spinner.

These options can be added to a shortcode that produces a chart or a control, but it is easiest to have one shortcode at the top for all globals, e.g.:

[ipa url="http://some.where/ipa/view/ipa.php" spinner=0]

Controls

Controls allow the user to specify the period to query and the reference date.

  • period_selector default="1h30m" id="wind"
    Shows a period selector with a default of “1h30m”. Numbers without suffix are minutes, so this is equivalent to “90”. The default is 60 minutes. The ID can be used in a chart shortcode to specify the desired selector. It is arbitrary, but must be unique.
  • date_selector
    Shows a selector to pick a reference date and time. Defaults to the current date and time. Clicking on the “Now” button refreshes the charts.

Charts

Each chart must have one option to either reference a period selector or specify a fixed period. For example, period_id=”foo” references a period selector with id=”foo”, whereas period=”1h” sets a fixed period of one hour.

  • wind_summary
    The wind summary table.
  • wind_speed
    Wind speed over time.
  • wind_histogram
    Wind speed histogram.
  • temp_hum
    Temperature and humidity.
  • door
    Door sensor status.
  • pilots
    Pilot count.
  • adc channel="<channel no.>" label="<channel label>"
    A/D converter/voltage sensor readout of the specified channel.
  • lag
    Upload lag.
  • cpu_temp
    CPU temperature.
  • signal
    Signal strength (for a Huawei E303 compatible 3G USB device).
  • network
    Network type (for a Huawei E303 compatible 3G USB device).
  • traffic
    Data transfer volume (for a Huawei E303 compatible 3G USB device).
  • status
    The client’s current status.This ignores date and period.

Leave a Reply

Your email address will not be published. Required fields are marked *