AmbientWeather WS-2902A not receiving any data

I have this thing declaration:

Bridge ambientweather:bridge:account "Ambient Weather Account" [ applicationKey="e9f0********************************************************9a19", apiKey="fb1a********************************************************72bc" ] {
    Thing ws2902a 2902 "Ambient Weather WS-2902A" [ macAddress="f4:***********:5f" ]
}

and this item declaration:

Number:Temperature Ws2902a_Temperature "Temperature [%.1f %unit%]" { channel="ambientweather:ws2902a:account:2902:weatherDataWs2902a#temperature" }

The bridge/account thing says:

$ ssh myopenhab things show ambientweather:bridge:account
UID: ambientweather:bridge:account
Type: ambientweather:bridge
Label: Ambient Weather Account
Status: ONLINE

No properties

Configuration parameters:
	apiKey : fb1a********************************************************72bc
	applicationKey : e9f0********************************************************9a19

No channels

The weather station thing says:

$ ssh myopenhab things show ambientweather:ws2902a:account:2902
UID: ambientweather:ws2902a:account:2902
Type: ambientweather:ws2902a
Label: Ambient Weather WS-2902A
Status: ONLINE
Bridge: ambientweather:bridge:account

No properties

Configuration parameters:
	macAddress : f4:***********:5f

Channels:
...
	ID: weatherDataWs2902a#temperature
	Label: Temperature
	Type: ambientweather:temperature
	Description: Temperature
...

The temperature items says:

$ ssh myopenhab items list | grep -i 2902
Ws2902a_Temperature (Type=NumberItem, State=NULL, Label=Temperature, Category=null)

Basically, I’m not getting any data.

How to debug this more?

With a debug log, of course.

1 Like

Please post a debug log starting from binding startup. Enter debug mode using the console command:

log:set DEBUG org.openhab.binding.ambientweather

You can restart the binding using this console command:

bundle:restart org.openhab.binding.ambientweather
1 Like

This was very actionable advice. Thanks a lot!

$ tail -F /var/log/openhab2/*log
2020-10-15 20:27:50.577 [hingStatusInfoChangedEvent] - 'ambientweather:ws2902a:account:2902' changed from ONLINE to UNINITIALIZED

==> /var/log/openhab2/openhab.log <==
2020-10-15 20:27:50.587 [DEBUG] [handler.AmbientWeatherStationHandler] - Station WS2902A: Disposing station handler for MAC f4:***********:5f

==> /var/log/openhab2/events.log <==
2020-10-15 20:27:50.588 [hingStatusInfoChangedEvent] - 'ambientweather:ws2902a:account:2902' changed from UNINITIALIZED to OFFLINE

==> /var/log/openhab2/openhab.log <==
2020-10-15 20:27:50.588 [DEBUG] [.handler.AmbientWeatherEventListener] - Listener: Remove station handler from list: ambientweather:ws2902a:account:2902
2020-10-15 20:27:50.589 [DEBUG] [.handler.AmbientWeatherBridgeHandler] - Bridge: Station handler disposed for ambientweather:ws2902a:account:2902 with MAC f4:***********:5f

==> /var/log/openhab2/events.log <==
2020-10-15 20:27:50.591 [hingStatusInfoChangedEvent] - 'ambientweather:ws2902a:account:2902' changed from OFFLINE to UNINITIALIZED (HANDLER_MISSING_ERROR)
2020-10-15 20:27:50.591 [hingStatusInfoChangedEvent] - 'ambientweather:bridge:account' changed from ONLINE to UNINITIALIZED

==> /var/log/openhab2/openhab.log <==
2020-10-15 20:27:50.595 [DEBUG] [.handler.AmbientWeatherEventListener] - Listener: Event listener stopping
2020-10-15 20:27:50.595 [DEBUG] [.handler.AmbientWeatherEventListener] - Listener: Sending unsubscribe request
2020-10-15 20:27:50.597 [DEBUG] [.handler.AmbientWeatherEventListener] - Listener: Disconnecting socket and removing event listeners for io.socket.client.Socket@425ce613

==> /var/log/openhab2/events.log <==
2020-10-15 20:27:50.605 [hingStatusInfoChangedEvent] - 'ambientweather:bridge:account' changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
2020-10-15 20:27:50.672 [hingStatusInfoChangedEvent] - 'ambientweather:bridge:account' changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to INITIALIZING
2020-10-15 20:27:50.676 [hingStatusInfoChangedEvent] - 'ambientweather:bridge:account' changed from INITIALIZING to UNKNOWN
2020-10-15 20:27:50.677 [hingStatusInfoChangedEvent] - 'ambientweather:bridge:account' changed from UNKNOWN to OFFLINE (CONFIGURATION_ERROR): Awaiting key validation
2020-10-15 20:27:50.680 [hingStatusInfoChangedEvent] - 'ambientweather:ws2902a:account:2902' changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to INITIALIZING

==> /var/log/openhab2/openhab.log <==
2020-10-15 20:27:50.685 [DEBUG] [handler.AmbientWeatherStationHandler] - Station WS2902A: Initializing station handler for MAC f4:***********:5f
2020-10-15 20:27:50.685 [DEBUG] [handler.AmbientWeatherStationHandler] - Station WS2902A: Set station status to match bridge status: OFFLINE
2020-10-15 20:27:50.685 [DEBUG] [.handler.AmbientWeatherEventListener] - Listener: Add station handler to list: ambientweather:ws2902a:account:2902

==> /var/log/openhab2/events.log <==
2020-10-15 20:27:50.686 [hingStatusInfoChangedEvent] - 'ambientweather:ws2902a:account:2902' changed from INITIALIZING to OFFLINE

==> /var/log/openhab2/openhab.log <==
2020-10-15 20:27:50.686 [DEBUG] [.handler.AmbientWeatherBridgeHandler] - Bridge: Station handler initialized for ambientweather:ws2902a:account:2902 with MAC f4:***********:5f
2020-10-15 20:27:55.677 [DEBUG] [.handler.AmbientWeatherBridgeHandler] - Validating application and API keys
2020-10-15 20:27:55.678 [DEBUG] [.handler.AmbientWeatherBridgeHandler] - Bridge: Querying list of devices from ambient weather service
2020-10-15 20:27:55.737 [DEBUG] [.handler.AmbientWeatherBridgeHandler] - Bridge: Application and API keys are valid with 1 stations
2020-10-15 20:27:55.738 [DEBUG] [.handler.AmbientWeatherEventListener] - Listener: Event listener starting

==> /var/log/openhab2/events.log <==
2020-10-15 20:27:55.738 [hingStatusInfoChangedEvent] - 'ambientweather:bridge:account' changed from OFFLINE (CONFIGURATION_ERROR): Awaiting key validation to OFFLINE (BRIDGE_OFFLINE): Connecting to service

==> /var/log/openhab2/openhab.log <==
2020-10-15 20:27:55.738 [DEBUG] [handler.AmbientWeatherStationHandler] - Station WS2902A: Detected bridge status changed to 'OFFLINE', Update my status
2020-10-15 20:27:55.740 [DEBUG] [.handler.AmbientWeatherEventListener] - Listener: Opening connection to ambient weather service with socket io.socket.client.Socket@6ae98ef1

==> /var/log/openhab2/events.log <==
2020-10-15 20:27:55.741 [hingStatusInfoChangedEvent] - 'ambientweather:ws2902a:account:2902' changed from OFFLINE to OFFLINE (BRIDGE_OFFLINE)

==> /var/log/openhab2/openhab.log <==
2020-10-15 20:27:55.894 [DEBUG] [.handler.AmbientWeatherEventListener] - Listener: Connected! Subscribe to weather data events
2020-10-15 20:27:55.894 [DEBUG] [.handler.AmbientWeatherEventListener] - Listener: Sending subscribe request

==> /var/log/openhab2/events.log <==
2020-10-15 20:27:55.895 [hingStatusInfoChangedEvent] - 'ambientweather:bridge:account' changed from OFFLINE (BRIDGE_OFFLINE): Connecting to service to ONLINE

==> /var/log/openhab2/openhab.log <==
2020-10-15 20:27:55.895 [DEBUG] [handler.AmbientWeatherStationHandler] - Station WS2902A: Detected bridge status changed to 'ONLINE', Update my status

==> /var/log/openhab2/events.log <==
2020-10-15 20:27:55.896 [hingStatusInfoChangedEvent] - 'ambientweather:ws2902a:account:2902' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE

==> /var/log/openhab2/openhab.log <==
2020-10-15 20:27:55.945 [DEBUG] [.handler.AmbientWeatherEventListener] - Listener: Received SUBSCRIBED event
2020-10-15 20:27:55.946 [DEBUG] [.handler.AmbientWeatherEventListener] - Listener: subscribed={"method":"subscribe","devices":[{"macAddress":"F4:***********:5F","apiKey":"fb1a********************************************************72bc","lastData":{"tempf":78.3,"date":"2020-10-16T03:27:00.000Z","totalrainin":0.37,"tz":"America/Los_Angeles","feelsLikein":75.5,"lastRain":"2020-05-19T14:38:00.000Z","dewPointin":50.2,"monthlyrainin":0,"deviceId":"5eace5aa15c77a000cf1dc6a","dailyrainin":0,"solarradiation":0,"humidityin":40,"humidity":27,"maxdailygust":15.9,"uv":0,"windspeedmph":0,"winddir":33,"hourlyrainin":0,"eventrainin":0,"baromabsin":29.711,"dewPoint":41.55,"tempinf":76.3,"battout":1,"feelsLike":77.1,"dateutc":1602818820000,"windgustmph":0,"baromrelin":29.805,"weeklyrainin":0},"info":{"name":"******","coords":{"geo":{"coordinates":[-121.8,37.3],"type":"Point"},"elevation":73.91533660888672,"address":"CA, USA","location":"","coords":{"lon":-121.8,"lat":37.3}}}}]}
2020-10-15 20:27:55.947 [DEBUG] [.handler.AmbientWeatherEventListener] - Listener: Subscribed event has station: name = ******, location = null, MAC = F4:***********:5F
2020-10-15 20:27:55.948 [DEBUG] [.handler.AmbientWeatherEventListener] - Listener: Search for MAC F4:***********:5F in handlers list with 1 entries
2020-10-15 20:27:55.948 [DEBUG] [.handler.AmbientWeatherEventListener] - Listener: No handler available for event for station with MAC F4:***********:5F
2020-10-15 20:27:55.949 [DEBUG] [.handler.AmbientWeatherEventListener] - Listener: Subscribed to data events. Waiting for data...

It looks like I’m getting data, but it’s not arriving at my item.

I assume the log message “No handler available for event for station…” is meaningful here.

In PaperUI I added a link to 2 channels, but they’re disconnected, i.e. not getting any data (state=null):

$ ssh -p 8181 localhost items list | grep -i ambient
AmbientWeatherWS2902A_WeatherDataWs2902a_Temperature (Type=NumberItem, State=NULL, Label=Temperature, Category=Temperature)
AmbientWeatherWS2902A_WeatherDataWs2902a_ObservationTime (Type=DateTimeItem, State=NULL, Label=Observation Time, Category=null)

I think there’s a bug where I’m not doing a case insensitive match on the MAC address. Can you try deleting the thing, then adding it back with the MAC address using upper case letters?

Bingo! After I changed the MAC address to use upper case letters and restarted the Ambient bundle, data showed up :slight_smile:
Thank you, Mark!

Glad that sorted it out!

I submitted the fix for 3.0.