Page 1 of 1

Local webtags

Posted: Mon 26 Sep 2022 1:19 pm
by Mapantz
I made my own web page specifically for a tablet, but now I want to convert it to read the data locally..

Is there a list of all of the local webtags?

I've been using:

Code: Select all

<span id="WindLatest">
etc

I'm trying to get the cloudbase, moon phase/percentage, lightning data and leaf wetness.

Re: Local webtags

Posted: Mon 26 Sep 2022 3:36 pm
by HansR
Interesting question but I don't understand it.
What do you mean by 'read the data locally' in the context of a webpage (irrelevant being displayed on a laptop or a tablet or phone).
What do you mean by local webtags?

Re: Local webtags

Posted: Mon 26 Sep 2022 3:42 pm
by Mapantz
The exact same way that the index.html and now.html from the local interface gets the data. I've gotten most of it, but I don't know the names of the ID's for the extra data I wanted to add, as per my first post.

Re: Local webtags

Posted: Mon 26 Sep 2022 3:51 pm
by water01
Couldn't you just set up a file with all the webtags you want and add it to the Extra Web Files area and make it's destination a local file area i.e. C:\CumulusMXTags and set the process file indicator.

That way it will process the file and copy the file locally.

Re: Local webtags

Posted: Mon 26 Sep 2022 4:09 pm
by Mapantz
I could've done, but why spend time doing that when the data can already be grabbed?

I've got my local page working by using the same method as the index.html and now.html. However, I am missing a few bits of data and I don't know the ID's

I am talking about CMX's local interface here, not a global website.

Re: Local webtags

Posted: Mon 26 Sep 2022 4:31 pm
by HansR
OK. So I assume those tags are different from the regular Webtags.
What you are looking for is not published afaik, so you either aks Mark or study the interface well.
I assume...

[EDIT]: the word webtag or tag in this case is a bit troublesome I think. You are looking for the id's if I understand you well.

Re: Local webtags

Posted: Mon 26 Sep 2022 4:59 pm
by sfws
Just as an aside, this is more evidence that the Cumulus 1 terminology "webtags" continues to generate much confusion in a MX context.
Mapantz wrote: Mon 26 Sep 2022 1:19 pm I made my own web page specifically for a tablet, but now I want to convert it to read the data locally...

Is there a list of all of the local webtags?
Please see Mark's documentation indexed as predetermined data here.
Mapantz wrote: Mon 26 Sep 2022 3:42 pm The exact same way that the index.html and now.html from the local interface gets the data
In other words that you wish to use the web server that MX itself generates on port 8998, (not a server that you host yourself).
Mapantz wrote: Mon 26 Sep 2022 1:19 pm I'm trying to get the cloudbase, moon phase/percentage, lightning data and leaf wetness.
If this data does not already exist in standard local interface, then I believe you have to use a General API that you write yourself as Mark's documentation describes.

Re: Local webtags

Posted: Mon 26 Sep 2022 5:27 pm
by HansR
sfws wrote: Mon 26 Sep 2022 4:59 pm Just as an aside, this is more evidence that the Cumulus 1 terminology "webtags" continues to generate much confusion in a MX context.
As an aside to an aside: it is not the terminology which creates confusion, it is the misunderstanding of what it is.
That is a big difference. What's in a name etc...

Never try to solve a problem by using other names. That is called newspeak.

Re: Local webtags

Posted: Tue 27 Sep 2022 5:15 am
by sfws
@Mapantz: I perhaps should have mentioned, if you view (in developer tools/options for your browser) the Network tab, and then click on the JSON data file, you can see the available data item names such as "WindLatest". The fact that these abbreviated names match a subset of web tag names should be interpreted as being intended purely to make it easier to understand what the data represents.

@HansR: My aside was included in reaction to her associating a HTML id with the Cumulus 1 concept of a web tag. After I read your post timed before mine, you added an edit, where you also suggest webtag not being appropriate terminology for an id, proving you do understand my point.
The confusion for a lot of Cumulus MX users, stems from the developer choosing to use the well understood Cumulus 1 terminology (rather than a new label) to cover the very different Cumulus MX Local API context (and other contexts where the terminology is used, MQTT etc.) without explaining how the data available varies in his different uses of that terminology.
Some decades ago when I was in paid work, the frequently changing bosses each inflicted re-branding, (well established projects or departments were given new names, or new logos, without changes to the actual work we workers did), that attitude was an example of your newspeak!

Re: Local webtags

Posted: Tue 27 Sep 2022 6:12 am
by HansR
@sfws: to fill HTML elements with an id with value requires programming, most likely but not necessarily in javascript. That and the fact that an id is definitely different from the webtag identification, even if there is an overlap, is in itself not an argument to change the word for the entities we know now as Webtags.

Mapantz could have used any ID by any other name (sic) for the HTML element and did not mention anyhow she was going to fill that element so using the term Webtag for the ID is bad practice according to me.

Beside that to be precise: I did not say the word webtag was inappropriate, I said it was a bit troublesome. That is different.

Re: Local webtags

Posted: Tue 27 Sep 2022 6:19 am
by HansR
And btw @sfws newspeak is not mine, it is Orwell's.
Don't think too much of my use of that word ;)

Re: Local webtags

Posted: Tue 27 Sep 2022 9:24 am
by mcrossley
To go back to what I think was the original question. If I understand it correctly you want a list of the "ids" used/available on the main dashboard page?

This is provided anywhere at the moment. But you can get the current data yourself....
- Load the dashboard page in your broswer
- Start the dev tools - F12 for Chromium based browsers
- Refresh the the page
- Look in the dev tools network tab and find the Name = "ws" entry, select that and select the Messages tab
- That shows the data being sent from CMX

You can copy the data from one message (they are all the same) and reformat it in a decent editor (it is JSON format), and you should be able to see all the ids. Or you can just browse the formatted data in the dev tools.

Re: Local webtags

Posted: Tue 27 Sep 2022 10:55 am
by Mapantz
Thank you for the replies. Most helpful!

I am going to create a small JSON and read that data.

Quick question; Can dp=1 used when calling the API?

ie

Code: Select all

MoonPercentAbs dp=1

Re: Local webtags

Posted: Tue 27 Sep 2022 11:55 am
by mcrossley
You can, but you have to use the POST method to add tag parameters.