cokeman0 / OpenEpaperElectricPriceTag

OpenEpaper Electric price tag with 12h graf
7 stars 1 forks source link

Change lowest point? #1

Closed svenove closed 10 months ago

svenove commented 10 months ago

I use the nordpool version and I’ve added all the taxes to the price in it. This means the price will never be below 0,30 kr. The graph seems to go from 0, making the bars a bit high, even on low prices (0,50 kr, etc).

How can I change so that the bottom of the graph is considered to be 0,3 instead of 0?

cokeman0 commented 10 months ago

Hi, Well you can add some offset, but I don't think thats a good idea. as you will have a strange graf, if/when the prices go below 0, as we sometimes see here in denmark

      y_start: >-
        {{ grafbottom if pris2[11]|float() == 9999.9999 else
        (grafbottom)-(pris2[11]|float()*(maxgrafhigh)/highprice)|int(0) }}

part 1= "grafbottom if pris2[11]|float() == 9999.9999" Will default to grafbottom, when there is no data for the hour to display part 2 " (grafbottom)-(pris2[11]|float()(maxgrafhigh)/highprice)|int(0)" is the part you will need to manipulate, without having a test setup, my guess will be " (grafbottom)-(pris2[11]-0.5|float()(maxgrafhigh)/highprice)|int(0)" but you need to edit every 12 bars, and remember pris2[X], where you need to adjust X the the bar you are changing

svenove commented 10 months ago

Someone had made a new version (based on yours, I belive). There I could change this on one line, instead of once per bar, so I ended up using that automation instead.

Original here: https://pastebin.com/Qmcfd2dz?fbclid=IwAR2OpZR4wdUUXx8E4QuHQOT5iSV8S5UXPYH6vp2lGcUd-RtBm8Hgi14pDZ0

Changed these two:

"r_fill" : ("red" if (pris2[i] >= highprice3 and i < pris2_count) else "white" if (pris2[i] <= lowprice3 and i < pris2_count) else "black"), and: "t2_y" : (grafbottom - grafpriceoffset - (((pris2[i]-zero_offset)*(maxgrafhigh)/(highprice-zero_offset))|int if (i < pris2_count and pris2[i] > zero_offset) else 0)),