naofireblade / homebridge-weather-plus

A comprehensive weather plugin for homebridge.
MIT License
320 stars 64 forks source link

[Weatherflow Tempest] Bizarrely reporting 0ºC, even though the Tempest app does not #288

Closed wimleers closed 8 months ago

wimleers commented 9 months ago

My Weatherflow Tempest was down for a few months due to low battery. I got the PowerBooster accessory, charged it up for a while and it instantly was up and running again. But then a few days ago, it started reporting 0ºC consistently: IMG_7739

And kind of "zero everything":

IMG_7740

Even though according to the Tempest app everything is fine: IMG_7741

The online station view shows that there has not even been a single moment where it hit 0ºC: https://tempestwx.com/history/108422/day/2024/2/17 … but it definitely did something BIZARRE on Thursday, where it reported -13.4ºC for a moment (which is what you see in that first screenshot), although that absolutely did not happen: https://tempestwx.com/history/108422/day/2024/2/15

So … what's going on here? 😓 @dacarson What do you need me to test? (I've restarted Homebridge a few times since then, no impact.)

jmissig commented 9 months ago

Happy to open a separate issue for mine, but my initial read is that I'm seeing the same thing: As of 5am this morning, I've also been receiving 0s for the Homebridge readings from my Tempest, despite the app reporting figures.

What I did was run nc -ukl 50222 simultaneous to looking at the Homebridge logs while debug mode was enabled.

Here's the raw UDP output (note, on Mac OS, I seem to have to hold down return to receive the next message. If anyone knows what other flags I need in nc please do tell.) Pretty sure these readings match what I see in the Tempest app.

{"serial_number":"ST-00125168","type":"device_status","hub_sn":"HB-00071352","timestamp":1708233189,"uptime":3125198,"voltage":2.554,"firmware_revision":173,"rssi":-64,"hub_rssi":-61,"sensor_status":655871,"debug":0}
{"serial_number":"ST-00125168","type":"device_status","hub_sn":"HB-00071352","timestamp":1708233189,"uptime":3125198,"voltage":2.554,"firmware_revision":173,"rssi":-64,"hub_rssi":-61,"sensor_status":655871,"debug":0}
{"serial_number":"ST-00125168","type":"obs_st","hub_sn":"HB-00071352","obs":[[1708233189,0.19,0.99,1.83,214,3,993.98,12.59,92.21,1,0.00,0,0.000000,0,0,0,2.554,1]],"firmware_revision":173}
{"serial_number":"ST-00125168","type":"obs_st","hub_sn":"HB-00071352","obs":[[1708233189,0.19,0.99,1.83,214,3,993.98,12.59,92.21,1,0.00,0,0.000000,0,0,0,2.554,1]],"firmware_revision":173}

Homebridge logs for the same packets, which show it's reading the above as all zeroes for some reason:

[2/17/2024, 9:13:12 PM] [homebridge-weather-plus] Server got: device_status
[2/17/2024, 9:13:12 PM] [homebridge-weather-plus] Temperature Sensor Fail: 1, Humidity Sensor Fail: 1, Light Level Sensor Fail: 1
[2/17/2024, 9:13:12 PM] [homebridge-weather-plus] Server got: device_status
[2/17/2024, 9:13:12 PM] [homebridge-weather-plus] Temperature Sensor Fail: 1, Humidity Sensor Fail: 1, Light Level Sensor Fail: 1
[2/17/2024, 9:13:12 PM] [homebridge-weather-plus] Server got: obs_st
[2/17/2024, 9:13:12 PM] [homebridge-weather-plus] getHourlyAccumulatedRain last minute: 0 rainAccumulation: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 last hour: 0
[2/17/2024, 9:13:12 PM] [homebridge-weather-plus] Creating new count for rain 0 for day undefined
[2/17/2024, 9:13:12 PM] [homebridge-weather-plus] Server got: obs_st
[2/17/2024, 9:13:12 PM] [homebridge-weather-plus] getHourlyAccumulatedRain last minute: 0 rainAccumulation: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 last hour: 0
[2/17/2024, 9:13:12 PM] [homebridge-weather-plus] Adding rain 0 for day 17
[2/17/2024, 9:13:13 PM] [homebridge-weather-plus] Server got: rapid_wind
[2/17/2024, 9:13:14 PM] [homebridge-weather-plus] Server got: rapid_wind
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Updating weather from Weatherflow Tempest
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Current Conditions for station 'Weather': {
  AirPressure: 993.98,
  Condition: 'Unknown',
  ConditionCategory: 0,
  Humidity: 0,
  ObservationStation: 'ST-00125168',
  ObservationTime: '21:13:11',
  Rain1h: 0,
  RainBool: false,
  RainDay: 0,
  SolarRadiation: 0,
  Temperature: 0,
  TemperatureApparent: -4.689999999999998,
  TemperatureMin: 0,
  DewPoint: 0,
  UVIndex: 0,
  WindDirection: 'W',
  WindSpeed: 0.16,
  WindSpeedMax: 1.83,
  BatteryLevel: 64.34782608695649,
  BatteryIsCharging: false,
  WindSpeedLull: 0.19,
  LightningStrikes: 0,
  LightningAvgDistance: 0,
  LightLevel: 0,
  TemperatureWetBulb: -3.6530839705684643,
  SkySensorBatteryLevel: 64.34782608695649,
  SkySerialNumber: 'ST-00125168',
  SkyFirmware: 173,
  AirSensorBatteryLevel: 100,
  AirSerialNumber: 'AR-',
  AirFirmware: '1.0',
  LightLevelSensorFail: 1,
  HumiditySensorFail: 1,
  TemperatureSensorFail: 1
}
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Setting AirPressure to 993.98
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Setting ConditionCategory to 0
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Setting Humidity to 0
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Setting ObservationStation to ST-00125168
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Setting ObservationTime to 21:13:11
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Setting Rain1h to 0
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Setting RainBool to false
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Setting RainDay to 0
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Setting SolarRadiation to 0
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Setting Temperature to 0
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Setting TemperatureMin to 0
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Setting UVIndex to 0
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Setting WindDirection to W
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Setting WindSpeed to 0.16
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Setting WindSpeedMax to 1.83
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Setting WindSpeedLull to 0.19
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Setting LightningStrikes to 0
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Setting LightningAvgDistance to 0
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Setting LightLevel to 0
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Setting BatteryLevel to 64.34782608695649
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Setting BatteryIsCharging to false
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Setting DewPoint to 0
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Setting TemperatureApparent to -4.689999999999998
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Setting TemperatureWetBulb to -3.6530839705684643
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Saving history entry
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] **Fakegato-timer: addData  Weather { time: 1708233196.663, temp: 0, pressure: 994, humidity: 0 }  immediate:  false
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Persisting AirPressure: 993.98
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Persisting ConditionCategory: 0
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Persisting Humidity: 0
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Persisting ObservationStation: ST-00125168
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Persisting ObservationTime: 21:13:11
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Persisting Rain1h: 0
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Persisting RainBool: false
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Persisting RainDay: 0
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Persisting SolarRadiation: 0
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Persisting Temperature: 0
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Persisting TemperatureMin: 0
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Persisting UVIndex: 0
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Persisting WindDirection: W
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Persisting WindSpeed: 0.16
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Persisting WindSpeedMax: 1.83
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Persisting WindSpeedLull: 0.19
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Persisting LightningStrikes: 0
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Persisting LightningAvgDistance: 0
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Persisting LightLevel: 0
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Persisting BatteryLevel: 64.34782608695649
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Persisting BatteryIsCharging: false
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Persisting DewPoint: 0
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Persisting TemperatureApparent: -4.689999999999998
[2/17/2024, 9:13:16 PM] [homebridge-weather-plus] Persisting TemperatureWetBulb: -3.6530839705684643
jmissig commented 9 months ago

Oh I see what’s happening. My Tempest is sending "sensor_status":655871 which probably has sensor failure bits set for all the sensors that the Homebridge plugin is marking as failed. When a sensor is failed the plugin then sets those values to 0 (is this the best option for unavailable data? Can’t do a null?)

So now a second question is why is my Tempest claiming a bunch of sensor failures on UDP if it’s not showing any such thing in the app.

jmissig commented 9 months ago

Been digging a little more. 655871 is 0b10100000000111111111 which the protocol documentation would indicate is a true for every single sensor failure type. I suspect homebridge-weather-plus is interpreting this field correctly (though again, 0 values for weather are probably not the best).

I started a discussion in the community forums in case other folks have seen this. The person who replied made a set of python tools called wfudptools that make it easier to inspect packets if you have python3/pip3.

I also started a private support request with Weatherflow to see what they say.

@wimleers I'd suggest pip3 install wfudptools and then wfudplistener --decoded. Watch for a device_status packet. Share what your sensor_status is reported as.

wimleers commented 9 months ago

@jmissig Can't to the wfudptools thing right now since I can't install Python on my iPad and won't install it on my home server 😅 Will do that tomorrow.

Using nc -ukl 50222, I get similar output:

{"serial_number":"HB-00123987","type":"hub_status","firmware_revision":"194","uptime":411937,"rssi":-41,"timestamp":1708380410,"reset_flags":"PIN,SFT","seq":41161,"radio_stats":[26,1,0,3,11154],"mqtt_stats":[1,0]}
{"serial_number":"ST-00109058","type":"rapid_wind","hub_sn":"HB-00123987","ob":[1708380411,0.00,0]}
{"serial_number":"ST-00109058","type":"device_status","hub_sn":"HB-00123987","timestamp":1708380412,"uptime":22273,"voltage":2.696,"firmware_revision":172,"rssi":-44,"hub_rssi":-46,"sensor_status":672255,"debug":0}
{"serial_number":"ST-00109058","type":"obs_st","hub_sn":"HB-00123987","obs":[[1708380412,0.00,0.15,0.60,167,3,1027.47,7.17,91.46,4,0.00,0,0.000000,0,0,0,2.696,1]],"firmware_revision":172}
{"serial_number":"ST-00109058","type":"rapid_wind","hub_sn":"HB-00123987","ob":[1708380414,0.00,0]}
{"serial_number":"ST-00109058","type":"rapid_wind","hub_sn":"HB-00123987","ob":[1708380417,0.00,0]}
{"serial_number":"HB-00123987","type":"hub_status","firmware_revision":"194","uptime":411947,"rssi":-40,"timestamp":1708380420,"reset_flags":"PIN,SFT","seq":41162,"radio_stats":[26,1,0,3,11154],"mqtt_stats":[1,0]}{"serial_number":"ST-00109058","type":"rapid_wind","hub_sn":"HB-00123987","ob":[1708380420,0.51,143]}

Enabled Homebridge's debug mode, and I'm also seeing similar output:

[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Updating weather from Weatherflow Tempest
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Current Conditions for station 'Now': {
  AirPressure: 1027.48,
  Condition: 'Unknown',
  ConditionCategory: 0,
  Humidity: 0,
  ObservationStation: 'ST-00109058',
  ObservationTime: '22:58:12',
  Rain1h: 0,
  RainBool: false,
  RainDay: 0,
  SolarRadiation: 0,
  Temperature: 0,
  TemperatureApparent: -4,
  TemperatureMin: 0,
  DewPoint: 0,
  UVIndex: 0,
  WindDirection: 'N',
  WindSpeed: 0,
  WindSpeedMax: 0,
  BatteryLevel: 84.92753623188409,
  BatteryIsCharging: false,
  WindSpeedLull: 0,
  LightningStrikes: 0,
  LightningAvgDistance: 0,
  LightLevel: 0,
  TemperatureWetBulb: -3.6530839705684643,
  SkySensorBatteryLevel: 84.92753623188409,
  SkySerialNumber: 'ST-00109058',
  SkyFirmware: 172,
  AirSensorBatteryLevel: 100,
  AirSerialNumber: 'AR-',
  AirFirmware: '1.0',
  LightLevelSensorFail: 1,
  HumiditySensorFail: 1,
  TemperatureSensorFail: 1
}
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Setting AirPressure to 1027.48
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Setting ConditionCategory to 0
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Setting Humidity to 0
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Setting ObservationStation to ST-00109058
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Setting ObservationTime to 22:58:12
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Setting Rain1h to 0
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Setting RainBool to false
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Setting RainDay to 0
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Setting SolarRadiation to 0
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Setting Temperature to 0
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Setting TemperatureMin to 0
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Setting UVIndex to 0
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Setting WindDirection to N
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Setting WindSpeed to 0
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Setting WindSpeedMax to 0
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Setting WindSpeedLull to 0
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Setting LightningStrikes to 0
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Setting LightningAvgDistance to 0
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Setting LightLevel to 0
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Setting BatteryLevel to 84.92753623188409
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Setting BatteryIsCharging to false
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Setting DewPoint to 0
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Setting TemperatureApparent to -4
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Setting TemperatureWetBulb to -3.6530839705684643
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Saving history entry
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] **Fakegato-timer: addData  Now { time: 1708379894.841, temp: 0, pressure: 1027, humidity: 0 }  immediate:  false
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Persisting AirPressure: 1027.48
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Persisting ConditionCategory: 0
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Persisting Humidity: 0
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Persisting ObservationStation: ST-00109058
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Persisting ObservationTime: 22:58:12
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Persisting Rain1h: 0
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Persisting RainBool: false
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Persisting RainDay: 0
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Persisting SolarRadiation: 0
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Persisting Temperature: 0
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Persisting TemperatureMin: 0
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Persisting UVIndex: 0
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Persisting WindDirection: N
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Persisting WindSpeed: 0
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Persisting WindSpeedMax: 0
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Persisting WindSpeedLull: 0
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Persisting LightningStrikes: 0
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Persisting LightningAvgDistance: 0
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Persisting LightLevel: 0
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Persisting BatteryLevel: 84.92753623188409
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Persisting BatteryIsCharging: false
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Persisting DewPoint: 0
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Persisting TemperatureApparent: -4
[2/19/2024, 10:58:14 PM] [homebridge-weather-plus] Persisting TemperatureWetBulb: -3.6530839705684643
[2/19/2024, 10:58:17 PM] [homebridge-weather-plus] Server got: rapid_wind
jmissig commented 9 months ago

Yeah your "sensor_status":672255 is similar but not identical. 0b10100100000111111111 shows all sensors as having failed, but your higher-order bits ("reserved for internal use and should be ignored") are a little different from mine.

wfudptools probably won't tell you anything more than you've already managed to collect. I was simply suggesting it as a little easier.

wimleers commented 9 months ago

I did the wfudptools thing anyway:

$ wfudplistener --decoded
setting up socket - done
listening for broadcasts..
rapid_wind     =>  ts  = 1708450732 mps = 0.87 dir = 187
rapid_wind     =>  ts  = 1708450734 mps = 0.25 dir = 187
hub_status     =>  ts  = 1708450735 firmware_revision  = 194 uptime  = 482262 rssi  = -40
rapid_wind     =>  ts  = 1708450737 mps = 0.07 dir = 187
rapid_wind     =>  ts  = 1708450741 mps = 0.72 dir = 210
rapid_wind     =>  ts  = 1708450744 mps = 0.78 dir = 210
hub_status     =>  ts  = 1708450745 firmware_revision  = 194 uptime  = 482272 rssi  = -40
rapid_wind     =>  ts  = 1708450747 mps = 0.7 dir = 217
rapid_wind     =>  ts  = 1708450749 mps = 0.2 dir = 217
rapid_wind     =>  ts  = 1708450752 mps = 0.06 dir = 217
hub_status     =>  ts  = 1708450755 firmware_revision  = 194 uptime  = 482282 rssi  = -39
rapid_wind     =>  ts  = 1708450755 mps = 0.02 dir = 217
rapid_wind     =>  ts  = 1708450759 mps = 0.23 dir = 286
rapid_wind     =>  ts  = 1708450761 mps = 0.06 dir = 286
rapid_wind     =>  ts  = 1708450764 mps = 0.02 dir = 286
hub_status     =>  ts  = 1708450765 firmware_revision  = 194 uptime  = 482292 rssi  = -38
rapid_wind     =>  ts  = 1708450768 mps = 0.61 dir = 115
rapid_wind     =>  ts  = 1708450771 mps = 0.46 dir = 134
device_status  =>  serial_number  = ST-00109058 device_type = tempest ts  = 1708450771 uptime  = 92653 voltage  = 2.8 firmware_revision  = 172 rssi  = -42 hub_rssi  = -44 sensor_status  = 672255 debug  = 0
obs_st        =>  timestamp  = 1708450771 wind_lull  = 0.02 wind_avg  = 0.38 wind_gust  = 0.98 wind_direction  = 201 wind_sample_interval  = 3 station_pressure  = 1023.8 temperature  = 10.44 relative_humidity  = 82.58 illuminance  = 5 uv  = 0.0 solar_radiation  = 0 rain_accumulated  = 0.0 precipitation_type  = 0 lightning_strike_avg_distance  = 0 lightning_strike_count  = 0 battery = 2.8 report_interval = 1 firmware_revision = 172
rapid_wind     =>  ts  = 1708450774 mps = 0.58 dir = 165
hub_status     =>  ts  = 1708450775 firmware_revision  = 194 uptime  = 482302 rssi  = -39
rapid_wind     =>  ts  = 1708450777 mps = 0.71 dir = 205
rapid_wind     =>  ts  = 1708450780 mps = 0.87 dir = 189
rapid_wind     =>  ts  = 1708450783 mps = 0.86 dir = 200
hub_status     =>  ts  = 1708450785 firmware_revision  = 194 uptime  = 482312 rssi  = -39
rapid_wind     =>  ts  = 1708450786 mps = 1.04 dir = 185
^CTraceback (most recent call last):
  File "/opt/homebrew/bin/wfudplistener", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/wfudptools/listener.py", line 852, in main
    msg=s.recvfrom(1024)
        ^^^^^^^^^^^^^^^^
KeyboardInterrupt

☝️ Indeed nothing extra it seems.

How are things going with Weatherflow support? 🤞

wimleers commented 9 months ago

What's interesting there is the presence of

temperature  = 10.44

… whereas I'm still seeing 0ºC reported by the logic here… 😬 🤔

@jmissig Do you see the same (0 reported by homebridge-weather-plus, wfudptools reporting a non-zero temp)?

jmissig commented 9 months ago

@wimleers Yes. This is (new) intentional behavior by homebridge-weather-plus (see #279). It detects that the sensors are bad and therefore is discarding their readings. It’s meant to guard against recording wildly-inaccurate numbers.

But it seems our Tempest hubs are incorrectly reporting bad sensors. And the plugin is recording zeroes when a sensor is bad.

No reply from Weatherflow.

Edit: From weatherflow.js, around line 279:

            if (that.currentReport.TemperatureSensorFail == 1)
                that.currentReport.Temperature = 0;
            else
                that.currentReport.Temperature = message.obs[0][2];
            if (that.currentReport.HumiditySensorFail == 1) {
                that.currentReport.Humidity = 0;
                that.currentReport.DewPoint = 0;
            }
wimleers commented 9 months ago

That logic is not new. It was added in the original commit? https://github.com/naofireblade/homebridge-weather-plus/commit/33ba5cc02bff6490b02925c35947c371c4ce4848#diff-f68c26e0e5bee59f2afad0524c48b158169aacf6b8b8b801b15cbd3ca50c0822

I just modified the logic from this.log.debug to this.log.warn:

            // TODO: Check if a sensor has failed, and log it!
            this.log.warn("Temperature Sensor Fail: %d, Humidity Sensor Fail: %d, Light Level Sensor Fail: %d", 

… and sure enough: temperature, humidity and light level sensor all failed 😞

jmissig commented 9 months ago

@wimleers Apologies for my misunderstanding as to newness.

But all-in-all I'm seeing the same as you. Sensors still seem fine so I don't think it's just that UDP is early or anything. Seems more likely some sort of Weatherflow-side bug setting those sensor failure bits incorrectly.

jmissig commented 9 months ago

Weatherflow support tells me they do not see any sensor issues with my station. Handing off to their developers to see if this value is expected.

dacarson commented 9 months ago

It is odd that it is reporting that all your sensors are failing. The purpose of the original change of setting Temperature and Humidity to zero when the sensor failed was to (a) clearly show that something is up in the Eve app (which worked - you noticed the graph) and (b) to avoid any issues with the calculated fields: DewPoint, Temperature Apparent and TemperatureWetBulb. FWIW, I had a failed sensor and it took me a while to realize as it reported a fixed temperature, that is why I added it.

With the new handling of failing sensors, here and here, I address (a) by adding support for HomeKit's StatusFault Characteristic, and for (b) I kept the setting of Temperature and Humidity to zero (but not the Light sensor as it isn't used in calculations).

For other values being zero, such as UV Index, Solar Radiation, Wind Lull, Wind Max, etc, I am unsure of any reason why they would be zero. The fact that you have: LightLevelSensorFail: 1, tells me that you using the current released build. Checking that code, it should set the other values it receives from the weather station. As you have a value for the battery level, that tells me that the code is processing all the data it receives. The battery voltage is the last item that is processed in the data.

If it is useful, I can give you a line to change to have home bridge log the full data blocks it receives from the weather station.

dacarson commented 9 months ago

An alternative for setting temperature and humidity to zero, I could avoid all calculated values if the sensor is reporting as failed. That way values will still be reported (though they may be incorrect) but I won't run the risk of bad calculations.

Also, I would verify that your temperature values are changing. For me, when my temperature sensor failed, I saw the same temperature continuously reported.

jmissig commented 9 months ago

In my case, temperature as reported in Tempest app is changing and seems to be changing similarly to other nearby stations.

_(Not that it matters, but I’m placing my overall bet on a bug in Weatherflow’s code that sets the higher-order private-use bits for sensor_status. Probably used a wrong bitshift or bitwise operator under some condition that wants those private bits set, resulting in the nine 0s flipping to nine 1s.)_

I can’t explain why everything else gets zeroed on the weather-plus side, but I’ve not looked at the code all that closely.

dacarson commented 9 months ago

If it is helpful, if you change this line in weatherflow.js: this.log.debug(``Server got: ${message.type}``); to this this.log.error(``Server got: ${msg.toString()}``); it will print out every message the plugin is receiving.

dacarson commented 9 months ago

FYI, my hub status on my weather station, I see this: Server got: {"serial_number":"ST-00101719","type":"device_status","hub_sn":"HB-00038240","timestamp":1708487497,"uptime":33964093,"voltage":2.670,"firmware_revision":172,"rssi":-50,"hub_rssi":-46,"sensor_status":655360,"debug":0} my sensor status is 0b1010 0000 0000 0000 0000

dacarson commented 9 months ago

Also, are you using a Tempest combined weather station, or are you using the separate Sky and Air units?

jmissig commented 9 months ago

Tempest weather station. I actually had the pressure sensor fail a few weeks back (I think this came up in another issue), and recently had the whole unit replaced with a new one.

wimleers commented 9 months ago

With the new handling of failing sensors, here and here, I address (a) by adding support for HomeKit's StatusFault Characteristic, and for (b) I kept the setting of Temperature and Humidity to zero (but not the Light sensor as it isn't used in calculations).

Ah, clearly I was wrong in https://github.com/naofireblade/homebridge-weather-plus/issues/288#issuecomment-1954885850 — the failing sensor handling has been refined since the original commit!

What's odd:

This suggests to me that there was a regression in 170, which they tried to fix in 171 with no API changes, just pure bugfixes. But that appears to not have been enough, hence version 172 which I'm on, followed by 173 which @jmissig is on… but some quick googling later, it seems like 172 has been out since at least October 2022, and 173 has been out since at least December 2023: https://community.weatherflow.com/t/how-are-firmware-updates-handled/18387/13.

@jmissig When did you buy your Tempest? And do you have a Powerbooster?

wimleers commented 9 months ago

Just tried https://apidocs.tempestwx.com/reference/quick-start#get-latest-device-observation, i.e. https://swd.weatherflow.com/swd/rest/observations/?device_id=[your_device_id]&token=[your_access_token], and sure enough, the data I'd expect is right there:

{
  "status": {
    "status_code": 0,
    "status_message": "SUCCESS"
  },
  "device_id": [redacted],
  "type": "obs_st",
  "source": "cache",
  "summary": {
    "pressure_trend": "falling",
    "strike_count_1h": 0,
    "strike_count_3h": 0,
    "precip_total_1h": 0.593135,
    "strike_last_dist": 10,
    "strike_last_epoch": 1699700671,
    "precip_accum_local_yesterday": 0.006221,
    "precip_analysis_type_yesterday": 0,
    "feels_like": 8.8,
    "heat_index": 9.3,
    "wind_chill": 8.8
  },
  "obs": [
    [
      1708525750,
      0.44,
      1.5,
      3.05,
      245,
      3,
      1005.7,
      9.3,
      90,
      10676,
      0.35,
      88,
      0.030986,
      1,
      0,
      0,
      2.8,
      1,
      0.7869,
      null,
      null,
      0
    ]
  ]
}

(The device ID is an integer that is not visible anywhere else — it's different from your station name! Use https://apidocs.tempestwx.com/reference/quick-start#get-station-meta-data to determine what it is for you. Took me 10 minutes to discover this 🤷)

dacarson commented 9 months ago

My Tempest went down overnight too. I'm heading out will need to debug when I get back. image

jmissig commented 9 months ago

My Tempest hardware is a replacement unit they sent to me in January. They’re not particularly aggressive about rolling out the minor firmware updates to everyone so it’s no surprise mine’s on a more recent revision.

No power booster.

dacarson commented 9 months ago

My unit is not transmitting anymore. I am only seeing hub status messages: Server got: {"serial_number":"HB-00038240","type":"hub_status","firmware_revision":"171","uptime":4839955,"rssi":-65,"timestamp":1708533083,"reset_flags":"BOR,PIN,POR","seq":483110,"fs":[1,0,15675411,524288],"radio_stats":[25,1,0,3,47675],"mqtt_stats":[852,67]}

I am seeing if I can find the last few records it sent before it went dead. (I am also logging the weather information to a local InfluxDB database for graphing with grafana)

dacarson commented 9 months ago

When my sensors status changed, I started to get empty (null?) observation data here and there. Then it stopped working reporting device_status and observation data all together. The failure point and last records are shown below. I still see hub_status messages.


name: device_status
time                 debug device  firmware_revision hub_rssi rssi sensor_status timestamp  uptime   voltage
----                 ----- ------  ----------------- -------- ---- ------------- ---------  ------   -------
2024-02-21T09:21:30Z 0     tempest 172               -45      -48  655360        1708507290 33983893 2.658
2024-02-21T09:22:30Z 0     tempest 172               -45      -48  131144        1708507350 33983953 2.658
2024-02-21T09:25:47Z 0     tempest 172               -45      -48  131448        1708507547 33984135 2.647
2024-02-21T09:26:30Z 0     tempest 172               -45      -48  131448        1708507590 33984193 2.659
2024-02-21T09:27:53Z 0     tempest 172               -45      -48  131448        1708507673 33984255 2.659
...
2024-02-21T10:31:29Z 0     tempest 172               -45      -48  655360        1708511489 33988094 2.655
2024-02-21T10:32:28Z 0     tempest 172               -45      -48  131448        1708511548 33988153 2.656
2024-02-21T10:33:28Z 0     tempest 172               -45      -48  131448        1708511608 33988213 2.656
2024-02-21T10:34:29Z 0     tempest 172               -45      -48  131448        1708511669 33988273 2.651
2024-02-21T10:35:28Z 0     tempest 172               -45      -48  655424        1708511728 33988333 2.653
2024-02-21T10:36:33Z 0     tempest 172               -45      -48  131144        1708511793 33988397 2.652
2024-02-21T10:37:31Z 0     tempest 172               -45      -48  131400        1708511851 33988456 2.651
2024-02-21T10:38:28Z 0     tempest 172               -45      -48  131144        1708511908 33988513 2.652
2024-02-21T10:39:30Z 0     tempest 172               -45      -48  131400        1708511970 33988573 2.651
2024-02-21T10:40:30Z 0     tempest 172               -45      -48  131448        1708512030 33988633 2.652
2024-02-21T10:41:30Z 0     tempest 172               -45      -48  131144        1708512090 33988693 2.653
2024-02-21T10:43:26Z 0     tempest 172               -45      -48  131144        1708512206 33988807 2.653
2024-02-21T10:43:30Z 0     tempest 172               -45      -48  131448        1708512210 33988813 2.65
2024-02-21T10:44:30Z 0     tempest 172               -45      -48  131144        1708512270 33988873 2.65
2024-02-21T10:45:30Z 0     tempest 172               -45      -48  131400        1708512330 33988933 2.648

name: wf/obs_st
time                 battery firmware_revision illuminance lightning_strike_avg_distance lightning_strike_count precipitation_type rain_accumulated relative_humidity report_interval solar_radiation station_pressure temperature timestamp  uv wind_avg wind_direction wind_gust wind_lull wind_sample_interval
----                 ------- ----------------- ----------- ----------------------------- ---------------------- ------------------ ---------------- ----------------- --------------- --------------- ---------------- ----------- ---------  -- -------- -------------- --------- --------- --------------------
2024-02-21T09:21:30Z 2.658   172               1           0                             0                      0                  0                95.89             1               0               1008.43          10.14       1708507290 0  0.27     228            0.76      0         3
2024-02-21T09:22:30Z 2.658   172               1           0                             0                      0                  0                95.87             1               0                                10.15       1708507350 0  0.04     218            0.21      0         3
2024-02-21T09:23:47Z 2.647   172                           0                             0                      0                  0                                  1                                                            1708507427                                                3
2024-02-21T09:24:47Z 2.647   172                           0                             0                      0                  0                                  1                                                            1708507487                                                3
2024-02-21T09:25:46Z 2.647   172                           0                             0                      0                  0                                  1                                                            1708507546                                                3
2024-02-21T09:26:30Z 2.659   172                           0                             0                      0                  0                                  1                                                            1708507590                                                3
...
2024-02-21T10:31:29Z 2.655   172               1           0                             0                      0                  0                94.25             1               0               1008.57          10.33       1708511489 0  0.96     217            1.21      0.66      3
2024-02-21T10:32:28Z 2.656   172                           0                             0                      0                  0                                  1                                                            1708511548    1.02     216            1.02      1.02      3
2024-02-21T10:33:28Z 2.656   172                           0                             0                      0                  0                                  1                                                            1708511608                                                3
2024-02-21T10:34:29Z 2.651   172                           0                             0                      0                  0                                  1                                                            1708511669                                                3
2024-02-21T10:35:28Z 2.653   172               1           0                             0                      0                  0                94.24             1               0               1008.6           10.32       1708511728 0                                              3
2024-02-21T10:36:31Z 2.652   172               1           0                             0                      0                  0                94.25             1               0                                10.3        1708511791 0                                              3
2024-02-21T10:37:31Z 2.651   172                           0                             0                      0                  0                94.25             1                                                10.28       1708511851                                                3
2024-02-21T10:38:28Z 2.652   172               1           0                             0                      0                  0                94.26             1               0                                10.27       1708511908 0                                              3
2024-02-21T10:39:30Z 2.651   172                           0                             0                      0                  0                94.27             1                                                10.26       1708511970                                                3
2024-02-21T10:40:30Z 2.652   172                           0                             0                      0                  0                                  1                                                            1708512030                                                3
2024-02-21T10:41:30Z 2.653   172               1           0                             0                      0                  0                94.22             1               0                                10.26       1708512090 0                                              3
2024-02-21T10:43:25Z 2.653   172               1           0                             0                      0                  0                51.44             1               0                                5.23        1708512205 0                                              3
2024-02-21T10:43:30Z 2.65    172                           0                             0                      0                  0                                  1                                                            1708512210                                                3
2024-02-21T10:44:30Z 2.65    172               1           0                             0                      0                  0                94.21             1               0                                6.15        1708512270 0                                              3
2024-02-21T10:45:30Z 2.648   172                           0                             0                      0                  0                94.16             1                                                6.9         1708512330                                                3
jmissig commented 9 months ago

Just double-checked, mine is still transmitting sane weather data over UDP locally. Sounds like your issue might be different!

obs_st        =>  timestamp  = 1708538042 wind_lull  = 0.23 wind_avg  = 0.96 wind_gust  = 1.5 wind_direction  = 245 wind_sample_interval  = 3 station_pressure  = 1001.93 temperature  = 13.76 relative_humidity  = 83.24 illuminance  = 67923 uv  = 2.41 solar_radiation  = 566 rain_accumulated  = 0.0 precipitation_type  = 0 lightning_strike_avg_distance  = 0 lightning_strike_count  = 0 battery = 2.724 report_interval = 1 firmware_revision = 173
obs_st        =>  timestamp  = 1708538162 wind_lull  = 0.67 wind_avg  = 1.4 wind_gust  = 2.54 wind_direction  = 307 wind_sample_interval  = 3 station_pressure  = 1001.91 temperature  = 13.85 relative_humidity  = 83.19 illuminance  = 70037 uv  = 2.49 solar_radiation  = 584 rain_accumulated  = 0.0 precipitation_type  = 0 lightning_strike_avg_distance  = 0 lightning_strike_count  = 0 battery = 2.724 report_interval = 1 firmware_revision = 173
obs_st        =>  timestamp  = 1708538222 wind_lull  = 0.48 wind_avg  = 1.58 wind_gust  = 2.98 wind_direction  = 253 wind_sample_interval  = 3 station_pressure  = 1001.89 temperature  = 13.89 relative_humidity  = 80.99 illuminance  = 69341 uv  = 2.46 solar_radiation  = 578 rain_accumulated  = 0.0 precipitation_type  = 0 lightning_strike_avg_distance  = 0 lightning_strike_count  = 0 battery = 2.724 report_interval = 1 firmware_revision = 173
wimleers commented 9 months ago

WTF, three people, all with different failure modes and one on a replacement unit already! 😳🫣

Why was your unit replaced, @jmissig?

jmissig commented 9 months ago

@wimleers the pressure sensor failed. Weatherflow verified from their end and sent a replacement quickly, no fuss, I was impressed.

At the moment I doubt that your issue and mine are hardware-related.

dacarson commented 9 months ago

I do find it odd that mine suddenly failed in the middle of the night after hearing about yours returning error codes. I filed a ticket about the hardware failure, I'll see what they say.

In the mean time, is there a change that I should make so that even if sensors have failed, to continue updating the reported values?

wimleers commented 9 months ago

In the mean time, is there a change that I should make so that even if sensors have failed, to continue updating the reported values?

Yes: add a setting to ignore the failures. I've currently "hacked" the code like this:

         /*
         that.currentReport.TemperatureSensorFail = (message.sensor_status & 0x00000010) ? 1 : 0;
         that.currentReport.HumiditySensorFail = (message.sensor_status & 0x00000020) ? 1 : 0;
         that.currentReport.LightLevelSensorFail = (message.sensor_status & 0x00000100) ? 1 : 0;
         */

☝️ Added the /* and */ lines to simply ignore the failures. All is well now.

wimleers commented 9 months ago

Actually … I have a different proposal:

  1. let's do #279, and just report a sensor failure through that characteristic only
  2. let's delete the 3 lines I commented out, so that temperatures continue working
  3. end result: never any disruption, but you do get a warning as an end user 👍

Thoughts, @jmissig & @dacarson? 😊

jmissig commented 9 months ago

Actually … I have a different proposal:

  1. let's do [Weatherflow Tempest] Report additional failed sensors #279, and just report a sensor failure through that characteristic only
  2. let's delete the 3 lines I commented out, so that temperatures continue working
  3. end result: never any disruption, but you do get a warning as an end user 👍

Thoughts, @jmissig & @dacarson? 😊

👍 All of this plus:

  1. Do not perform calculations with any values reported from a "failed" sensor.

This way we'll still get a record of whatever the sensor was putting out, but we're not propagating potential errors into new data that weather-plus is calculating on a sensor's behalf. Which is how I interpreted @dacarson 's comment above:

An alternative for setting temperature and humidity to zero, I could avoid all calculated values if the sensor is reporting as failed. That way values will still be reported (though they may be incorrect) but I won't run the risk of bad calculations.

Edit: I've not yet tested this, but here's a diff of roughly what I had in mind.

dacarson commented 9 months ago

Edit: I've not yet tested this, but here's a diff of roughly what I had in mind.

The patch looks great to me. The only thing I would suggest is zeroing out the values for that.currentReport.DewPoint, that.currentReport.TemperatureApparent and that.currentReport.TemperatureWetBulb in an else statement. Otherwise the previous values will be reported*. If the previous values are used, they most likely will be wrong, so setting it to zero is a better path IMO.

I can update my fork with this change.

* Unlike the other API modules, the weatherflow one reuses the same structure and just updates the values. What this means is that a value will be reported as unchanged if it is not updated. The other API modules construct a new structure with the current data on each refresh call.

wimleers commented 9 months ago

👍 All of this plus: 4. Do not perform calculations with any values reported from a "failed" sensor.

Well … that will mean I won't be getting a wet bulb temperature anymore, which is what I'm using to determine whether it's cold/cool/nice/hot outside … and I have dozens of automations depending on that 😅

(In my case, all 3 sensors are reported as failed! Initial response from Weatherflow support: "everything seems fine now?" 😬 — no, the sensors are still reported to be failing!)

I do agree that your proposal is sensible though. So for unlucky ones like me, I propose there's a config-without-UI flag to ignore failed sensors 🙈

jmissig commented 9 months ago

Well we could report all the values for now until we get a better response from Weatherflow about what’s going on. And only then once whatever this UDP-failure-report issue is fixed, do the right thing by zeroing out calculated values.

dacarson commented 9 months ago

Let me see if out of bound numbers could cause a crash, and Homebridge go into constant rebooting mode - that is what I am trying to avoid with avoiding calculations.

wimleers commented 9 months ago

I heard back:

That is weird. Could you send me a screenshot? I'll have the data science team look at it.

I pointed them to this issue (and https://github.com/naofireblade/homebridge-weather-plus/issues/288#issuecomment-1953205525 specifically because it's the raw, unprocessed data being broadcast) and gave them my contact info.

Fingers crossed! 🤞

dacarson commented 9 months ago

I also heard back for my issue, they essentially asked me to just reboot the Tempest unit and see if that works. This is unfortunately difficult to do as it isn't easy to get to. I do hope to do the reboot in the next week or so. I tried rebooting my hub but that didn't do anything. I am scouring my hub_status records to see if there is anything interesting there around the time that it failed.

wimleers commented 9 months ago

@dacarson Interesting. My failure mode is different of course (data is coming in, but reporting sensor failures), but a reboot didn't make a difference for me. (First thing I tried — the ol' "Did you turn it off and on again?" 😄)

dacarson commented 9 months ago

I have setup my prev. generation Weatherflow devices, the 'Sky' and 'Air' units so that I can continue working on addressing this issue. When doing this, I noted that I need the device_status to be more robust. I need to match the serial_number from the device_status to the observation data. This is normally 1:1, where a normal user has one Tempest weather station so there is only one device_status. However, you can have multiple units.

wimleers commented 8 months ago

Thanks, @naofireblade !

wimleers commented 3 months ago

With the new handling of failing sensors, here and here, I address (a) by adding support for HomeKit's StatusFault Characteristic, and for (b) I kept the setting of Temperature and Humidity to zero (but not the Light sensor as it isn't used in calculations).

Ah, clearly I was wrong in #288 (comment) — the failing sensor handling has been refined since the original commit!

What's odd:

This suggests to me that there was a regression in 170, which they tried to fix in 171 with no API changes, just pure bugfixes. But that appears to not have been enough, hence version 172 which I'm on, followed by 173 which @jmissig is on… but some quick googling later, it seems like 172 has been out since at least October 2022, and 173 has been out since at least December 2023: https://community.weatherflow.com/t/how-are-firmware-updates-handled/18387/13.

@jmissig When did you buy your Tempest? And do you have a Powerbooster?

I heard back from Weatherflow support. My Tempest was updated.

I'm currently on 176. https://weatherflow.github.io/Tempest/api/udp/v171/ is still the latest in the official docs.

Most importantly: there's no difference. I still get:

[7/29/2024, 11:24:29 PM] [homebridge-weather-plus] Sensor on unit ST-00109058 failed:  Lightning failed, Lightning noise, Lightning disturber, Pressure failed, Temperature failed, Relative Humidity failed, Wind failed, Precipitation failed, Light/UV failed, Power booster shore power
jmissig commented 2 months ago

I know this is closed, but in case participants come across this, Weatherflow Support tells me the erroneous sensor_status still has not been fixed:

They are still looking into the issue but for now, you can just assume that it isn't correct. I do apologize about that.