SharpTools.io Dashboard and Rule Engine

Excellent! Let us know if you have any feature requests and feel free to reach out at support@sharptools.io if you need anything.

1 Like

What weather options are available for Hubitat users with Sharp Tools? Any of the existing Hubitat weather drivers the guys have written compatible?

That's a great question. Can you share links to some of the device drivers?

The core thing the Weather Tile is looking for is the device to implement a weather attribute. That triggers the weather tile being rendered instead of a generic thing tile.

It's looking for a few key attributes:

  • weather - description of the weather/forecast [required]
  • forecastIcon - should report a Weather Underground compatible icon name [required]
  • city - replaces the device name in the top-left (location is used as a fallback)
  • temperature - numeric temperature (without units)
  • feelsLike - numeric temperature (without units)
  • wind - in MPH
  • illuminance - hidden for now
  • humidity - as a percentage (without units)
  • percentPrecip - as a percentage (without units)
  • localSunrise - time
  • localSunset - time

If I remember correctly, weather and forecastIcon are the only required attributes. The rest of the attributes are conditionally displayed based on whether or not they are implemented in the device driver.

For reference, the weather tile was originally built around the SmartWeather device and the Weather Station 2.0 community device.

Hey @josh, I just posted this over on the SharpTools forum but looks like your active here right now so I'll copy it over here...:grin:

Hi,
Thanks for supporting Hubitat! Just tried to link the app but didn’t get very far.

  • I installed the app on Hubitat and selected a few devices.
  • Went over to SharpTools and created an account
  • Click on "Manage Connections’
  • Select ‘Hubitat’
  • Select my hub “Home”
  • Wait…wait…wait…
  • Get “oops…Invalid Request” with a ‘Try again’ button

I’ve tried deleting the app from Hubitat and reloading it. Keep getting the same thing. Don’t see anyway to delete my SharpTools account, so I could reset that.

Any ideas?

Thanks for the message and sorry that things aren't working as expected. Invalid Request is usually reported directly from the remote OAuth servers. For example, I saw that in testing if I wasn't on the latest Hubitat firmware release which has the SharpTools App available.

What are you seeing in your Hubitat logs when you try to authorize things via Manage Connections from SharpTools?

Sure.

@Matthew 's driver

@bangali 's driver

@Cobra 's driver

And of course the built-in WU driver, but that one is less attractive to me because the free API keys to pull data from WU will be going away. Mine expires next year.

I'll be using Andy's (@Cobra) driver with Weewx for my own personal data and Apixu to supplement. But I have the other drivers loaded too. So if Andy needed to change something, but wasn't interested in making the necessary modifications, the other sources might be a possibility. All depends on what's needed to make it work I suppose.

Just tried to authorize again with my Hubitat log open and nothing at all happens in the log. No mention of Sharptools at all.

Sending you a PM.

1 Like

I took a quick look at the drivers and here's what I can tell from a quick code review:

  • @Matthew's driver should work with a minor modification. The driver reports the icon as a weatherIcon whereas the SharpTools tile is looking for a forecastIcon.
    • So a minor modification would be needed to copy the data from weatherIcon or condition_code into a new forecastIcon attribute and to send the event for it.
  • @bangali's driver would need a decent number of modifications, but it looks like the core data is there, it's just a matter of mapping the attributes to the expected names.
    • In addition to the mapping of data to the names (as listed in this post), the condition_code would need to be mapped into a WeatherUnderground compatible icon keys which Matthew did in his driver.
  • @Cobra's WeatherUndergroundCustom and Weewx driver would need a similar change as Matthew's in that the weatherIcon would need to be mapped to forecastIcon
    • Looking at the screenshot from his post, you might also have to map the weatherIcon to a Weather Underground icon key... the screenshot shows the URL to an image, whereas we need the icon keys like Matthew has in his driver on these lines. (eg. sunny, clear, cloudy, fog, hazy, rain, mostlycloudy, tstorms, sleet, snow)

I'll look into using the weatherIcon as a fallback for forecastIcon on my side as that should make two of the drivers compatible.

In the meantime, if you want to tweak either Matthew's driver or Cobra's driver to map the weatherIcon into a forecastIcon, you could start using the weather tile right now. :smile:

1 Like

For reference, here's the full list of icon mappings supported by the SharpTools weather tile - the left side being the Weather Underground compatible key we are looking for and the right being an internal icon mapping:

1 Like

Update... @josh got me up and running again. Seems somehow my Hubitat wasn't taking to the cloud. A second reboot after the update has fixed it. :sunglasses:

1 Like

@josh @SmartHomePrimer
Guys
I’m happy to ‘tweak’ the output from my two drivers
Currently all they do is send the icon url but I’m happy to change this
The WU icon list is easy but I’ll have to look at the apixu response to see how easy this is.

Andy

5 Likes

Added 'forecastIcon' as an attribute in version V2.0.3

3 Likes

I see what @Cobra was talking about on the APIXU condition code reference. I have a translation table that will return an equivalent WU condition_code based on the APIXU code. I will build that in tonight.

UPDATE: Updated so APIXU will use a WU condition_code for forecastIcon. New version V2.0.4

3 Likes

Nice work! Thanks for knocking it out!

Guys
I've updated my weather drivers to have the attribute forecastIcon and mapped the Apixu codes to the relevant WU codes as requested.

New version: (weewx) 2.3.0
New version:(WU) 2.7.0

@josh
I have to say though that SharpTools has a limited icon range compared to Apixu

Andy

3 Likes

Can you link to the full list? I have a wider range of weather icons that aren't being used at the time since Weather Underground didn't map to them.

Are there examples of specific conditions you would want to visually differentiate between?

Edit: You're in the UK, right? I guess I'll need a lot more variations of rain icons! :stuck_out_tongue:

2 Likes

@josh I'm new to SharpTools so I apologize if this is obvious to everyone else. I just added Andy's updated weather drivers (thank you so much for making that change @Cobra), and selecting them in the Hubitat app alone wasn't enough to make them available to add to the dashboard.

I had to go into my SharpTool account settings, and then manage connections, and then go through the authorize hub steps again. When it pulls up the list of my hub devices, I could see that the weather drivers I had just selected from the SharpTools HE app were now also selected in the list showing on SharpTool.io and then authorizing make them available to add to the dashboard.

This is a bug right? It would seem to me that if I had to do this every time, I don't need the HE app.

1 Like

Behind the scenes, when you use the Manage Connections page, it initiates an OAuth flow with Hubitat and if you don't already have the app installed it will automatically install the app. If the app is already installed, it updates the configuration with your selections. The end of that process is what kicks off the SharpTools platform to sync with Hubitat for an updated list of devices.

It's a bit like how you can change device selections for Alexa, but you still have to run discovery in the Alexa app or on your device - but I don't like that either! It's on my hitlist to have the sync process automatically kickoff whenever you update the devices locally in your Hubitat administration UI. That way you would be able to change things in either place and everything would just stay in sync!

PS. The install flow is slightly different from SmartThings, where the SmartApp could only be installed via the OAuth flow - so I see the confusion!

Edit: I went ahead and knocked this out today. Now you can edit your device selections from the SharpTools App in the Hubitat administration UI and those changes will be synced to SharpTools without having go through Manage Connections again.

Ah OK. Well I have no reference to SmartThings, but thank you for attempting to bolster my IQ :grin:

One more question, and if it's not already a known issue I'll send a note to support. Seems the wind speed doesn't follow my setting. I had @Cobra 's driver set to MPH by mistake and so I changed it to KPH, but it still shows MPH on the dashboard. I refreshed and it's the same. Removed the tile and added again, still the same. Re-authorized HE, removed the tile and then added again. Still the same.

Download the Hubitat app