Skip to content

Commit

Permalink
Added Ambient Weather by HTTP
Browse files Browse the repository at this point in the history
  • Loading branch information
PackeTsar committed Mar 12, 2024
1 parent 1cc7234 commit 0a64afe
Show file tree
Hide file tree
Showing 3 changed files with 341 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1002,5 +1002,6 @@ This repository is dedicated to templates that are created and maintained by Zab
* [VM VMware UUID VM Standalone](Virtualization/VMware/template_vmware_uuid_vm_standalone)
* [..Docker.OSLinux.ShortTermContainers](Virtualization/template_docker)
* [Weather_Measurements](Weather_Measurements)
* [Ambient Weather by HTTP](Weather_Measurements/Ambient_Weather)
* [Sonicwall SNMP - TZ600](Weather_Measurements/template_sensor_temp_e_umidade)
* [ZBX-ESP-ENV](Weather_Measurements/template_temperature_and_humidity_monitoring_for_zabbix_using_esp8266_and_dht11_sensors)
70 changes: 70 additions & 0 deletions Weather_Measurements/Ambient_Weather/6.4/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Template Ambient Weather by HTTP

Gather weather stats from your Ambient Weather station using your Ambient Weather online account.

You will need to replace the `{$AWNET.APPLICATIONKEY}` and `{$AWNET.APIKEY}` macros with a developer application key and an API key.

Zabbix server will poll the Ambient Weather website API to pull data. Zabbix does not poll the weather station directly.

To generate an **Application Key**:

- Log in to your Ambient Weather web dashboard
- Navigate to your profile
- Scroll to the "API Keys" section
- Click on the link in the text "Developers: An Application Key is also required for each application that you develop. **Click here** to create one."
- Enter a description in the field and click "**Create Application Key**"

To generate an **API Key**:

- Log in to your Ambient Weather web dashboard
- Navigate to your profile
- Scroll to the "API Keys" section
- Click on the "**Create Application Key**" button
- Give the API key a name if desired



## Macros used

|Name|Description|Default|Type|
|----|-----------|-------|----|
|`{$AWNET.APPLICATIONKEY}`|Ambient Weather generated application key|none|Text macro|
|`{$AWNET.APIKEY}`|Ambient Weather generated API key|none|Text macro|



## Discovery rules

|Name|Description|Type|Key and additional info|
|----|-----------|----|----|
|Get Stats|Process weather station data into items|Dependent Item|`tempf[{#DEVICE.MAC}]`|



## Items collected

|Name|Description|Type|Key and additional info|
|----|-----------|----|----|
|Get Devices|Get a list of Ambient Weather stations from the account to be used by the discovery rule|`HTTP agent`|`devices`|
|`{#DEVICE.NAME}` Barometric Pressure (Absolute)|Barometric Pressure (Absolute)|`Dependent Item`|`baromabsin[{#DEVICE.MAC}]`|
|`{#DEVICE.NAME}` Barometric Pressure (Relative)|Barometric Pressure (Relative)|`Dependent Item`|`baromrelin[{#DEVICE.MAC}]`|
|`{#DEVICE.NAME}` Indoor Dew Point|Indoor Dew Point|`Dependent Item`|`dewPointin[{#DEVICE.MAC}]`|
|`{#DEVICE.NAME}` Outdoor Dew Point|Outdoor Dew Point|`Dependent Item`|`dewPoint[{#DEVICE.MAC}]`|
|`{#DEVICE.NAME}` Indoor Feels Like|Indoor Feels Like|`Dependent Item`|`feelsLikein[{#DEVICE.MAC}]`|
|`{#DEVICE.NAME}` Outdoor Feels Like|Outdoor Feels Like|`Dependent Item`|`feelsLike[{#DEVICE.MAC}]`|
|`{#DEVICE.NAME}` Indoor Humidity|Indoor Humidity|`Dependent Item`|`humidityin[{#DEVICE.MAC}]`|
|`{#DEVICE.NAME}` Outdoor Humidity|Outdoor Humidity|`Dependent Item`|`humidity[{#DEVICE.MAC}]`|
|`{#DEVICE.NAME}` Solar Radiation|Solar Radiation|`Dependent Item`|`solarradiation[{#DEVICE.MAC}]`|
|`{#DEVICE.NAME}` Indoor Temperature (C)|Indoor Temperature (C)|`Dependent Item`|`tempinc[{#DEVICE.MAC}]`|
|`{#DEVICE.NAME}` Indoor Temperature|Indoor Temperature|`Dependent Item`|`tempin[{#DEVICE.MAC}]`|
|`{#DEVICE.NAME}` Outdoor Temperature (C)|Outdoor Temperature (C)|`Dependent Item`|`tempoutc[{#DEVICE.MAC}]`|
|`{#DEVICE.NAME}` Outdoor Temperature|Outdoor Temperature|`Dependent Item`|`tempout[{#DEVICE.MAC}]`|
|`{#DEVICE.NAME}` Wind Direction|Wind Direction|`Dependent Item`|`winddir[{#DEVICE.MAC}]`|
|`{#DEVICE.NAME}` Wind Gust|Wind Gust|`Dependent Item`|`windgustmph[{#DEVICE.MAC}]`|
|`{#DEVICE.NAME}` Wind Speed|Wind Speed|`Dependent Item`|`windspeedmph[{#DEVICE.MAC}]`|



## Triggers

There are no triggers in this template.
270 changes: 270 additions & 0 deletions Weather_Measurements/Ambient_Weather/6.4/template_ambient_weather.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,270 @@
zabbix_export:
version: '6.4'
template_groups:
- uuid: 7df96b18c230490a9a0a9e2307226338
name: Templates
- uuid: c2c162144c2d4c5491c8801193af4945
name: Templates/Cloud
templates:
- uuid: 558c11af8e9249159ae1d969ca055900
template: 'Ambient Weather by HTTP'
name: 'Ambient Weather by HTTP'
description: |
Gather weather stats from your Ambient Weather station using your Ambient Weather online account.
You will need to replace the `{$AWNET.APPLICATIONKEY}` and `{$AWNET.APIKEY}` macros with a developer application key and an API key.
Zabbix server will poll the Ambient Weather website API to pull data. Zabbix does not poll the weather station directly.
To generate an **Application Key**:
- Log in to your Ambient Weather web dashboard
- Navigate to your profile
- Scroll to the "API Keys" section
- Click on the link in the text "Developers: An Application Key is also required for each application that you develop. **Click here** to create one."
- Enter a description in the field and click "**Create Application Key**"
To generate an **API Key**:
- Log in to your Ambient Weather web dashboard
- Navigate to your profile
- Scroll to the "API Keys" section
- Click on the "**Create Application Key**" button
- Give the API key a name if desired
groups:
- name: Templates
- name: Templates/Cloud
items:
- uuid: 72f54170526a4240bceed5e47b2a9928
name: 'Get Devices'
type: HTTP_AGENT
key: devices
history: '0'
trends: '0'
value_type: TEXT
description: 'Get a list of Ambient Weather stations from the account to be used by the discovery rule'
timeout: 10s
url: 'https://rt.ambientweather.net/v1/devices'
query_fields:
- name: applicationKey
value: '{$AWNET.APPLICATIONKEY}'
- name: apiKey
value: '{$AWNET.APIKEY}'
output_format: JSON
discovery_rules:
- uuid: 4889dcd807974b208a1d65822a7e489a
name: 'Get Stats'
type: DEPENDENT
key: 'tempf[{#DEVICE.MAC}]'
delay: '0'
description: 'Process weather station data into items'
item_prototypes:
- uuid: 6a5fece782c7434db5089d7de060ca0f
name: '{#DEVICE.NAME} Barometric Pressure (Absolute)'
type: DEPENDENT
key: 'baromabsin[{#DEVICE.MAC}]'
delay: '0'
value_type: FLOAT
units: 'in Hg'
preprocessing:
- type: JSONPATH
parameters:
- '$.body.[?(@.macAddress == ''{#DEVICE.MAC}'')].lastData.baromabsin.first()'
master_item:
key: devices
- uuid: 51c7449742a242b78944e88125032e40
name: '{#DEVICE.NAME} Barometric Pressure (Relative)'
type: DEPENDENT
key: 'baromrelin[{#DEVICE.MAC}]'
delay: '0'
value_type: FLOAT
units: 'in Hg'
preprocessing:
- type: JSONPATH
parameters:
- '$.body.[?(@.macAddress == ''{#DEVICE.MAC}'')].lastData.baromrelin.first()'
master_item:
key: devices
- uuid: 28f21b68c2f8403c9fe35e49f92d6765
name: '{#DEVICE.NAME} Indoor Dew Point'
type: DEPENDENT
key: 'dewPointin[{#DEVICE.MAC}]'
delay: '0'
value_type: FLOAT
units: F
preprocessing:
- type: JSONPATH
parameters:
- '$.body.[?(@.macAddress == ''{#DEVICE.MAC}'')].lastData.dewPointin.first()'
master_item:
key: devices
- uuid: d80e4f8c6c3c49a08f9294db8a00375d
name: '{#DEVICE.NAME} Outdoor Dew Point'
type: DEPENDENT
key: 'dewPoint[{#DEVICE.MAC}]'
delay: '0'
value_type: FLOAT
units: F
preprocessing:
- type: JSONPATH
parameters:
- '$.body.[?(@.macAddress == ''{#DEVICE.MAC}'')].lastData.dewPoint.first()'
master_item:
key: devices
- uuid: 5e3b4b33c16546c588f3741a83edc679
name: '{#DEVICE.NAME} Indoor Feels Like'
type: DEPENDENT
key: 'feelsLikein[{#DEVICE.MAC}]'
delay: '0'
value_type: FLOAT
units: F
preprocessing:
- type: JSONPATH
parameters:
- '$.body.[?(@.macAddress == ''{#DEVICE.MAC}'')].lastData.feelsLikein.first()'
master_item:
key: devices
- uuid: eec6d05a5ba84846a439493911f1be48
name: '{#DEVICE.NAME} Outdoor Feels Like'
type: DEPENDENT
key: 'feelsLike[{#DEVICE.MAC}]'
delay: '0'
value_type: FLOAT
units: F
preprocessing:
- type: JSONPATH
parameters:
- '$.body.[?(@.macAddress == ''{#DEVICE.MAC}'')].lastData.feelsLike.first()'
master_item:
key: devices
- uuid: 325a9916d962457a8089e9e3ffe3e27e
name: '{#DEVICE.NAME} Indoor Humidity'
type: DEPENDENT
key: 'humidityin[{#DEVICE.MAC}]'
delay: '0'
units: '%'
preprocessing:
- type: JSONPATH
parameters:
- '$.body.[?(@.macAddress == ''{#DEVICE.MAC}'')].lastData.humidityin.first()'
master_item:
key: devices
- uuid: 8d197177a95a4b9d85318b9c43cd50db
name: '{#DEVICE.NAME} Outdoor Humidity'
type: DEPENDENT
key: 'humidity[{#DEVICE.MAC}]'
delay: '0'
units: '%'
preprocessing:
- type: JSONPATH
parameters:
- '$.body.[?(@.macAddress == ''{#DEVICE.MAC}'')].lastData.humidity.first()'
master_item:
key: devices
- uuid: 155b1a4093c54ca9ad9c237e0cb9df3e
name: '{#DEVICE.NAME} Solar Radiation'
type: DEPENDENT
key: 'solarradiation[{#DEVICE.MAC}]'
delay: '0'
value_type: FLOAT
units: W/M²
preprocessing:
- type: JSONPATH
parameters:
- '$.body.[?(@.macAddress == ''{#DEVICE.MAC}'')].lastData.solarradiation.first()'
master_item:
key: devices
- uuid: f8aeedd5864c4c0a931cc23c91e0153e
name: '{#DEVICE.NAME} Indoor Temperature (C)'
type: CALCULATED
key: 'tempinc[{#DEVICE.MAC}]'
value_type: FLOAT
units: C
params: '(last(//tempin[{#DEVICE.MAC}])-32)*(5/9)'
- uuid: b52a30bf002f4737ad56ec6cdc1b639b
name: '{#DEVICE.NAME} Indoor Temperature'
type: DEPENDENT
key: 'tempin[{#DEVICE.MAC}]'
delay: '0'
value_type: FLOAT
units: F
preprocessing:
- type: JSONPATH
parameters:
- '$.body.[?(@.macAddress == ''{#DEVICE.MAC}'')].lastData.tempinf.first()'
master_item:
key: devices
- uuid: 53e4ea8ee7a34d24afe4ed40b8668bd1
name: '{#DEVICE.NAME} Outdoor Temperature (C)'
type: CALCULATED
key: 'tempoutc[{#DEVICE.MAC}]'
value_type: FLOAT
units: C
params: '(last(//tempout[{#DEVICE.MAC}])-32)*(5/9)'
- uuid: 218199edfaf248de95abba4825ec1b87
name: '{#DEVICE.NAME} Outdoor Temperature'
type: DEPENDENT
key: 'tempout[{#DEVICE.MAC}]'
delay: '0'
value_type: FLOAT
units: F
preprocessing:
- type: JSONPATH
parameters:
- '$.body.[?(@.macAddress == ''{#DEVICE.MAC}'')].lastData.tempf.first()'
master_item:
key: devices
- uuid: 13fab80670c040c3b317fb1d66bb2b09
name: '{#DEVICE.NAME} Wind Direction'
type: DEPENDENT
key: 'winddir[{#DEVICE.MAC}]'
delay: '0'
units: °
preprocessing:
- type: JSONPATH
parameters:
- '$.body.[?(@.macAddress == ''{#DEVICE.MAC}'')].lastData.winddir.first()'
master_item:
key: devices
- uuid: 98b796619a3844bcb01c29d09758670a
name: '{#DEVICE.NAME} Wind Gust'
type: DEPENDENT
key: 'windgustmph[{#DEVICE.MAC}]'
delay: '0'
value_type: FLOAT
units: MPH
preprocessing:
- type: JSONPATH
parameters:
- '$.body.[?(@.macAddress == ''{#DEVICE.MAC}'')].lastData.windgustmph.first()'
master_item:
key: devices
- uuid: eaee255341b746b099362d200e45f731
name: '{#DEVICE.NAME} Wind Speed'
type: DEPENDENT
key: 'windspeedmph[{#DEVICE.MAC}]'
delay: '0'
value_type: FLOAT
units: MPH
preprocessing:
- type: JSONPATH
parameters:
- '$.body.[?(@.macAddress == ''{#DEVICE.MAC}'')].lastData.windspeedmph.first()'
master_item:
key: devices
master_item:
key: devices
lld_macro_paths:
- lld_macro: '{#DEVICE.MAC}'
path: $.macAddress
- lld_macro: '{#DEVICE.NAME}'
path: $.info.name
preprocessing:
- type: JSONPATH
parameters:
- $.body
macros:
- macro: '{$AWNET.APIKEY}'
value: xxxxxxxxxxxxxxxxxxxxx
- macro: '{$AWNET.APPLICATIONKEY}'
value: xxxxxxxxxxxxxxxxxxxxx

0 comments on commit 0a64afe

Please sign in to comment.