Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##### Kahden päivän näkymä #####
- type: custom:apexcharts-card
- update_interval: 15min
- graph_span: 2d
- span:
- start: day
- header:
- show: true
- title: ""
- show_states: false
- experimental:
- color_threshold: true
- now:
- show: true
- color: "#2b8c04"
- label: Nyt
- apex_config:
- chart:
- height: 250
- grid:
- padding:
- left: -11
- right: 18
- top: -10
- bottom: -5
- legend:
- show: false
- showForSingleSeries: true
- position: bottom
- offsetY: 7
- xaxis:
- labels:
- offsetX: 0
- offsetY: 0
- format: HH
- axisTicks:
- show: true
- borderType: solid
- color: "#121314"
- height: 8
- tooltip:
- enabled: false
- tooltip:
- enabled: true
- x:
- show: true
- format: klo HH:00
- "y":
- title: tt
- yaxis:
- - decimals: 1
- apex_config:
- forceNiceScale: true
- tickAmount: 8
- labels:
- offsetX: -14
- all_series_config:
- stroke_width: -1
- type: column
- float_precision: 2
- show:
- extremas: true
- legend_value: false
- in_header: false
- series:
- - entity: sensor.nordpool_kwh_fi_eur_3_10_0
- name: Sähkönhinta
- color: "#f57607"
- unit: snt/kWh
- data_generator: >
- const tomorrowValid = entity.attributes.tomorrow_valid; const todayData =
- entity.attributes.raw_today.map((start, index) => {
- // Adjust the timestamp by adding 30 minutes (30 * 60 * 1000 milliseconds)
- const timestamp = new Date(start["start"]).getTime() + 30 * 60 * 1000;
- return [timestamp, entity.attributes.raw_today[index]["value"]];
- });
- if (tomorrowValid === false) {
- return todayData; // Use raw_today data if tomorrow_valid is false
- } else {
- const tomorrowData = entity.attributes.raw_tomorrow.map((start, index) => {
- // Adjust the timestamp by adding 30 minutes (30 * 60 * 1000 milliseconds)
- const timestamp = new Date(start["start"]).getTime() + 30 * 60 * 1000;
- return [timestamp, entity.attributes.raw_tomorrow[index]["value"]];
- });
- const combinedData = [...todayData, ...tomorrowData];
- combinedData.sort((a, b) => a[0] - b[0]);
- return combinedData; // Use combined data if tomorrow_valid is true
- }
- extend_to: false
- color_threshold:
- - value: 1
- color: "#00ff00"
- - value: 1.5
- color: "#66ff66"
- - value: 2
- color: "#99ff66"
- - value: 2.5
- color: "#ccff66"
- - value: 3
- color: "#ccff33"
- - value: 4
- color: "#ffff00"
- - value: 5
- color: "#ffcc00"
- - value: 6
- color: "#ff9933"
- - value: 7
- color: "#ff6600"
- - value: 9
- color: "#ff0000"
- - value: 11
- color: "#cc0000"
- - value: 15
- color: "#a60000"
- - value: 19
- color: "#700c0c"
- - value: 26
- color: "#360f0f"
- ##### kuluvan päivän näkymä #####
- type: custom:apexcharts-card
- update_interval: 15min
- graph_span: 1d
- span:
- start: day
- header:
- show: true
- title: ""
- show_states: false
- experimental:
- color_threshold: true
- now:
- show: true
- color: "#2b8c04"
- label: Nyt
- apex_config:
- chart:
- height: 250
- grid:
- padding:
- left: -11
- right: 18
- top: -10
- bottom: -5
- legend:
- show: false
- showForSingleSeries: true
- position: bottom
- offsetY: 7
- xaxis:
- labels:
- offsetX: 0
- offsetY: 0
- format: HH
- axisTicks:
- show: true
- borderType: solid
- color: "#121314"
- height: 8
- tooltip:
- enabled: false
- tooltip:
- enabled: true
- x:
- show: true
- format: klo HH:00
- "y":
- title: tt
- yaxis:
- - decimals: 1
- apex_config:
- forceNiceScale: true
- tickAmount: 8
- labels:
- offsetX: -14
- all_series_config:
- stroke_width: -1
- type: column
- float_precision: 2
- show:
- extremas: true
- legend_value: false
- in_header: false
- series:
- - entity: sensor.nordpool_kwh_fi_eur_3_10_0
- name: Sähkönhinta
- color: "#f57607"
- unit: snt/kWh
- data_generator: >
- const tomorrowValid = entity.attributes.tomorrow_valid; const todayData =
- entity.attributes.raw_today.map((start, index) => {
- // Adjust the timestamp by adding 30 minutes (30 * 60 * 1000 milliseconds)
- const timestamp = new Date(start["start"]).getTime() + 30 * 60 * 1000;
- return [timestamp, entity.attributes.raw_today[index]["value"]];
- });
- if (tomorrowValid === false) {
- return todayData; // Use raw_today data if tomorrow_valid is false
- } else {
- const tomorrowData = entity.attributes.raw_tomorrow.map((start, index) => {
- // Adjust the timestamp by adding 30 minutes (30 * 60 * 1000 milliseconds)
- const timestamp = new Date(start["start"]).getTime() + 30 * 60 * 1000;
- return [timestamp, entity.attributes.raw_tomorrow[index]["value"]];
- });
- const combinedData = [...todayData, ...tomorrowData];
- combinedData.sort((a, b) => a[0] - b[0]);
- return combinedData; // Use combined data if tomorrow_valid is true
- }
- extend_to: false
- color_threshold:
- - value: 1
- color: "#00ff00"
- - value: 1.5
- color: "#66ff66"
- - value: 2
- color: "#99ff66"
- - value: 2.5
- color: "#ccff66"
- - value: 3
- color: "#ccff33"
- - value: 4
- color: "#ffff00"
- - value: 5
- color: "#ffcc00"
- - value: 6
- color: "#ff9933"
- - value: 7
- color: "#ff6600"
- - value: 9
- color: "#ff0000"
- - value: 11
- color: "#cc0000"
- - value: 15
- color: "#a60000"
- - value: 19
- color: "#700c0c"
- - value: 26
- color: "#360f0f"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement