Skip to content

Commit

Permalink
added adapter calculated values
Browse files Browse the repository at this point in the history
  • Loading branch information
woessmich committed Nov 24, 2020
1 parent 879968b commit 5ac294d
Show file tree
Hide file tree
Showing 5 changed files with 518 additions and 63 deletions.
4 changes: 2 additions & 2 deletions io-package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"common": {
"name": "weatherflow_udp",
"version": "0.0.5",
"version": "0.0.6",
"news": {
"0.0.2": {
"0.0.6": {
"en": "Initial release",
"de": "Erstveröffentlichung",
"ru": "Начальная версия",
Expand Down
22 changes: 17 additions & 5 deletions lib/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,11 @@ messages["device_status"] = {
"hub_rssi": {
"0": ["hub_rssi", { type: "state", common: { type: "number", unit: "", read: true, write: false, role: "state", name: "Hub RSSI value" }, native: {}, }],
},
"sensor_status": { //0x00000000 All Sensors OK, 0x00000001 AIR lightning failed, 0x00000002 AIR lightning noise, 0x00000004 AIR lightning disturber, 0x00000008 AIR pressure failed, 0x00000010 AIR temperature failed, 0x00000020 AIR rh failed, 0x00000040 SKY wind failed, 0x00000080 SKY precip failed, 0x00000100 SKY light/uv failed
"0": ["sensor_status", { type: "state", common: { type: "number", unit: "", read: true, write: false, role: "state", name: "Sensor Status" }, native: {}, }],
"sensor_status": { //0x00000000 All Sensors OK, 0x00000001 lightning failed, 0x00000002 lightning noise, 0x00000004 lightning disturber, 0x00000008 pressure failed, 0x00000010 temperature failed, 0x00000020 rh failed, 0x00000040 wind failed, 0x00000080 precip failed, 0x00000100light/uv failed
"0": ["sensor_status", { type: "state", common: { type: "number", unit: "", read: true, write: false, role: "state", name: "Sensor status" }, native: {}, }],
},
"debug": {
"0": ["debug", { type: "state", common: { type: "number", unit: "", read: true, write: false, role: "state", name: "Debug" }, native: {}, }],
"0": ["debug", { type: "state", common: { type: "number", unit:"", read: true, write: false, role: "state", name: "Debug" }, native: {}, }],
},

};
Expand Down Expand Up @@ -188,11 +188,23 @@ const devices = {
"ST" : "Tempest",
}

const sensorfails = {
0b000000001 : "Lightning failed",
0b000000010 : "Lightning noise",
0b000000100 : "Lightning disturber",
0b000001000 : "Pressure failed",
0b000010000 : "Temperature failed",
0b000100000 : "Humidity failed",
0b001000000 : "Wind failed",
0b010000000 : "Precipitation failed",
0b100000000 : "Light/uv failed",
}

//Wind directions in letters
const windDirections = ["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW","N"];

const minCalcs = ["airTemperature", "stationPressure", "relativeHumidity", "lightningStrikeAvgDistance", "distance",];
const maxCalcs = ["airTemperature", "windLull", "windGust", "windAvg", "windSpeed", "illuminance", "UV", "solarRadiation", "stationPressure", "relativeHumidity", "lightningStrikeCount", "energy",];
const maxCalcs = ["airTemperature", "windLull", "windGust", "windAvg", "windSpeed", "illuminance", "UV", "solarRadiation", "stationPressure", "relativeHumidity", "lightningStrikeCount", "energy"];

module.exports = { messages, devices, windDirections, minCalcs, maxCalcs};
module.exports = { messages, devices, windDirections, minCalcs, maxCalcs,sensorfails};

Loading

0 comments on commit 5ac294d

Please sign in to comment.