Page 1 of 1

Custom Pages

Posted: Monday 28 October 2024 0:36
by HvdW
Hi,
Using this script:

Code: Select all

<!DOCTYPE html>
<html>
<head>
    <title>Charging Levels Graph</title>
</head>
<body>
    <h1>Charging Levels for Last Month</h1>
    <img src="http://192.168.2.104/home/pi/scripts/graph.png" alt="Charging Levels Graph">

</body>
</html>
Putting the png in ~/domoticz/www/templates doesn't help either
the png file isn't displayed.
Putting the file in /var/www gives a perfect display on 192.168.2.104/graph.png
The webserver on my RPI is lighttpd

Should something in the config of lighttpd be changed?

Re: Custom Pages

Posted: Monday 28 October 2024 7:54
by lost
Hello, il I remember correctly domoticz integrated web server needs relative path from domoticz/www and will not handle anything out. Il your image is not in a subpath there you may create a symbolic link and use the link in your html.

Re: Custom Pages

Posted: Monday 28 October 2024 9:48
by HvdW
I can see the png om my Android device when I refresh the page.
On the windows computer it doesn't display at all.

Anyway, thanks for the tip.

Re: Custom Pages

Posted: Monday 28 October 2024 11:23
by lost
HvdW wrote: Monday 28 October 2024 9:48 I can see the png om my Android device when I refresh the page.
On the windows computer it doesn't display at all.
Using lighthttpd & not domoticz integrated web server I presume?
Strange to have this difference but you may try convert the image to jpg & see if you have a png format handling issue on your computer vs android.

For the symlink tip, I use it on the PI hosting Domoticz because I publish IP cameras captures merged images in a custom page: To avoid SD card wear, these last capture images are built on a tmpfs in ram. So the need to symlink where domoticz web server is able to fetch them...

If needing to have access to a full directory/path from another place and not a single file, there is also the possibility to use a "bind mount" (can be added in /etc/fstab after manual testing to be set automagically at boot) instead of a symlink:
https://unix.stackexchange.com/question ... bind-mount