AmbientWeather.net weather station binding

Ok, so I can see where it’s throwing the error in the core here caused by this. But I have no idea why. Does it only throw the error when you have the item’s unit set to something different than how the units are configured in openHAB? Totally guessing here, but I wonder if changing the item from one unit to another somehow triggers the issue. Do you see the issue even after a clean restart of openHAB?

I’ve been MIA here, but I’ll take a look at this again soon. The problem does persist through reboots though, but I can also try unloading the add on and re-adding it with my items file I’m using.
The error would come up with the mm/h or in/h but I’m not sure I tested with a reboot between changing back and forth. I’ll add that in as part of my testing.

Any chance you could look into adding support for the WS-0265 ? https://www.ambientweather.com/amws0265.html Or if there is a way for me to add this functionality myself maybe point me in the right direction?

The WS-0265 has 8 Channels, Channel 1 is temp only and is reported directly from the unit. Channel 2-8 are remotes and they report both temp as well as humidity.

I tried the WS-1400-IP as well as the WS-8482 bindings without any luck (Sensors report -NaN)

I’m running OpenHAB 2.4.0 Release

Yes I can add that station. But I won’t be able to get to it for a few days. In the meantime, can you create a WS-1400 thing, put the binding in debug mode, then post the JSON string that the binding receives from ambientweather.net? This will make it easier for me to set up all the channels correctly.

Hi Mark,
I believe this is what you are looking for?

17:35:10.279 [DEBUG] [io.socket.engineio.client.Socket     ] - socket received: type 'message', data '2["data",{"dateutc":1570829700000,"tempinf":69.3,"temp1f":57.9,"humidity1":53,"temp2f":72.5,"humidity2":42,"temp3f":68.7,"humidity3":48,"temp4f":72.1,"humidity4":40,"feelsLike1":57.9,"dewPoint1":40.9,"feelsLike2":71.4,"dewPoint2":48.1,"feelsLike3":67.5,"dewPoint3":48.2,"feelsLike4":70.9,"dewPoint4":46.4,"tz":"America/New_York","date":"2019-10-11T21:35:00.000Z","macAddress":"B4:E6:2D:xx:xx:xx"}]'
17:35:10.297 [DEBUG] [io.socket.parser.Parser              ] - decoded 2["data",{"dateutc":1570829700000,"tempinf":69.3,"temp1f":57.9,"humidity1":53,"temp2f":72.5,"humidity2":42,"temp3f":68.7,"humidity3":48,"temp4f":72.1,"humidity4":40,"feelsLike1":57.9,"dewPoint1":40.9,"feelsLike2":71.4,"dewPoint2":48.1,"feelsLike3":67.5,"dewPoint3":48.2,"feelsLike4":70.9,"dewPoint4":46.4,"tz":"America/New_York","date":"2019-10-11T21:35:00.000Z","macAddress":"B4:E6:2D:xx:xx:xx"}] as io.socket.parser.Packet@16f8f51
17:35:10.318 [DEBUG] [io.socket.client.Socket              ] - emitting event [data, {"date":"2019-10-11T21:35:00.000Z","humidity2":42,"humidity1":53,"tz":"America/New_York","feelsLike4":70.9,"tempinf":69.3,"dewPoint2":48.1,"dateutc":1570829700000,"dewPoint3":48.2,"temp4f":72.1,"dewPoint4":46.4,"macAddress":"B4:E6:2D:xx:xx:xx","temp3f":68.7,"feelsLike1":57.9,"feelsLike2":71.4,"feelsLike3":67.5,"temp2f":72.5,"humidity4":40,"temp1f":57.9,"humidity3":48,"dewPoint1":40.9}]

Looks like the built-in channel (that lacks humidity) is ‘tempinf’ and then the other sensors correctly correspond to the sensor’s channel numbers. I only have 4 remote sensors in my setup at the moment.

Thanks!

Exactly what I need. Thanks.

@shadowdognh I took a quick look at this. The WS-0265 looks very similar to the WS-8482, so I’m going to use the WS-8482 as the starting point for the WS-0265 thing definition.

I am a little surprised the WS-8482 didn’t at least partially work. Can you try adding a WS-8482 thing, then post the resulting debug log. Please show the log from the point when the binding starts, as well as when the binding receives data from ambientweather.net. The easiest way to do this is first to add the thing, then stop/start the binding.

Hi Mark,
The log seems to contain my application & API keys along with some rather specific location information so I am going to PM you the log in a couple of minutes just so that info isn’t displayed publicly.
Thanks again!

@shadowdognh I added support for the WS-0265 weather station. It has dewPoint and feelingTemperature channels for the remote sensors. After installing the new binding version, you’ll need to delete your WS-8482 thing and add a WS-0265 thing.

The new version can be found here.

Let me know if you run into any issues. If there are issues, a debug log will be helpful.

Awesome! Thank you very much! I installed it a few minutes ago and added the WS-0265 thing; I haven’t had a chance to actually go through and config it fully yet. I set up one sensor and all of the parameters that I expected to work (Temp, Humidity, Dewpoint, Heat Index), worked. I should be able to find time to configure all of the sensors in the next couple of days, when I get it all set up I’ll report back.

Sounds good. Once we confirm it’s working correctly, I’ll submit it to be part of the distribution.

Hi Mark,
My four remote sensors seem to work as expected, they correctly display Temp, Relative Humidity, Dewpoint, and Heat Index. The weather station name, location, and observation time also all work correctly.

The built in probe on the WS-0265 itself does not seem to work, it just displays “NaN”. It previously worked fine with the WS-8482 thing though. I believe it is “tempinf” in the JSON string.

I found a few minor cosmetic things that don’t really affect functionality- You may want to consider changing the name of “Feeling Temperature” to “Heat Index”. The WS-0265 does not support wind sensors so it is unable to calculate Wind Chill, this means its “feels like” temp parameter is really just the Heat Index on this model

I noticed there are some channel types available that the WS-0265 doesn’t actually support. The WS-0265 only supports Model WH31 Thermo-hygrometers, so the three soil temp channels are likely not applicable to the WS-0265. Also I tried the battery channel which just displays a hyphen. I don’t see anything in the JSON string from ambient that looks like battery status. Not sure if its only populated when a sensor battery is low or if that channel is unsupported by the WS-0265.

Here is the logging output (with info about my specific location & device/api keys & mac removed, if you need the original I can PM it to you) from the binding after running bundle:restart org.openhab.binding.ambientweather

06:39:22.728 [DEBUG] [org.openhab.binding.ambientweather   ] - BundleEvent STOPPING - org.openhab.binding.ambientweather
06:39:22.801 [DEBUG] [org.openhab.binding.ambientweather   ] - ServiceEvent UNREGISTERING - {org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory}={service.id=324, service.bundleid=203, service.scope=bundle, component.name=org.openhab.binding.ambientweather.internal.AmbientWeatherHandlerFactory, component.id=181} - org.openhab.binding.ambientweather
06:39:22.828 [DEBUG] [.handler.AmbientWeatherStationHandler] - Station WS0265: Disposing station handler for MAC B4:E6:2D:xx:xx:xx
06:39:22.838 [DEBUG] [l.handler.AmbientWeatherEventListener] - Listener: Remove station handler from list: ambientweather:ws0265:9631e90c
06:39:22.841 [DEBUG] [l.handler.AmbientWeatherBridgeHandler] - Bridge: Station handler disposed for ambientweather:ws0265:9631e90c with MAC B4:E6:2D:xx:xx:xx
06:39:22.858 [DEBUG] [l.handler.AmbientWeatherEventListener] - Listener: Event listener stopping
06:39:22.860 [DEBUG] [l.handler.AmbientWeatherEventListener] - Listener: Sending unsubscribe request
06:39:22.863 [DEBUG] [l.handler.AmbientWeatherEventListener] - Listener: Disconnecting socket and removing event listeners for io.socket.client.Socket@fb48d7
06:39:22.898 [DEBUG] [org.openhab.binding.ambientweather   ] - BundleEvent STOPPED - org.openhab.binding.ambientweather
06:39:22.902 [DEBUG] [org.openhab.binding.ambientweather   ] - BundleEvent STARTING - org.openhab.binding.ambientweather
06:39:22.907 [DEBUG] [org.openhab.binding.ambientweather   ] - BundleEvent STARTED - org.openhab.binding.ambientweather
06:39:22.937 [DEBUG] [org.openhab.binding.ambientweather   ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory}={service.id=417, service.bundleid=203, service.scope=bundle, component.name=org.openhab.binding.ambientweather.internal.AmbientWeatherHandlerFactory, component.id=262} - org.openhab.binding.ambientweather
06:39:23.094 [DEBUG] [.handler.AmbientWeatherStationHandler] - Station WS0265: Initializing station handler for MAC B4:E6:2D:xx:xx:xx
06:39:23.097 [DEBUG] [.handler.AmbientWeatherStationHandler] - Station WS0265: Set station status to match bridge status: OFFLINE
06:39:23.101 [DEBUG] [l.handler.AmbientWeatherEventListener] - Listener: Add station handler to list: ambientweather:ws0265:9631e90c
06:39:23.105 [DEBUG] [l.handler.AmbientWeatherBridgeHandler] - Bridge: Station handler initialized for ambientweather:ws0265:9631e90c with MAC B4:E6:2D:xx:xx:xx
06:39:28.077 [DEBUG] [l.handler.AmbientWeatherBridgeHandler] - Validating application and API keys
06:39:28.082 [DEBUG] [l.handler.AmbientWeatherBridgeHandler] - Bridge: Querying list of devices from ambient weather service
06:39:28.627 [DEBUG] [l.handler.AmbientWeatherBridgeHandler] - Bridge: Application and API keys are valid with 1 stations
06:39:28.632 [DEBUG] [l.handler.AmbientWeatherEventListener] - Listener: Event listener starting
06:39:28.633 [DEBUG] [.handler.AmbientWeatherStationHandler] - Station WS0265: Detected bridge status changed to 'OFFLINE', Update my status
06:39:28.640 [DEBUG] [l.handler.AmbientWeatherEventListener] - Listener: Opening connection to ambient weather service with socket io.socket.client.Socket@1be24dc
06:39:29.205 [DEBUG] [l.handler.AmbientWeatherEventListener] - Listener: Connected! Subscribe to weather data events
06:39:29.213 [DEBUG] [l.handler.AmbientWeatherEventListener] - Listener: Sending subscribe request
06:39:29.216 [DEBUG] [.handler.AmbientWeatherStationHandler] - Station WS0265: Detected bridge status changed to 'ONLINE', Update my status
06:39:29.350 [DEBUG] [l.handler.AmbientWeatherEventListener] - Listener: Received SUBSCRIBED event
06:39:29.356 [DEBUG] [l.handler.AmbientWeatherEventListener] - Listener: subscribed={"method":"subscribe","devices":[{"macAddress":"B4:E6:2D:xx:xx:xx","apiKey":"0000000000000000000000000000000000000000000000000000000000000000","lastData":{"date":"2019-10-18T10:39:00.000Z","humidity2":42,"humidity1":78,"tz":"America/New_York","feelsLike4":77.4,"tempinf":72,"deviceId":"000000000000000000000000","dewPoint2":47.9,"dateutc":1571395140000,"dewPoint3":50.1,"temp4f":78.1,"dewPoint4":51.1,"temp3f":72,"feelsLike1":47.8,"feelsLike2":71.2,"feelsLike3":71.1,"temp2f":72.3,"humidity4":39,"temp1f":47.8,"humidity3":46,"dewPoint1":41.3},"info":{"name":"CityName","location":"Home","coords":{"geo":{"coordinates":[-71.00000000000000,42.000000000000000],"type":"Point"},"elevation":81.8635482788086,"address":"1234 Road Lane, Cityname, NH 03000, USA","location":"CityName","coords":{"lon":-71.00000000000000,"lat":42.000000000000000}}}}]}
06:39:29.367 [DEBUG] [l.handler.AmbientWeatherEventListener] - Listener: Subscribed event has station: name = CityName, location = Home, MAC = B4:E6:2D:xx:xx:xx
06:39:29.371 [DEBUG] [l.handler.AmbientWeatherEventListener] - Listener: Search for MAC B4:E6:2D:xx:xx:xx in handlers list with 1 entries
06:39:29.375 [DEBUG] [l.handler.AmbientWeatherEventListener] - Listener: Found handler for ambientweather:ws0265:9631e90c with MAC B4:E6:2D:xx:xx:xx
06:39:29.379 [DEBUG] [.handler.AmbientWeatherStationHandler] - Station WS0265: Update name=CityName and location=Home for MAC B4:E6:2D:xx:xx:xx
06:39:29.388 [DEBUG] [l.handler.AmbientWeatherEventListener] - Listener: Subscribed to data events. Waiting for data...
06:40:13.648 [DEBUG] [l.handler.AmbientWeatherEventListener] - Listener: Received DATA event
06:40:13.655 [DEBUG] [l.handler.AmbientWeatherEventListener] - Listener: Data: {"date":"2019-10-18T10:40:00.000Z","humidity2":42,"humidity1":78,"tz":"America/New_York","feelsLike4":77.7,"tempinf":72,"dewPoint2":48.1,"dateutc":1571395200000,"dewPoint3":50.2,"temp4f":78.3,"dewPoint4":51.3,"macAddress":"B4:E6:2D:xx:xx:xx","temp3f":72.1,"feelsLike1":48,"feelsLike2":71.4,"feelsLike3":71.2,"temp2f":72.5,"humidity4":39,"temp1f":48,"humidity3":46,"dewPoint1":41.5}
06:40:13.661 [DEBUG] [l.handler.AmbientWeatherEventListener] - Listener: Search for MAC B4:E6:2D:xx:xx:xx in handlers list with 1 entries
06:40:13.665 [DEBUG] [l.handler.AmbientWeatherEventListener] - Listener: Found handler for ambientweather:ws0265:9631e90c with MAC B4:E6:2D:xx:xx:xx
06:40:13.673 [DEBUG] [.handler.AmbientWeatherStationHandler] - Station WS0265: Processing data event for MAC B4:E6:2D:xx:xx:xx
06:40:13.679 [DEBUG] [er.internal.processor.Ws0265Processor] - Station WS0265: Parsing weather data event json

Thanks again!

Hmm. Not sure why it’s not working, but I have a couple theories. I’ll take a look, but I might not get to it for a couple days.

I used feelingTemperature for the channel name because that’s what Ambient Weather calls that value in the API. In the API, the naming is consistent across all weather station models.

The remote sensor group includes channels for all the values supported by Ambient Weather sensor. I thought about making those channels dynamic, but it hasn’t made it too far up my priority list yet. So, if there’s no value for a channel it usually means the sensor doesn’t support that channel.

In the case of the battery channel, the API isn’t returning those values. Check your ambientweather.net dashboard to see if it’s showing the battery condition. If the dashboard shows the battery condition, then it could be the case that the API is just not returning it. If that’s the case, we could make a support request to Ambient to have the battery condition returned in the API.

I think I see what’s wrong with the temp. I’ll post a new version in a few minutes.

I just posted a new version with the fix. Let me know if it resolves the problem.

That fixed the issue, the built in sensor now displays the correct temp! Thank you!

I figured that was the reasoning, I just wanted to mention it because I wasn’t sure how model specific you were trying to make each Thing within the binding.

I checked, there is nothing about battery status on my ambientweather.net dashboard. Guess the WS-0265 doesn’t support it.

Thank you again for all of your hard work on this!

Great. I love when the fixes are easy…

I’ll hold off until Sunday or Monday to push the fix. Let me know if you run into any other issues.

1 Like

Hi,

I am looking for an Ambient Weather binding for the WS-50.

Any chance?

TIA for all your hard work.

I’m not too familiar with this station. Can you add your station as a WS-1400 thing, then put the binding in debug mode. Post the JSON string that’s returned by ambient weather. I’ll take a look at how hard it’ll be to add support for this station.

Thx for your prompt reply.

I am waiting to get my WS-50 and remote sensors in the next day or two.
I will post the info you requested ASAP.