Page 1 of 1

Problems reading html tags on the index.htm file

Posted: Wed 25 Dec 2024 5:32 pm
by mitmania
Hello, I have the following problem. I am rewriting my web page with the file indexT.htm and I wanted to insert some graphic libraries in javascript to represent some gauges (temperature, humidity, etc.) that would update each time I upload the file. All this by having the values contained in the various tags read (e.g. html tag temperature <#temp>). I am unable to represent the decimal value in the graphs in any library I use. For example, if the temperature is 1.9°C, 1°C is displayed; if the temperature is 5.7°C, 5°C is displayed. After trying to solve this with the various LLMs (ChatGPT or Claude), I cannot find the solution. Now I ask myself: is this actually not feasible? Thank you for your reply.

Re: Problems reading html tags on the index.htm file

Posted: Wed 25 Dec 2024 6:28 pm
by water01
Have you set the decimal places you require in Station Settings > General Settings > Units > Advanced Options - Number Decimals?

Re: Problems reading html tags on the index.htm file

Posted: Wed 25 Dec 2024 6:36 pm
by mitmania
I still use Cumulus version 1.9 and from the menu you tell me I don't see the setting .....

Re: Problems reading html tags on the index.htm file

Posted: Wed 25 Dec 2024 9:02 pm
by water01
Aha didn't realise that, not sure Cumulus 1 allowed decimal places, to do this you should move to CumulusMX.

Re: Problems reading html tags on the index.htm file

Posted: Thu 26 Dec 2024 9:29 am
by SamiS
water01 wrote: Wed 25 Dec 2024 9:02 pm Aha didn't realise that, not sure Cumulus 1 allowed decimal places, to do this you should move to CumulusMX.
The default website of Cumulus1 definitely uses decimals, but most likely they are not adjustable.

I think the issue could be in how the output is formatted (dot or comma separator). If CU1 <#temp> outputs 1.5 and the graph library expects 1,5 this could cause the decimals to be ignored. Depending on the graph library one might be able to configure it to accept the format CU1 uses, or otherwise it must be converted somehow afterwards (eg via additional javascript?).