diff --git a/README.md b/README.md new file mode 100644 index 0000000..666ddf4 --- /dev/null +++ b/README.md @@ -0,0 +1,101 @@ +# Features +1. Graphing via [Google Charts](https://developers.google.com/chart) API + - Line, Bar, Area, Time Line + - Gauges +2. Weather Conditions and Forecast via PWS or OpenWeather + - Fully Configurable Sub-tiles +3. Displaying graphs on a dashboard + - Automatic child device ( [Hubigraph Tile Device](https://github.com/tchoward/Hubitat/blob/master/hubigraph_tile.groovy) ) creation + - Add to dashboard via Graph attribute on an Attribute Tile +4. Support for all devices on Hub +5. Graph Configuration Support + - Colors - (Titles, Labels, Lines, Axes, Backgrounds, etc) + - Font Size - (Titles, Labels, Axes, etc) + - Axes - (Location, Single/Dual, Number Tics, etc) +6. Hubigraph Tile Device + - Auto install/uninstall child device with Graph Attributes +7. Real-time, Periodic Graph Updates + - Real-time updates support sub-second updates + - Periodic updates to reduce browser loading + +# INSTALLATION +Due to the large number of files and the complexity involved to manually install HubiGraphs, I recommend using [HUBITAT PACKAGE MANAGER](https://community.hubitat.com/t/beta-hubitat-package-manager/38016) for install. + +## LINKS +- [GITHUB REPOSITORY](https://github.com/tchoward/Hubitat) +- [HUBITAT PACKAGE MANAGER](https://community.hubitat.com/t/beta-hubitat-package-manager/38016) + +## EXAMPLES AND SCREENSHOTS +### Time Graph with Overlay +[![Time Graph with Overlay](https://community.hubitat.com/uploads/default/optimized/3X/4/c/4c400721082e8bf7dbe140dfc03f0b82dacb26e4_2_1380x912.jpeg "Time Graph with Overlay")](https://community.hubitat.com/uploads/default/original/3X/4/c/4c400721082e8bf7dbe140dfc03f0b82dacb26e4.jpeg) + +### Time Graph (Bar and Points) +[![Time Graph (Bar and Points)](https://community.hubitat.com/uploads/default/optimized/3X/c/3/c3afed7a04f92b5b02eedb384d6aa2bddf1de726_2_1380x894.jpeg "Time Graph (Bar and Points)")](https://community.hubitat.com/uploads/default/original/3X/c/3/c3afed7a04f92b5b02eedb384d6aa2bddf1de726.jpeg) + +### TimeLine Showing Motion +[![TimeLine Showing Motion](https://community.hubitat.com/uploads/default/optimized/3X/6/8/68e6208fffc8730510eeb3e4919dbbc7f7f064f5_2_1380x776.jpeg "TimeLine Showing Motion")](https://community.hubitat.com/uploads/default/original/3X/6/8/68e6208fffc8730510eeb3e4919dbbc7f7f064f5.jpeg) + +### Heat Map +[![Heat Map](https://community.hubitat.com/uploads/default/original/3X/2/6/26e485929235e743c1a39778c409e43b856ad8c5.jpeg "Heat Map")](https://community.hubitat.com/uploads/default/original/3X/2/6/26e485929235e743c1a39778c409e43b856ad8c5.jpeg) + +### Weather Tile 2.0 +[![Weather Tile 2.0](https://community.hubitat.com/uploads/default/optimized/3X/a/6/a6428c650f4ed26494bd058d60ecc3448242ff0b_2_864x1000.jpeg "Weather Tile 2.0")](https://community.hubitat.com/uploads/default/original/3X/a/6/a6428c650f4ed26494bd058d60ecc3448242ff0b.jpeg) + +### Radar Tile +[![Radar Tile](https://community.hubitat.com/uploads/default/original/3X/1/f/1f744ec7fbef685484045a9cc8365f19bf99761c.jpeg "Radar Tile")](https://community.hubitat.com/uploads/default/original/3X/1/f/1f744ec7fbef685484045a9cc8365f19bf99761c.jpeg) + +### Time Graph with Bars +[![Time Graph with Bars](https://community.hubitat.com/uploads/default/original/3X/b/0/b075a5a2421e23127953dd771b585062fe6d4c36.jpeg "Time Graph with Bars")](https://community.hubitat.com/uploads/default/original/3X/b/0/b075a5a2421e23127953dd771b585062fe6d4c36.jpeg) + +[![Time Graph with Bars](https://community.hubitat.com/uploads/default/optimized/3X/f/c/fcac0a34ed34c948fc9a588095150ee63ad070f9_2_990x1000.jpeg "Time Graph with Bars")](https://community.hubitat.com/uploads/default/original/3X/f/c/fcac0a34ed34c948fc9a588095150ee63ad070f9.jpeg) + +### Range Graph +[![Range Graph](https://community.hubitat.com/uploads/default/optimized/3X/5/f/5f6317b6a91a45749c3d9dc82ffef6d1ebb450f6_2_1150x1000.jpeg "Range Graph")](https://community.hubitat.com/uploads/default/original/3X/5/f/5f6317b6a91a45749c3d9dc82ffef6d1ebb450f6.jpeg) + +[![Range Graph](https://community.hubitat.com/uploads/default/original/3X/e/1/e1697477a4b66e667b1d293f03cb1007a9ddf4bc.jpeg "Range Graph")](https://community.hubitat.com/uploads/default/original/3X/e/1/e1697477a4b66e667b1d293f03cb1007a9ddf4bc.jpeg) + +[![Range Graph](https://community.hubitat.com/uploads/default/optimized/3X/c/d/cd6dce86f8ac8f9abb57c7628cfc1aab3bc4d17f_2_1380x808.jpeg "Range Graph")](https://community.hubitat.com/uploads/default/original/3X/c/d/cd6dce86f8ac8f9abb57c7628cfc1aab3bc4d17f.jpeg) + +### Gauges +[![Gauges](https://community.hubitat.com/uploads/default/original/3X/6/f/6f3936597ac2867531feb6f216f9667ec55e378d.jpeg "Gauges")](https://community.hubitat.com/uploads/default/original/3X/6/f/6f3936597ac2867531feb6f216f9667ec55e378d.jpeg) + +## DESIGN +It is important to understand the design of Hubigraphs in order to grasp both the advantages and the limitations of Hubigraphs. + +1. Hubigraphs is designed to work on a dashboard. As such, when you load (or refresh) a dashboard, the "tile" queries the database for all events covering the graph's time period. This can be thousands of events (depending on your device). To be clear, it can take 20-30 seconds for the initial loading. That is the bad news. +2. Hubigraphs does not add any loading to the Hubitat Hub. Once a dashboard is loaded, the graphs update using the same endpoint as the dashboard. Therefore, all updates from that point forward DO NOT add any load to Hubitat, it is all on the device that is displaying the dashboard. +3. Hubigraphs uses [Google Charts](https://developers.google.com/chart) Therefore, all the limitations, advantages and ease/difficulty of use is inherited from Google Charts. In the alpha build, I tried to incorporate as many options as possible (axes, labels, titles, etc). Some people have asked for features that to be blunt would require designing and implementing my own graphing API. +4. Hubigraphs was designed to work without external devices. I enjoy playing around with [Grafana](https://grafana.com/), [Influxdb](https://www.influxdata.com/), and other technologies, but it has required too much maintenance and configuration. I designed Hubigraphs only within the confines of Hubitat (user apps, dashboard, etc). I have no plans to support other platforms (SharpTools, and other third party dashboards at this time). Do I care if you "steal" my code, modify it, and add native support for those platforms? Not at all (see my FAQ). + +# FAQ +1. **"Your idea is stupid and slow and I don't like it"** +Don't use the app + +2. **"Your app is crashing my Hub. I submitted a support ticket"** +Don't do that, the fine folks at hubitat do not maintain the app. This software is given free of charge with no support. + +3. **"The latest update broke the app, FIX IT".** +I do this for fun, please don't make it un-fun. + +4. **"I have a great idea for a feature".** +Go ahead and post it, I might get around to it... + +5. **"You ignored my great idea".** +See #2 + +6. **"I hate you for getting my hopes up, your app is awful/buggy/stupid".** +Ok + +7. **"Please fix your app, it's broken".** +All cards on the table, I built this app for my wife. I will continue to support and provide updates as long as she uses it. + +8. **"I stole your code and made it soooo much better" Thanks. Please post it so I can start using it. + +9. **"You are awfully sarcastic, I don't like you".** +I have teenagers. + +10. **"You stole the "Hubi" name, your app doesn't deserve it."** +My daughter came up with it. If the hubitat owners object, I will change it. + +11. **"Your latest fix made things worse."** +I already covered this and See #9 diff --git a/WeatherTile.js b/WeatherTile.js index 518225c..4eed2e4 100644 --- a/WeatherTile.js +++ b/WeatherTile.js @@ -837,7 +837,7 @@ function setPressure(val) { } function getWeather() { - const url = `https://api.openweathermap.org/data/2.5/onecall?lat=`+latitude+`&lon=`+longitude+`&exclude=minutely&appid=`+tile_key+`&units=imperial`; + const url = `https://api.openweathermap.org/data/3.0/onecall?lat=`+latitude+`&lon=`+longitude+`&exclude=minutely,hourly,daily,alerts&appid=`+tile_key+`&units=imperial`; let now = new Date(); let tempUnits = "fahrenheit"; @@ -901,7 +901,7 @@ function getWeather() { let secs = now.getTime() / 1000.0 secs = secs.toFixed(); - const url2 = `https://api.openweathermap.org/data/2.5/onecall/timemachine?lat=`+latitude+`&lon=`+longitude+`&dt=`+secs+`&appid=`+tile_key; + const url2 = `https://api.openweathermap.org/data/3.0/onecall/timemachine?lat=`+latitude+`&lon=`+longitude+`&dt=`+secs+`&appid=`+tile_key; fetch(url2) .then(response => response.json()) @@ -1061,7 +1061,7 @@ function setForecastTile(weather) { function getWeeklyForecastWeather() { - const url = `https://api.openweathermap.org/data/2.5/onecall?lat=`+latitude+`&lon=`+longitude+`&exclude=minutely&appid=`+tile_key+`&units=imperial`; + const url = `https://api.openweathermap.org/data/3.0/onecall?lat=`+latitude+`&lon=`+longitude+`&exclude=minutely,hourly,daily,alerts&appid=`+tile_key+`&units=imperial`; let now = new Date(); console.log("OpenWeather Data Refresh at " + now.toLocaleString()); diff --git a/hubigraph_gauge.groovy b/hubigraph_gauge.groovy index 3359aab..462b89f 100644 --- a/hubigraph_gauge.groovy +++ b/hubigraph_gauge.groovy @@ -1,7 +1,7 @@ /** - * Hubigraph Timeline Child App + * Hubigraph Gauge Child App * - * Copyright 2020, but let's behonest, you'll copy it + * Copyright 2020, but let's be honest, you'll copy it * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at: @@ -155,11 +155,7 @@ def graphSetupPage(){ container << parent.hubiForm_text_input (this, "Gauge Title", "gauge_title", "Gauge Title", false); container << parent.hubiForm_text_input (this, "Gauge Units", "gauge_units", "Units", false); container << parent.hubiForm_text_input (this, "Gauge Number Formatting
Example", "gauge_number_format", "##.#", false); - - - container << parent.hubiForm_slider (this, title: "Select Number of Highlight Areas on Gauge", name: "num_highlights", default_value: 3, min: 0, max: 3, units: " highlights", submit_on_change: true); - parent.hubiForm_container(this, container, 1); } @@ -170,20 +166,19 @@ def graphSetupPage(){ num_ = num_highlights.toInteger(); } - if (num_ > 0){ parent.hubiForm_section(this,"HighLight Regions", 1){ container = []; - for (i=0; i + sendEvent(name: k, value: v); + } + state.weatherData = weatherData.current; + //state.weatherData = resp.data; } } String getWeatherData(){ return state.weatherData; } - - + \ No newline at end of file diff --git a/packageManifest.json b/packageManifest.json index 4b175c9..21761d9 100644 --- a/packageManifest.json +++ b/packageManifest.json @@ -1,15 +1,16 @@ { "packageName": "HubiGraphs", "author": "Thomas Howard", - "version": "4.90", + "co-maintainer": "Bucs-Fan", + "version": "4.91", "minimumHEVersion": "0.0", - "dateReleased": "2021-03-28", + "dateReleased": "2024-09-27", "apps": [ { "id": "8707a4e2-785d-4916-acd7-749a0ed10d7c", "name": "Hubigraphs", "namespace": "tchoward", - "location": "https://raw.githubusercontent.com/tchoward/Hubitat/master/hubigraphs.groovy", + "location": "https://raw.githubusercontent.com/bucs-fan813/Hubitat/master/hubigraphs.groovy", "required": true, "oauth": false }, @@ -17,7 +18,7 @@ "id": "027b6424-ea31-4f28-9eb4-9e117cf650ef", "name": "Hubigraph Line Graph", "namespace": "tchoward", - "location": "https://raw.githubusercontent.com/tchoward/Hubitat/master/hubigraph_line_graph.groovy", + "location": "https://raw.githubusercontent.com/bucs-fan813/Hubitat/master/hubigraph_line_graph.groovy", "required": true, "oauth": true }, @@ -25,7 +26,7 @@ "id": "e0706d77-175c-4aa7-9972-317dcbefe19c", "name": "Hubigraph Gauge", "namespace": "tchoward", - "location": "https://raw.githubusercontent.com/tchoward/Hubitat/master/hubigraph_gauge.groovy", + "location": "https://raw.githubusercontent.com/bucs-fan813/Hubitat/master/hubigraph_gauge.groovy", "required": true, "oauth": true }, @@ -33,7 +34,7 @@ "id": "b2ba592b-4ad2-473f-b5a7-378cc6972535", "name": "Hubigraph Time Line", "namespace": "tchoward", - "location": "https://raw.githubusercontent.com/tchoward/Hubitat/master/hubigraph_time_line.groovy", + "location": "https://raw.githubusercontent.com/bucs-fan813/Hubitat/master/hubigraph_time_line.groovy", "required": true, "oauth": true }, @@ -41,7 +42,7 @@ "id": "a30ad8f9-b027-41ae-ba4d-efe5d19aad24", "name": "Hubigraph Range Bar", "namespace": "tchoward", - "location": "https://raw.githubusercontent.com/tchoward/Hubitat/master/hubigraph_range_bar.groovy", + "location": "https://raw.githubusercontent.com/bucs-fan813/Hubitat/master/hubigraph_range_bar.groovy", "required": true, "oauth": true }, @@ -49,7 +50,7 @@ "id": "2f853243-ba9e-4335-92dd-1edb4cac7abe", "name": "Hubigraph Bar Graph", "namespace": "tchoward", - "location": "https://raw.githubusercontent.com/tchoward/Hubitat/master/hubigraph_bar_graph.groovy", + "location": "https://raw.githubusercontent.com/bucs-fan813/Hubitat/master/hubigraph_bar_graph.groovy", "required": true, "oauth": true }, @@ -57,7 +58,7 @@ "id": "9d94d8af-e592-4896-87cf-661ebcfee7f9", "name": "Hubigraph Time Graph", "namespace": "tchoward", - "location": "https://raw.githubusercontent.com/tchoward/Hubitat/master/hubigraph_time_graph.groovy", + "location": "https://raw.githubusercontent.com/bucs-fan813/Hubitat/master/hubigraph_time_graph.groovy", "required": true, "oauth": true }, @@ -65,7 +66,7 @@ "id": "55bbc20d-6a40-4744-bfc4-c4903a99ff85", "name": "Hubigraph Heat Map", "namespace": "tchoward", - "location": "https://raw.githubusercontent.com/tchoward/Hubitat/master/hubigraph_heat_map.groovy", + "location": "https://raw.githubusercontent.com/bucs-fan813/Hubitat/master/hubigraph_heat_map.groovy", "required": true, "oauth": true }, @@ -73,7 +74,7 @@ "id": "80af7b8b-3c75-44c4-a036-7f6e0d4a0361", "name": "Hubigraph Weather Tile", "namespace": "tchoward", - "location": "https://raw.githubusercontent.com/tchoward/Hubitat/master/hubigraph_weather_tile.groovy", + "location": "https://raw.githubusercontent.com/bucs-fan813/Hubitat/master/hubigraph_weather_tile.groovy", "required": true, "oauth": true }, @@ -81,7 +82,7 @@ "id": "d226575e-1b10-4ef9-b835-66fbf07b9b3e", "name": "Hubigraph Forecast Tile", "namespace": "tchoward", - "location": "https://raw.githubusercontent.com/tchoward/Hubitat/master/hubigraph_forecast_tile.groovy", + "location": "https://raw.githubusercontent.com/bucs-fan813/Hubitat/master/hubigraph_forecast_tile.groovy", "required": true, "oauth": true }, @@ -89,7 +90,7 @@ "id": "ddd76acc-76d2-4cad-83e4-0071049fd9c8", "name": "Hubigraph Radar Tile", "namespace": "tchoward", - "location": "https://raw.githubusercontent.com/tchoward/Hubitat/master/hubigraph_radar_tile.groovy", + "location": "https://raw.githubusercontent.com/bucs-fan813/Hubitat/master/hubigraph_radar_tile.groovy", "required": true, "oauth": true }, @@ -97,7 +98,7 @@ "id": "e7e04f39-d3fe-4339-b4a7-9ca14f3c1bab", "name": "Hubigraph Weather Tile 2", "namespace": "tchoward", - "location": "https://raw.githubusercontent.com/tchoward/Hubitat/master/hubigraph_weather_tile2.groovy", + "location": "https://raw.githubusercontent.com/bucs-fan813/Hubitat/master/hubigraph_weather_tile2.groovy", "required": true, "oauth": true }, @@ -105,7 +106,7 @@ "id": "d4bd3e09-eb98-4a13-9f75-1671c28626f5", "name": "Hubigraph Long Term Storage", "namespace": "tchoward", - "location": "https://raw.githubusercontent.com/tchoward/Hubitat/master/hubigraph_long_term_storage.groovy", + "location": "https://raw.githubusercontent.com/bucs-fan813/Hubitat/master/hubigraph_long_term_storage.groovy", "required": true } ], @@ -114,14 +115,14 @@ "id": "0e142b8f-b61e-409d-9a70-a866036693fa", "name": "Hubigraph Tile Device", "namespace": "tchoward", - "location": "https://raw.githubusercontent.com/tchoward/Hubitat/master/hubigraph_tile.groovy", + "location": "https://raw.githubusercontent.com/bucs-fan813/Hubitat/master/hubigraph_tile.groovy", "required": true }, { "id": "cb57804c-48dc-4935-b0d3-ed698bb28bf9", "name": "Hubigraph OpenWeather Device", "namespace": "tchoward", - "location": "https://raw.githubusercontent.com/tchoward/Hubitat/master/hubigraph_openweather_driver.groovy", + "location": "https://raw.githubusercontent.com/bucs-fan813/Hubitat/master/hubigraph_openweather_driver.groovy", "required": true } ], @@ -129,22 +130,22 @@ { "id":"a930f16d-d5f4-4f37-b874-6b0dcfd47ace", "name": "HubiGraph.js", - "location": "https://raw.githubusercontent.com/tchoward/Hubitat/master/HubiGraph.js" + "location": "https://raw.githubusercontent.com/bucs-fan813/Hubitat/master/HubiGraph.js" }, { "id":"a7af9806-4b0e-4032-a78e-a41e27e4d685", "name": "WeatherTile.js", - "location": "https://raw.githubusercontent.com/tchoward/Hubitat/master/WeatherTile.js" + "location": "https://raw.githubusercontent.com/bucs-fan813/Hubitat/master/WeatherTile.js" }, { "id":"ba8d5ae0-1fbd-430a-bae0-bb5c0bd17ebd", "name": "WeatherTile2.js", - "location": "https://raw.githubusercontent.com/tchoward/Hubitat/master/WeatherTile2.js" + "location": "https://raw.githubusercontent.com/bucs-fan813/Hubitat/master/WeatherTile2.js" }, { "id":"f06ea400-fe7a-49ef-8c50-6418f0a78dc6", "name": "WeatherTile2.css", - "location": "https://raw.githubusercontent.com/tchoward/Hubitat/master/WeatherTile2.css" + "location": "https://raw.githubusercontent.com/bucs-fan813/Hubitat/master/WeatherTile2.css" } ] diff --git a/repository.json b/repository.json index 179fef6..977fdd3 100644 --- a/repository.json +++ b/repository.json @@ -1,11 +1,12 @@ { "author": "Thomas Howard", - "gitHubUrl": "https://github.com/tchoward", + "co-maintainer": "Bucs-Fan", + "gitHubUrl": "https://github.com/bucs-fan813", "packages": [ { "name": "HubiGraphs", "category": "Convenience", - "location": "https://raw.githubusercontent.com/tchoward/Hubitat/master/packageManifest.json", + "location": "https://raw.githubusercontent.com/bucs-fan813/Hubitat/master/packageManifest.json", "description": "All your graphing needs, hosted locally on your hub!" } ]