[SOLVED] Weatherflow Smart Weather Station binding

Hello ,
is there also a version for OH3 available? @hww3

There is a trigger that will cause a rule to run when a precipitation start message is received. You just need to create a new rule (such as from the Rules section in PaperUI) and select that trigger from the list (itā€™s the first thing you select when creating a rule). What the rule does when the trigger fires is up to you!

I have not started to use OpenHAB 3 yet. Itā€™s possible a simple recompile using the new version 3 project is all thatā€™s required, but I canā€™t say at the moment.

@hww3 Can you release the source on GitHub ? So that some other can do it because I am using already OH3 and like to use also this binding. Is there any background why not releasing it to the official add-on repository?

A link to the source repository is a few messages above in this thread.

I only have a limited amount of time to work on this code, and getting it accepted would be a fairly time consuming effort. OH3 is still changing considerably and Iā€™d prefer to port the code once things have settled down rather than chase a moving target.

For those wanting to get their Tempest weather station working in OH3. This is the method I used and it works perfectly.

  1. Initial device setup on https://tempestwx.com/
  2. Setup an account on https://www.wunderground.com/ add your station to the devices section. This will give you a code that you can enter in https://tempestwx.com/
  3. Go back to https://www.wunderground.com/ and check the weather station is online in the devices section.
  4. Go to the API Keys section and create the key (expires every 6 months which is disappointing)
  5. Install the Weather Company Binding and add the account thing and copy the API key into it, add the other things and thatā€™s it!

Works perfectly:

1 Like

I guess thatā€™s a workaround but Iā€™d much prefer being able to get the data directly from the hub connected to my local network rather than via two cloud platforms.

Iā€™m running the older Weatherflow hub and stations and am happy to hold off upgrading to OH3 until Billā€™s binding supports it.

1 Like

Correct and I would prefer a local method too but this works for me in the meantime.

A sacrifice I was willing to make to run the much improved OH3.

1 Like

Hello all-

Iā€™ve put together an initial release of the Weatherflow Smart Weather binding for OpenHAB 3.0. I havenā€™t tested all functionality but Hub and Air things seem to be working fine (my Sky is currently down).

Please have a look and let me know if you run into any problems!

Bill

https://bitbucket.org/hww3/org.openhab.binding.weatherflowsmartweather/downloads/org.openhab.binding.weatherflowsmartweather-3.1.0-SNAPSHOT.jar

1 Like

Fantastic! I have tested and it is working with OpenHAB 3.0.1 :slight_smile:

I wonder is it possible to change wind speed to m/s instead of km/h? And wind direction to cardinal instead of degrees? like north, east, west etc.?

Hi!

All of the measurements are sent out of the binding using the SI units conventionally used for weather measurements. Is it possible that the user interface you are using is converting that to km/h incorrectly? Iā€™m guessing the m/s measurements are being automatically switched to km/h, which I would imagine is a ā€œstandardā€ default for speed.

Iā€™ve tried to provide data from this binding thatā€™s as close to what the various sensors report as possible, and so Iā€™d prefer not to convert the direction value to cardinal directions. However, I wrote a binding called Weather Calculations that takes raw sensor data and generates a number of useful derived values. Adding cardinal direction support is something Iā€™ve been meaning to add, but no one has asked for itā€¦ until now.

I might take a little time this weekend to add that. You might also be able to create an item that transforms the numeric angle to a cardinal direction if you donā€™t want to mess with that binding. If you follow that thread, Iā€™ll post an update there when I add the new feature.

I added cardinal direction calculation to the WeatherCalculations binding. Please feel free to check it out from the link in the previous post!

Also, to expand on the units of measurement problem you mentioned, it might be worth opening a bug/feature request to permit quantity item types to be configured on a case by case basis, in order to override the automatic selection of alternate units.

Iā€™ve noticed a similar (but opposite) problem with respect to dates: the UI displays DateTime items with zone information using the zone associated with the item value, rather than the zone/location configured in OpenHAB. This causes jarring results like having a clock cell (which shows the current time zone) displayed next to a time in UTCā€¦ seems like this could be better, too! :slight_smile:

Thank you for the update.

I have tested the new .jar but I cant get the wind direction to work. In the log I can find those messages.

2021-02-10 19:54:17.486 [INFO ] [s.handler.WeatherCalculationsHandler] - Item <SmartWeatherTempest_WindDirection> changed to 281.0 Ā°
2021-02-10 19:54:17.488 [WARN ] [ab.core.internal.events.EventHandler] - Dispatching/filtering event for subscriber 'org.openhab.core.events.EventSubscriber' failed: Rounding necessary
java.lang.ArithmeticException: Rounding necessary
	at java.math.BigDecimal.commonNeedIncrement(BigDecimal.java:4621) ~[?:?]
	at java.math.BigDecimal.needIncrement(BigDecimal.java:4677) ~[?:?]
	at java.math.BigDecimal.divideAndRound(BigDecimal.java:4585) ~[?:?]
	at java.math.BigDecimal.setScale(BigDecimal.java:2891) ~[?:?]
	at java.math.BigDecimal.setScale(BigDecimal.java:2951) ~[?:?]
	at org.openhab.binding.weathercalculations.utils.WeatherUtils.getHeadingString(WeatherUtils.java:272) ~[?:?]
	at org.openhab.binding.weathercalculations.handler.WeatherCalculationsHandler.eventReceived(WeatherCalculationsHandler.java:378) ~[?:?]
	at org.openhab.binding.weathercalculations.internal.WeatherCalculationsEventSubscriberImpl.receiveTypedEvent(WeatherCalculationsEventSubscriberImpl.java:77) ~[?:?]
	at org.openhab.binding.weathercalculations.internal.WeatherCalculationsEventSubscriberImpl.receiveTypedEvent(WeatherCalculationsEventSubscriberImpl.java:1) ~[?:?]
	at org.openhab.core.events.AbstractTypedEventSubscriber.receive(AbstractTypedEventSubscriber.java:57) ~[bundleFile:?]
	at org.openhab.core.internal.events.EventHandler.lambda$0(EventHandler.java:151) [bundleFile:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.lang.Thread.run(Thread.java:834) [?:?]

Well, thatā€™s pretty odd. I added 281.0 and 281 to the test suite and it doesnā€™t seem to trigger that problem.

What version of the jdk are you running and on what platform? The output of java -version and uname -a (assuming youā€™re not using windows) might help track the problem down.

Bill

Okay, see below. I am running OpenHabian on a Raspian Pi 4 Model B

$ java -version
openjdk version "11.0.10" 2021-01-19 LTS
OpenJDK Runtime Environment Zulu11.45+27-CA (build 11.0.10+9-LTS)
OpenJDK Client VM Zulu11.45+27-CA (build 11.0.10+9-LTS, mixed mode)
$ uname -a
Linux openhab4 5.10.11-v7l+ #1399 SMP Thu Jan 28 12:09:48 GMT 2021 armv7l GNU/Linux

Itā€™s possible that thereā€™s a platform specific rounding difference. Iā€™ve added some rounding instruction to the code and posted a new version. Can you download it and see if the problem moves or goes away?

Now its looks better. windDirection=308.0 Ā° is translated to NW :slight_smile:

1 Like

About wind speed and m/s. I have found out that I can specify pattern m/s on an items metadata to get translation from km/h to m/s like %.2f m/s. In code it looks like below.

value: " "
config:
  pattern: "%.2f m/s"
1 Like

Hi @hww3
I posted last week and think you replied but our posts got lost in the forum glitch.
I think you said your hub and devices were found automatically after dropping the jar in the addons folder.
Mine arenā€™t adding automatically, Iā€™m afraid.
I tried to create them manually, but seem to have the config incorrect.
I donā€™t suppose youā€™d look at your ā€˜Codeā€™ tab and let me know how it looks in comparison with this?

UID: weatherflowsmartweather:hub:9d1be80a1f
label: SmartWeather Hub
thingTypeUID: weatherflowsmartweather:hub
configuration:
  serial_number: Serial_Here

Also, are there any add on bindings or anything else I need to add to make it work perhaps? A required add-on that isnā€™t shipped as default with OH3??

Thanks for any help!

Hi Mark-

I started with a completely fresh 3.0 install. I installed the smart weather binding and everything was detected in a minute. Important to mention that the devices are on the same network as my openhab install.

Hereā€™s the ā€œcodeā€ segment from my hub and air devices (the sky is offline because itā€™s buried in snow!):

UID: weatherflowsmartweather:hub:HB-00004550
label: SmartWeather Hub
thingTypeUID: weatherflowsmartweather:hub
configuration: {}

The air:

UID: weatherflowsmartweather:air:HB-00004550:AR-00002652
label: SmartWeather Air
thingTypeUID: weatherflowsmartweather:air
configuration: {}
bridgeUID: weatherflowsmartweather:hub:HB-00004550

Hopefully this helps provide some insightā€¦ please post back if that does/doesnā€™t work and hopefully we can figure something out.

Bill