Skip to content

Commit

Permalink
Merge pull request #17 from DMBlakeley/main
Browse files Browse the repository at this point in the history
v4.0 review updates
  • Loading branch information
chasenicholl committed Nov 20, 2023
2 parents f8ab3f5 + 857afc4 commit 859a5f2
Show file tree
Hide file tree
Showing 7 changed files with 223 additions and 167 deletions.
29 changes: 24 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ sensor_type `{2}` | value_key | metric units | std units | additional_properties
`Motion Sensor` | wind_gust | m/s | mi/hr | motion_trigger_value | 5 | 10 |
`Occupancy Sensor {3}{4}` | barometric_pressure | mb | inHg | occupancy_trigger_value | 1000 | 30 |
` ` | precip | mm/min | in/hr | occupancy_trigger_value | 0.1 | 0.25 |
` ` | precip_accum_local_day | mm | in | occupancy_trigger_value | 25 | 1 |
` ` | precip_accum_local_day | mm | in | occupancy_trigger_value | 25 | 1 | **Not available with Local API**
` ` | solar_radiation | W/m^2 | W/m^2 | occupancy_trigger_value | 1000| 1000 |
` ` | uv | Index | Index | occupancy_trigger_value | 3 | 3 |
` ` | wind_direction | degrees | degrees | occupancy_trigger_value | 360 | 360 |
Expand All @@ -82,66 +82,85 @@ sensor_type `{2}` | value_key | metric units | std units | additional_properties
"sensors": [
{
"name": "Temperature",
"sensor_type": "Temperature Sensor"
"sensor_type": "Temperature Sensor",
"temperature_properties": {
"value_key": "air_temperature"
}
},
{
"name": "Relative Humidity",
"sensor_type": "Humidity Sensor"
"sensor_type": "Humidity Sensor",
"humidity_properties": {
"value_key": "relative_humidity"
}
},
{
"name": "Light Level",
"sensor_type": "Light Sensor"
"sensor_type": "Light Sensor",
"light_properties": {
"value_key": "brightness"
}
},
{
"name": "Wind Speed",
"sensor_type": "Fan"
"sensor_type": "Fan",
"fan_properties": {
"value_key": "wind_avg"
}
},
{
"name": "Wind Gust",
"sensor_type": "Motion Sensor",
"motion_properties": {
"value_key": "wind_gust",
"trigger_value": 10
}
},
{
"name": "Barometer",
"sensor_type": "Occupancy Sensor",
"occupancy_properties": {
"value_key": "barometric_pressure",
"trigger_value": 30
}
},
{
"name": "Solar Radiation",
"sensor_type": "Occupancy Sensor",
"occupancy_properties": {
"value_key": "solar_radiation",
"trigger_value": 1000
}
},
{
"name": "UV",
"sensor_type": "Occupancy Sensor",
"occupancy_properties": {
"value_key": "uv",
"trigger_value": 3
}
},
{
"name": "Precipitation Rate",
"sensor_type": "Occupancy Sensor",
"occupancy_properties": {
"value_key": "precip",
"trigger_value": 0.25
}
},
{
"name": "Precipitation Today",
"sensor_type": "Occupancy Sensor",
"occupancy_properties": {
"value_key": "precip_accum_local_day",
"trigger_value": 1
}
},
{
"name": "Wind Direction",
"sensor_type": "Occupancy Sensor",
"occupancy_properties": {
"value_key": "wind_direction",
"trigger_value": 360
}
}
Expand Down
20 changes: 8 additions & 12 deletions config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"title": "Fan Properties",
"type": "object",
"condition": {
"functionBody": "if (!model.local_api && model.sensors[arrayIndices] && model.sensors[arrayIndices].sensor_type && model.sensors[arrayIndices].sensor_type === 'Fan') { return true; } else { return false; };"
"functionBody": "if (model.sensors[arrayIndices] && model.sensors[arrayIndices].sensor_type && model.sensors[arrayIndices].sensor_type === 'Fan') { return true; } else { return false; };"
},
"properties": {
"value_key": {
Expand All @@ -95,7 +95,8 @@
"title": "Light Properties",
"type": "object",
"condition": {
"functionBody": "if (!model.local_api && model.sensors[arrayIndices] && model.sensors[arrayIndices].sensor_type && model.sensors[arrayIndices].sensor_type === 'Light Sensor') { return true; } else { return false; };"
"functionBody": "if (model.sensors[arrayIndices] && model.sensors[arrayIndices].sensor_type && model.sensors[arrayIndices].sensor_type === 'Light Sensor') { return true; } else { return false; };"

},
"properties": {
"value_key": {
Expand All @@ -110,7 +111,7 @@
"title": "Humidity Properties",
"type": "object",
"condition": {
"functionBody": "if (!model.local_api && model.sensors[arrayIndices] && model.sensors[arrayIndices].sensor_type && model.sensors[arrayIndices].sensor_type === 'Humidity Sensor') { return true; } else { return false; };"
"functionBody": "if (model.sensors[arrayIndices] && model.sensors[arrayIndices].sensor_type && model.sensors[arrayIndices].sensor_type === 'Humidity Sensor') { return true; } else { return false; };"
},
"properties": {
"value_key": {
Expand All @@ -125,7 +126,7 @@
"title": "Temperature Properties",
"type": "object",
"condition": {
"functionBody": "if (!model.local_api && model.sensors[arrayIndices] && model.sensors[arrayIndices].sensor_type && model.sensors[arrayIndices].sensor_type === 'Temperature Sensor') { return true; } else { return false; };"
"functionBody": "if (model.sensors[arrayIndices] && model.sensors[arrayIndices].sensor_type && model.sensors[arrayIndices].sensor_type === 'Temperature Sensor') { return true; } else { return false; };"
},
"properties": {
"value_key": {
Expand All @@ -150,10 +151,7 @@
"type": "string",
"enum": [
"wind_gust"
],
"condition": {
"functionBody": "if (!model.local_api && model.sensors[arrayIndices] && model.sensors[arrayIndices].sensor_type && model.sensors[arrayIndices].sensor_type === 'Temperature Sensor') { return true; } else { return false; };"
}
]
},
"trigger_value": {
"type": "number",
Expand All @@ -180,10 +178,8 @@
"solar_radiation",
"uv"
],
"condition": {
"functionBody": "if (!model.local_api && model.sensors[arrayIndices] && model.sensors[arrayIndices].sensor_type && model.sensors[arrayIndices].sensor_type === 'Temperature Sensor') { return true; } else { return false; };"
}
},
"description": "Note: `precip_accum_local_day` not supported when using Local API."
},
"trigger_value": {
"type": "number",
"minimum": 0,
Expand Down
Loading

0 comments on commit 859a5f2

Please sign in to comment.