Code Monkey home page Code Monkey logo

Comments (11)

sibbl avatar sibbl commented on July 22, 2024 1

@aptonline indeed the battery reporting feature was added by a community member only in this repo and only some patching instructions for the onlinescreensaverplugin were documented: https://github.com/sibbl/hass-lovelace-kindle-screensaver#patch-for-kinde-online-screensaver

So yes, this needs some additions in the script.sh of the special adaptation of the plugin for the Kindle 4.

Without having tested it, I think this might already work:

- DOWNLOADRESULT=$(wget -q "$IMAGE_URI" -O $TMPFILE)
+ DOWNLOADRESULT=$(wget -q "$IMAGE_URI?batteryLevel=$CHECKBATTERY&isCharging=$IS_CHARGING" -O $TMPFILE)

Please also update your rendering Docker container as I just added support for the $IS_CHARGING values which should be 0 and 1 (instead of the previously solely supported Yes and No values from a different source).

Maybe you can give it a try and give me some feedback whether this worked for you already? Thanks a lot!

from hass-lovelace-kindle-screensaver.

SurfingSpider avatar SurfingSpider commented on July 22, 2024 1

Sods law it started working after leaving it for the next automated refresh. Thank you for getting back to me though. It is all working now.

from hass-lovelace-kindle-screensaver.

aptonline avatar aptonline commented on July 22, 2024

the automation in HA seems to be failing with:

Stopped because an error was encountered at 7 May 2022, 20:10:49 (runtime: 0.02 seconds)

Error rendering data template: UndefinedError: 'dict object' has no attribute 'json

from hass-lovelace-kindle-screensaver.

aptonline avatar aptonline commented on July 22, 2024

Thanks I’ll give it try and report back 👍

from hass-lovelace-kindle-screensaver.

aptonline avatar aptonline commented on July 22, 2024

Ok so the good news in the battery percentage is working after editing script.sh and updating the docker container. The charging status however is not updating as expected.

from hass-lovelace-kindle-screensaver.

aptonline avatar aptonline commented on July 22, 2024

Oh so an update on the battery percentage. How often should this be updated, on every webhook call or only when there is a battery change? In the docker logs I’m only seeing 4 initial battery updates since I implemented the changes and nothing overnight.

from hass-lovelace-kindle-screensaver.

sibbl avatar sibbl commented on July 22, 2024

@aptonline the Kindle device includes its battery percentage into each HTTP request when retrieving the image. These parameters are then forwarded to HA whenever they changed. I might be possible that the device wasn't awake too long and couldn't read the battery percentage from its hardware.

Maybe you can check the on device log whether the battery changes were present there? If so and you say they weren't sent to the image renderer and thus to HA, then we might have a bug somewhere.

from hass-lovelace-kindle-screensaver.

aptonline avatar aptonline commented on July 22, 2024

I’ll tweak the setting and she what happens. Also trying @lanrat’s fork to see how they compare.

from hass-lovelace-kindle-screensaver.

SurfingSpider avatar SurfingSpider commented on July 22, 2024

I am also having trouble with this. I have it setup and running on a kindle 4. I just cant get Battery updates to work. I have updated the script.sh and can see entries for charging / battery in the logs.

It took me a while to work out I had to add to add a new ENV Variable to my docker. But now I get the Battery %.

What I am unclear on is how to change the....

"Please also update your rendering Docker container as I just added support for the $IS_CHARGING values which should be 0 and 1 (instead of the previously solely supported Yes and No values from a different source)."

I am sorry I don't understand where I need to change this.

Could you please point me in the right direction.

from hass-lovelace-kindle-screensaver.

sibbl avatar sibbl commented on July 22, 2024

HI @SurfingSpider,

the comment you quoted does not require any further action if you've just pulled your docker container. It was just a hint that I've changed something in the Docker container to support this line, so the Docker container had to be updated if created before my comment.

"Please also update your rendering Docker container as I just added support for the $IS_CHARGING values which should be 0 and 1 (instead of the previously solely supported Yes and No values from a different source)."

So only the change in the script.sh is necessary. But keep in mind that it's untested, so I'd appreciate any feedback. If it's working, I can add this line to the main repository so this issue can be closed. I couldn't find the time to test this yet, especially since my Kindle is plugged in all the time.

from hass-lovelace-kindle-screensaver.

sibbl avatar sibbl commented on July 22, 2024

Thanks for the confirmation! I've added the diff mentioned above to the README of this plugin, so we have both the onlinescreensaver and the custom Kindle 4 extension covered.

from hass-lovelace-kindle-screensaver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.