Custom Pages

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
HvdW
Posts: 539
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

Custom Pages

Post 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?
Bugs bug me.
lost
Posts: 643
Joined: Thursday 10 November 2016 9:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Custom Pages

Post 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.
HvdW
Posts: 539
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

Re: Custom Pages

Post 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.
Bugs bug me.
lost
Posts: 643
Joined: Thursday 10 November 2016 9:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Custom Pages

Post 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
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest