alexkn / node-red-contrib-valetudo

A Node-RED node to convert Valetudo map_data to a png image wich can be send to a dashboard template node.
Apache License 2.0
14 stars 2 forks source link

Align the map the center of the Template? #1

Closed nicedevil007 closed 4 years ago

nicedevil007 commented 4 years ago

Hey alexkn,

first I want to thank you for your nice node <3

Just one small thing I noticed. Would it be possible to cut off everything out the drawn flat? Or maybe it would be possible to add an offset to align the map more to the left.

Here a screen on an iPhone XS. It won't fit the screen nicely :(

grafik

alexkn commented 4 years ago

Did you use my HTML Code Sample for the template node?

<div>
    <img src="data:image/png;base64,{{msg.payload}}" style="width: 100%;height: auto" />
</div>

Width 100% should shrink the map to the size of the template node. So it should be centered automatically.

You can use the crop settings to cut off the parts outside your flat.

nicedevil007 commented 4 years ago

Hey alex,

yes I did use this but it didn't worked. I tryed the crop and width settings at all but no chance to get it to work like it should.

Unfurtunately my Node-Red keeps freezing when I was using your node while I uninstalled it. I don't know why for sure but saw anything with rights on the created folders of it. Maybe I give it a try an other time :)

nicedevil007 commented 4 years ago

Ok, tested it again.

Your node still keeps rebooting node-red on my setup. I guess it is because of the overwhelming messages the S50 is sending to my node-red?

But I tested again the crop and so on... maybe I'm doing it wrong?

grafik

nicedevil007 commented 4 years ago

With the standard settings (crop 0) I get something like this:

grafik

alexkn commented 4 years ago

With Defer 2000 the map is drawn every 2 seconds, so overwhelming messages should not be the problem.

Crop x2 and Crop y2 should be larger, all coordinates are measured from the left or top edge.

My config: grafik

nicedevil007 commented 4 years ago

ok think I got it now :)