Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4017) - 17 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

Live Updates on Webpage (do I need Ajax)

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

User avatar
SJG1976
Posts: 365
Joined: Wed 21 Dec 2011 11:04 am
Weather Station: Davis WLL, with Airlink
Operating System: Raspberry Pi3 MX on USB Drive
Location: Glemsford, Suffolk
Contact:

Re: Live Updates on Webpage (do I need Ajax)

Post by SJG1976 »

Thanks Dazza,

Your Using

Code: Select all

	<item name="Pm25.3h.avg">
As an Example in your XML File.

I've not tried that.

When I tried

Code: Select all

	<item name="AirLinkPm2p5_3hrOut">
This is when my XML didn't update the HTML Pages. Not sure if it's the Underscore that makes a difference?
User avatar
dazza1223
Posts: 860
Joined: Sun 25 Jan 2015 8:41 pm
Weather Station: Davis Vantage Pro 2 plus
Operating System: Raspberry pi 4 (4gb)
Location: Worthing
Contact:

Re: Live Updates on Webpage (do I need Ajax)

Post by dazza1223 »

so it look like it there in the xml

<item name="AirLinkPm2p53hrOut">
<value><#AirLinkPm2p5_3hrOut></value>
<unit><![CDATA[&nbsp;C2 b5]]></unit>
<image></image>
<class>dynamic</class>
<description>Last 3 hours average particulate matter of 2.5 <![CDATA[&nbsp;C2 b5]]>.. or less.. count</description>
</item>


put this like how i put in as ur not calling the span and ive done it i just removed the _ line and it working but like this



<td><span class="ajax" id="AirLinkPm2p53hrOut"></td>
Last edited by dazza1223 on Wed 26 Jan 2022 6:56 pm, edited 1 time in total.
Have fun and keep learning

dazza :D

https://www.davisworthing.co.uk

Image
Mapantz
Posts: 1774
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: Live Updates on Webpage (do I need Ajax)

Post by Mapantz »

I think it's a waste of bandwidth putting character data and descriptions in to the XML file, they aren't needed.

Just manually put the units at the end of the id, between the span and table data cell
Image
User avatar
SJG1976
Posts: 365
Joined: Wed 21 Dec 2011 11:04 am
Weather Station: Davis WLL, with Airlink
Operating System: Raspberry Pi3 MX on USB Drive
Location: Glemsford, Suffolk
Contact:

Re: Live Updates on Webpage (do I need Ajax)

Post by SJG1976 »

Thanks Dazza,

I'll give that a go tomorrow and try with the Units in.
Will see if it processes them correctly.

Thanks.

Steve.
User avatar
SJG1976
Posts: 365
Joined: Wed 21 Dec 2011 11:04 am
Weather Station: Davis WLL, with Airlink
Operating System: Raspberry Pi3 MX on USB Drive
Location: Glemsford, Suffolk
Contact:

Re: Live Updates on Webpage (do I need Ajax)

Post by SJG1976 »

dazza1223 wrote: Wed 26 Jan 2022 6:49 pm so it look like it there in the xml

<item name="AirLinkPm2p53hrOut">
<value><#AirLinkPm2p5_3hrOut></value>
<unit><![CDATA[&nbsp;C2 b5]]></unit>
<image></image>
<class>dynamic</class>
<description>Last 3 hours average particulate matter of 2.5 <![CDATA[&nbsp;C2 b5]]>.. or less.. count</description>
</item>


put this like how i put in as ur not calling the span and ive done it i just removed the _ line and it working but like this



<td><span class="ajax" id="AirLinkPm2p53hrOut"></td>
I only managed to get it to processes with the following.

Code: Select all

<item name="AirLinkPm2p5NowcastOut"> <value> <#AirLinkPm2p5_NowcastOut> </value> <unit><![CDATA[&nbsp;&#181;m]]> </unit> <class>dynamic</class> <description> </description> </item>
User avatar
dazza1223
Posts: 860
Joined: Sun 25 Jan 2015 8:41 pm
Weather Station: Davis Vantage Pro 2 plus
Operating System: Raspberry pi 4 (4gb)
Location: Worthing
Contact:

Re: Live Updates on Webpage (do I need Ajax)

Post by dazza1223 »

ok so my trick work then ?
Have fun and keep learning

dazza :D

https://www.davisworthing.co.uk

Image
User avatar
dazza1223
Posts: 860
Joined: Sun 25 Jan 2015 8:41 pm
Weather Station: Davis Vantage Pro 2 plus
Operating System: Raspberry pi 4 (4gb)
Location: Worthing
Contact:

Re: Live Updates on Webpage (do I need Ajax)

Post by dazza1223 »

you need to remove the _ that and in the index page u need to call it ie like


<td><span class="ajax" id="AirLinkPm2p51hrOut"></span></td>



cos for some reason the xml doesn't like the _ so u have to put as the name as like this

old...
<item name="AirLinkPm2p5_1hrOut">

to
<item name="AirLinkPm2p51hrOut">

Code: Select all

	</item>	
		<item name="AirLinkPm2p5_1hrOut">
		<value>11.7</value>
		<unit><![CDATA[&nbsp;C2 b5]]></unit>
		<image></image>
		<class>dynamic</class>
		<description>last hour average particulate matter of 2.5 <![CDATA[&nbsp;C2 b5]]>.. or less.. count</description>
	</item>	
		<item name="AirLinkPm2p5_3hrOut">
		<value>15.1</value>
		<unit><![CDATA[&nbsp;C2 b5]]></unit>
		<image></image>
		<class>dynamic</class>
		<description>Last 3 hours average particulate matter of 2.5 <![CDATA[&nbsp;C2 b5]]>.. or less.. count</description>
	</item>	
		<item name="AirLinkPm2p5_24hrOut">
		<value>17.0</value>
		<unit><![CDATA[&nbsp;C2 b5]]></unit>
		<image></image>
		<class>dynamic</class>
		<description>Last 24 hours average particulate matter of 2.5 <![CDATA[&nbsp;C2 b5]]>.. or less.. count</description>
	</item>	
		<item name="AirLinkPm2p5_NowcastOut">
		<value>15.3</value>
		<unit><![CDATA[&nbsp;C2 b5]]></unit>
		<image></image>
		<class>dynamic</class>
		<description>The 24 hour ""nowcast"" weighted average particulate matter of 2.5 <![CDATA[&nbsp;C2 b5]]>.. or less.. count"</description>
	</item>	

to like this

Code: Select all

	</item>	
		<item name="AirLinkPm2p51hrOut">
		<value>11.7</value>
		<unit><![CDATA[&nbsp;C2 b5]]></unit>
		<image></image>
		<class>dynamic</class>
		<description>last hour average particulate matter of 2.5 <![CDATA[&nbsp;C2 b5]]>.. or less.. count</description>
	</item>	
		<item name="AirLinkPm2p53hrOut">
		<value>15.1</value>
		<unit><![CDATA[&nbsp;C2 b5]]></unit>
		<image></image>
		<class>dynamic</class>
		<description>Last 3 hours average particulate matter of 2.5 <![CDATA[&nbsp;C2 b5]]>.. or less.. count</description>
	</item>	
		<item name="AirLinkPm2p524hrOut">
		<value>17.0</value>
		<unit><![CDATA[&nbsp;C2 b5]]></unit>
		<image></image>
		<class>dynamic</class>
		<description>Last 24 hours average particulate matter of 2.5 <![CDATA[&nbsp;C2 b5]]>.. or less.. count</description>
	</item>	
		<item name="AirLinkPm2p5NowcastOut">
		<value>15.3</value>
		<unit><![CDATA[&nbsp;C2 b5]]></unit>
		<image></image>
		<class>dynamic</class>
		<description>The 24 hour ""nowcast"" weighted average particulate matter of 2.5 <![CDATA[&nbsp;C2 b5]]>.. or less.. count"</description>
	</item>	
Have fun and keep learning

dazza :D

https://www.davisworthing.co.uk

Image
Mapantz
Posts: 1774
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: Live Updates on Webpage (do I need Ajax)

Post by Mapantz »

I'm using the underscore character in my XML without any problems..
Image
Post Reply