It could be related to debugging? How might one disable that?
Oh, that’s the time from the RTC the image was last updated. Its currently not configurable, but I agree it should be.
It should be as simple as adding a new configuration option/define and wrapping this like in it: https://github.com/lanrat/homeplate/blob/cc3ad4f37eb597dde62885a59e1d293b8a1dce9d/src/image.cpp#L57
Ah hah. Appreciate the explanation, given that I have zero programming knowledge, that’s probably beyond me. Thanks anyway!
Well, you are in luck, I had some time today and added the option to hide the last refresh time: added option to hide last refresh time · lanrat/homeplate@4d50ca9 · GitHub
Just set DISPLAY_LAST_UPDATE_TIME
to false in your config.h
.
Amazing, that fixed it! Thanks a bunch for doing that
Hi everyone,
I’ve been trying to get this going. I setup a new PiZero 2 running docker. I get this error when it starts
> [email protected] start
> node index.js
Starting browser...
Visiting 'http://192.168.0.167:8123' to login...
Adding authentication entry to browser's local storage...
/app/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:265
throw new Error('Execution context was destroyed, most likely because of a navigation.');
^
Error: Execution context was destroyed, most likely because of a navigation.
at rewriteError (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:265:23)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async ExecutionContext._evaluateInternal (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:219:60)
at async ExecutionContext.evaluate (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16)
at async /app/index.js:52:3
npm notice
npm notice New major version of npm available! 8.19.4 -> 10.2.5
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.2.5>
npm notice Run `npm install -g [email protected]` to update!
npm notice
Any Ideas?
I have got a bit further, i’ve got it running taking screenshots but it doesn’t seem to be logging in
I have added the long live access token. Any ideas?
I’ve noticed everyone has https:// at the start of there home assistant. mines http://
does that make a differance
You might need to increase all the timeouts and page load times if running on a Pi zero. By today’s standards, its a pretty underpowered device, especially when running modern chrome on a JS rich website like HASS.
Hi! I am trying to get this all set up on the computer while my inkplate comes. I was able to get MQTT set up and talking to Home Assistant, connects fine. I also got the hass-screenshot docker image set up. I am getting an error when it runs though. Do I need to make a folder somewhere to put the screenshots? Here’s the error message. Thanks for any help!
1. Node.js v17.9.1
2. > [email protected] start
3. > node index.js
4. [12/29/2023, 10:28:17 AM] Operating in realtime mode with cache.
5. [12/29/2023, 10:28:17 AM] Attempting to connect to mqtt://192.168.*.**:1883
6. [12/29/2023, 10:28:18 AM] Starting browser...
7. [12/29/2023, 10:28:18 AM] MQTT Connected!
8. [12/29/2023, 10:28:20 AM] Visiting '192.168.*.**:8123' to login...
9. /app/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:226
10. error: new Errors_js_1.ProtocolError(),
11. ^
12. ProtocolError: Protocol error (Page.navigate): Cannot navigate to invalid URL
13. at /app/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:226:24
14. at new Promise (<anonymous>)
15. at CDPSession.send (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:222:16)
16. at navigate (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:148:47)
17. at FrameManager.navigateFrame (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:131:13)
18. at Frame.goto (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:500:41)
19. at Page.goto (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:1167:53)
20. at /app/index.js:63:14
21. at processTicksAndRejections (node:internal/process/task_queues:96:5) {
22. originalMessage: 'Cannot navigate to invalid URL'
23. }
And my docker compose file…
version: '3.7'
services:
hass-screenshot:
container_name: hass-screenshot
image: lanrat/hass-screenshot
deploy:
environment:
- TZ=America/Chicago
- HA_BASE_URL=192.168.*.**:8123
- HA_ACCESS_TOKEN=reallylongtoken
- LANGUAGE=en
- MQTT_SERVER=192.168.*.**:1883
- REAL_TIME=true
- RENDERING_DELAY=2
- COLOR_MODE=GrayScale
# image 1
- HA_SCREENSHOT_URL=/lovelace-infra/hud1?kiosk
- RENDERING_SCREEN_HEIGHT=825
- RENDERING_SCREEN_WIDTH=1200
- GRAYSCALE_DEPTH=3
# image 2
- HA_SCREENSHOT_URL_2=/lovelace-infra/hud2?kiosk
- RENDERING_SCREEN_HEIGHT_2=800
- RENDERING_SCREEN_WIDTH_2=600
- GRAYSCALE_DEPTH_2=4
# image 3
- HA_SCREENSHOT_URL_3=/lovelace-infra/hud3?kiosk
- RENDERING_SCREEN_HEIGHT_3=800
- RENDERING_SCREEN_WIDTH_3=600
- GRAYSCALE_DEPTH_3=4
restart: unless-stopped
ports:
- 5001:5000
healthcheck:
test: "wget --no-verbose --tries=1 --spider http://localhost:5000/ || exit 1"
interval: 60s
timeout: 5s
retries: 3
start_period: 60s
HA_BASE_URL
needs to be a URL. It must start with http://
or https://
.
Awesome, thanks for the reply. It’s working more now, but timeouts on trying to take a screenshot. I tried RENDERING_DELAY up to 4 and a RENDERING_TIMEOUT up to 30000 with no success. I’m pretty sure it has something to do with the HA_SCREENSHOT_URL. If I wanted to capture http://192.168.x.xx:8123/dashboard-weather2/0 (real browser URL) how would I format the HA_SCREENSHOT_URL parameter? I have it like
- HA_SCREENSHOT_URL=/dashboard-weather2/0
now. Here’s the log from hass-screenshot when I tried to capture just the default view. I can get to the page with the serverip:5000 (in my case it’s 5001) but there’s no image when I click one of the three links.
Oh, and I also tried twice to make new Home Assistant Long-lived access tokens with no change. Do I need to restart HA when making a new token?
> [email protected] start
> node index.js
[12/29/2023, 3:51:09 PM] Operating in realtime mode with cache.
[12/29/2023, 3:51:09 PM] Attempting to connect to mqtt://192.168.x.xx:1883
[12/29/2023, 3:51:09 PM] Starting browser...
[12/29/2023, 3:51:09 PM] MQTT Connected!
[12/29/2023, 3:51:14 PM] Visiting 'http://192.168.x.xx:8123' to login...
[12/29/2023, 3:51:18 PM] Adding authentication entry to browser's local storage...
[12/29/2023, 3:51:20 PM] Starting first render...
[12/29/2023, 3:51:20 PM] Server is running at 5000
[12/29/2023, 3:51:20 PM] Rendering http://192.168.x.xx:8123/lovelace/default_view to image...
[12/29/2023, 3:51:31 PM] Failed to render http://192.168.x.xx:8123/lovelace/default_view
[12/29/2023, 3:51:31 PM] Error: TimeoutError: Navigation timeout of 10000 ms exceeded
[12/29/2023, 3:51:31 PM] Rendering http://192.168.x.xx:8123/lovelace/default_view to image...
[12/29/2023, 3:51:41 PM] Failed to render http://192.168.x.xx:8123/lovelace/default_view
[12/29/2023, 3:51:41 PM] Error: TimeoutError: Navigation timeout of 10000 ms exceeded
[12/29/2023, 3:51:41 PM] Rendering http://192.168.x.xx:8123/lovelace/default_view to image...
[12/29/2023, 3:51:52 PM] Converting rendered screenshot of http://192.168.x.xx:8123/lovelace/default_view to grayscale png...
[12/29/2023, 3:51:53 PM] Finished http://192.168.x.xx:8123/lovelace/default_view
[12/29/2023, 3:51:57 PM] recieved request from ::ffff:127.0.0.1 for /
Are you using my screenshot code or sibl’s?
Your config looks OK (for the information given).
I’m using yours. Dang. Hoping it would be something easy I missed. Any other ideas that you can think of I can try would be helpful. Been trying quite a few things with no luck.
Hi all together.
Thanks for the great project.
I bought an inplate 10 last week and currently I try to set it up.
I can display the resolution image from web on the inkplate. But not more.
Lovelace Kindle screensaver is installed but I can’t start it.
Configuration
HA_BASE_URL: http://192.168.168.30:8123
HA_SCREENSHOT_URL: /lovelace/0
HA_ACCESS_TOKEN: ""
LANGUAGE: en
CRON_JOB: "* * * * *"
RENDERING_TIMEOUT: 59999
RENDERING_DELAY: "0"
RENDERING_SCREEN_HEIGHT: 825
RENDERING_SCREEN_WIDTH: 1200
BROWSER_LAUNCH_TIMEOUT: "30000"
ROTATION: "0"
SCALING: "1"
GRAYSCALE_DEPTH: "8"
IMAGE_FORMAT: png
COLOR_MODE: GrayScale
REMOVE_GAMMA: true
PREFERS_COLOR_SCHEME: light
HA_BATTERY_WEBHOOK: ""
SATURATION: 1
CONTRAST: 1
ADDITIONAL_ENV_VARS: []
protocol
Node.js v18.20.1
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
[15:17:30] INFO: Loading config...
[15:17:33] INFO: Loading additional environment variables...
[15:17:33] INFO: Using HA_BASE_URL: http://192.168.168.30:8123
[15:17:33] INFO: Starting server...
> [email protected] start
> node index.js
Starting browser...
Visiting 'http://192.168.168.30:8123' to login...
Adding authentication entry to browser's local storage...
Starting first render...
Rendering http://192.168.168.30:8123/lovelace/0 to image...
Failed to render TimeoutError: waiting for selector `home-assistant` failed: timeout 48310ms exceeded
at new WaitTask (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/DOMWorld.js:517:34)
at DOMWorld.waitForSelectorInPage (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/DOMWorld.js:428:26)
at internalHandler.waitFor (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/QueryHandler.js:31:77)
at DOMWorld.waitForSelector (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/DOMWorld.js:321:29)
at Frame.waitForSelector (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:924:51)
at Page.waitForSelector (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:2359:33)
at renderUrlToImageAsync (/app/index.js:263:16)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async renderAndConvertAsync (/app/index.js:176:5)
at async /app/index.js:71:5
Converting rendered screenshot of http://192.168.168.30:8123/lovelace/0 to grayscale...
/app/node_modules/gm/lib/command.js:301
err = new Error('Command failed: ' + stderr);
^
Error: Command failed: convert: unable to open image 'output/cover.png.temp': No such file or directory @ error/blob.c/OpenBlob/3569.
convert: no decode delegate for this image format `TEMP' @ error/constitute.c/ReadImage/746.
convert: no images defined `output/cover.png' @ error/convert.c/ConvertImageCommand/3354.
at ChildProcess.onExit (/app/node_modules/gm/lib/command.js:301:17)
at ChildProcess.emit (node:events:517:28)
at maybeClose (node:internal/child_process:1098:16)
at ChildProcess._handle.onexit (node:internal/child_process:303:5) {
code: 1,
signal: null
}
I don’t know how to connect the display via MQTT to home assistant
I use already Mosquito for Zigbee2MQTT
How and where do I carry ou the next steps?
I changed the settings for the lovelace kindle screensaver.
I added an log lived access token and changed the HA_BASE_URL to the homeplate dashboard but I still get an convert error.
Starting first render...
Rendering http://192.168.168.30:8123/dashboard-inkplate/inkplate?kiosk to image...
Converting rendered screenshot of http://192.168.168.30:8123/dashboard-inkplate/inkplate?kiosk to grayscale...
Failed to render TimeoutError: Navigation timeout of 59999 ms exceeded
at /app/node_modules/puppeteer/lib/cjs/puppeteer/common/LifecycleWatcher.js:106:111
/app/node_modules/gm/lib/command.js:301
err = new Error('Command failed: ' + stderr);
^
Error: Command failed: convert: unable to open image 'output/cover.png.temp': No such file or directory @ error/blob.c/OpenBlob/3569.
convert: no decode delegate for this image format `TEMP' @ error/constitute.c/ReadImage/746.
convert: no images defined `output/cover.png' @ error/convert.c/ConvertImageCommand/3354.
at ChildProcess.onExit (/app/node_modules/gm/lib/command.js:301:17)
at ChildProcess.emit (node:events:517:28)
at maybeClose (node:internal/child_process:1098:16)
at ChildProcess._handle.onexit (node:internal/child_process:303:5) {
code: 1,
signal: null
}
I tried the following instruction:
https://cln.io/blog/making-an-inkplate-dashboard-with-home-assistant/
Hello, you may want to try this container:
It works fine in my environment.
Thx for that note. Where is the difference to the lovelace kindle screensaver. I can’t add that GitHub repo (GitHub - lanrat/hass-screenshot: This tool generates a png from a Home Assistant Lovelace view.) to the HA add ons.
The other problem: where should I execute the “pio run” command and how do I set-up the MQTT server?
What is the difference to the “original” tool?
I want to run the kindle screensaver as a plug-in in HA.
Unfortunately, I still can’t get the whole thing to work