poblabs / weewx-belchertown

A clean and modern weewx skin with real time streaming updates, forecast data and interactive charts. View it in action at BelchertownWeather.com
https://belchertownweather.com
GNU General Public License v3.0
206 stars 110 forks source link

Additional sensor support? #67

Closed trevor229 closed 5 years ago

trevor229 commented 5 years ago

Everything is working fine for me and I am loving this skin for weewx as a replacement to the unfortunately EoL'd AcuLink hub and MyAcurite system that my family used. However I was wondering if there is any support or way to add additional sensors for graphing? My main data feed is from an AcuRite 5 in 1 station, but I also have an additional AcuRite tower sensor that I'd like to include if possible. I'm aware that weewx has provisions for extra temperature and humidity sensors, but the Belchertown skin does not seem to have any configuration for extra sensors.

poblabs commented 5 years ago

I'm working on this functionality. It requires a full re-write of the charting system. I don't have an ETA since I started this effort yesterday. Hopefully in the next few weeks.

If you'd like to test it, let me know and I'll share details when it's ready to be tested.

trevor229 commented 5 years ago

Sure! I already have the other sensor I have entered into weewx so I should be able to mess with it and do some beta testing when the time comes. Thank you for your hard work!

jmceara commented 5 years ago

I would like to test this too! Also, is possible to display current value from 'extra sensor' in main page while grphs are not ready? I'm using 'extraTemp1' as my Boiler temperature sensor and I would like to display on main page and, in the future, graphs. Tks!

poblabs commented 5 years ago

@jmceara You will have to edit skins/Belchertown/index.html.tmpl and add in the variable to the skin. Wait for an archive interval or run wee_reports. I believe you would want $current.extraTemp1, but you'll need to play around with it.

My guess is you would want to put it around this area. Again, you'll have to play with it until you find the right combination.

jmceara commented 5 years ago

Is possible to use variables inside custom areas/files? Like 'index_hook_after_forecast.inc'. If yes, this would avoid changes in main files (which could prevent future updates)

poblabs commented 5 years ago

@jmceara Good point! I didn't think to mention that. Yes, if you're running skin version 0.9.1, then the $tags will work in the .inc files. You can see an example of that on my own site's about page. The about page is an .inc file, and the information below the photos are all tags.

poblabs commented 5 years ago

You can begin testing some of these features now by installing the development branch. Please note, standard disclaimer, development branch is constantly changing and documentation is a little lacking. However, there should be enough documentation in the skin.conf to get the charts going and configured.

I'm closing this issue since this option is technically supported right now in the 1.0 development branch. It will be helpful for you to test and maybe help update some documentation on anything that may be confusing.

For example to chart weewx extraTemp1's values for the day, in skin.conf, under the [[day]] section, add a new chart like below

[[[extratempchart]]]
    title = Extra Temp 1
    [[[[extraTemp1]]]]
poblabs commented 5 years ago

The development branch can be found here: https://github.com/poblabs/weewx-belchertown/tree/development - just click on the "Download Zip" link at the right side of the page.

To be safe, have a backup. Uninstall the existing Belchertown skin using wee_extension --uninstall Belchertown, then use wee_extension --install <the zip file name from development branch>.zip

Restart weewx

slvrscoobie commented 5 years ago

Is there a limit to how many sensors I can add? I have 8 additional sensors (extraTemp1-8) - if I just add [[[extratempchart]]] title = Extra Temp 1 [[[[extraTemp1]]]] ... [[[extratempchart]]] title = Extra Temp 8 [[[[extraTemp8]]]]

poblabs commented 5 years ago

If it's in the database, and you're on 1.0 (with the graphs.conf capability), you can graph whatever you want. So your example would work in graphs.conf, yes. You can also combine them (if it makes sense) like:

[[[extrachartname]]]
   title = Extra Chart
   [[[[extraTemp1]]]]
   [[[[extraTemp2]]]]

...and so on...

biltmorelaker commented 5 years ago

There shouldn't be a limit. But notice this warning on the "Tips" section (section 7) of the Wiki page on Belchertown Charts https://github.com/poblabs/weewx-belchertown/wiki/Belchertown-Charts-Documentation

Caution! The more charts you have, the slower things can become. This is especially true for graphs defined beneath the [year] Chart Group (graphs which are displayed on the Graphs YEAR page). Charts are interactive and have to be generated from the database on every archive interval. This could result in large file sizes that are generated, and that your website visitors have to download. You're welcome to customize as many charts as you want, but be warned things could slow down if you do too much! The defaults in this skin have proven to be a good baseline for the number of charts and options without overwhelming your system.

biltmorelaker commented 5 years ago

@slvrscoobie On your example, I believe your "bracket-depth" for each stanza is too deep. There should be two brackets for the "ChartID" and three brackets for the observation name. I think Pat made that error also in his answer above. (You don't often get a chance to catch the master in an error):wink:!

One more note: I think that if you want each sensor on a separate graph you need to change the name for each graph in the [[xxx]] stanza. So, for your example, it would be:

[[extratempchart1]]
title = Extra Temp 1
[[[extraTemp1]]]
...
[[extratempchart8]]
title = Extra Temp 8
[[[extraTemp8]]]

Alternatively, you could combine several plots on a single graph as Pat noted above.

slvrscoobie commented 5 years ago

Is it possible to just display the current temps (maybe with hi/low?) and put those graphs on a separate page ? this will just be for me on the LAN so if not it isnt a big deal except for SD card writes lol

slvrscoobie commented 5 years ago

Thats a good idea too, i could do 'indoor temps' where all the charts that are within the same range live. (basement, attic, kids room, bedroom) and then keep the freezers, and fridge on another... Rather than 8 separate graphs.

poblabs commented 5 years ago

Is it possible to just display the current temps (maybe with hi/low?) and put those graphs on a separate page ?

In a graph? Not really. It graphs what the database has in the archive table. You could play around with the aggregation for min and max, but I don't think that'll give you what you want. The skin itself does utilize the weewx tag $day.outTemp.max and .min. You could change outTemp to extraTemp1 to get that data somewhere on the skin. It wouldn't be in a graph though - just text on screen.

If you want current temperature, it would be $current.outTemp, again replacing outTemp with extraTemp1 or what you're looking for. Again - text on screen, not a graph.

slvrscoobie commented 5 years ago

Ah yes, sorry, I was mixing my thoughts on what I wanted to display, where. In looking for where to put my extraTemps, i dont see a [day] section in skin.conf - am I missing it, or was that location a hold over from 0.9?

poblabs commented 5 years ago

Are you testing the new 1.0 development branch? If so, check out the Charts Documentation. It's all tested well, but also sortof beta while I continue to squash the bugs that pop up.

If you need help or clarification with 1.0 features, feel free to open a new issue so we can isolate the conversation there.