Dynamically Creating Plots in Skin.config

72 views
Skip to first unread message

Carter Humphreys

unread,
Oct 12, 2024, 11:36:49 PM10/12/24
to weewx-development

 Fff
Is it possible to dynamically create plots from a weewx skin config? My extension creates variables in a database based on sensors defined in weewx.config, so I want to create the same plots across all sensors.

So what I was hoping to do is make it so that I can define the sensor IDs in the weewx.config, then be able to generate plots for those without having to define the same plot for each sensor.

Any ideas how to do this? Or if it is even possible?

Thanks!

Carter Humphreys

unread,
Oct 12, 2024, 11:36:49 PM10/12/24
to weewx-de...@googlegroups.com
Hi,

Tom Keffer

unread,
Oct 13, 2024, 7:18:12 AM10/13/24
to Carter Humphreys, weewx-development
I'm not exactly sure what you're asking for. 

Right now, the image generator requires that there be a quadruple stanza ("[[[[ ... ]]]]") for each plot. For many skins, for example, the Seasons skin, whether it actually gets used depends on whether it is mentioned under [DisplayOptions] and whether it has any data in it. Is that what you're looking for?

Or, do you mean that you want to just start with some observation type, such as "houseVoltage", and from that create a plot, perhaps using a template? In this case, it's a good idea, but the image generator cannot do that.

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/e8364d88-db4c-4794-a62b-045a51df2852n%40googlegroups.com.

Carter Humphreys

unread,
Oct 13, 2024, 1:15:21 PM10/13/24
to Tom Keffer, weewx-development
Sorry, I probably could have explained that better.

I’m trying to go that second route. I’m trying to avoid the repetition of having to define a plot in the generator for each of the defined sensors.

So the ability to do something like:

for sensor in user_config['sensors']:
    [[[ plot_example 1]]]
    [[[ plot_example 2]]]

That way the same plots are generated for each sensor (since they all have the same data). 

I’m guessing the way this would work is to go is just create a json file with the data from the time series tag, and then create the plots in JavaScript.

Carter

On Oct 13, 2024, at 04:18, Tom Keffer <tke...@gmail.com> wrote:



Vince Skahan

unread,
Oct 13, 2024, 5:57:40 PM10/13/24
to weewx-development
Perhaps generate skin.conf programmatically ??

Carter Humphreys

unread,
Oct 15, 2024, 7:02:33 PM10/15/24
to Vince Skahan, weewx-development
That could probably also work. I was just more trying to see if there was a native solution in place already. Thanks for the idea!

On Oct 13, 2024, at 14:57, Vince Skahan <vince...@gmail.com> wrote:

Perhaps generate skin.conf programmatically ??
You received this message because you are subscribed to a topic in the Google Groups "weewx-development" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-development/xZqyVBA5pZ8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/b13f8a5a-3db0-4f72-9230-35b226c005d8n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages