PimDoos / ha-sessy-examples

Example automations for using Sessy with Home Assistant
6 stars 3 forks source link

apexcharts-card tweaks #7

Closed Tazzios closed 4 months ago

Tazzios commented 4 months ago

Some small tweaks now: show: true en opposite: true added.

type: custom:apexcharts-card
header:
  show: true
  title: Today
  show_states: true
  colorize_states: true
span:
  start: day
now:
  show: true
yaxis:
  - id: power
    decimals: 0
    opposite: true
  - id: price
    decimals: 2
series:
  - entity: sensor.sessy_XXXX_power_schedule
    yaxis_id: power
    name: Power Schedule
    curve: stepline
    data_generator: |
      let hours = [];
      for(var i = 0; i < 24; i++){ hours.push(i); }
      let date = new Date().getTime();
      let dateindex = new Date(date).toISOString().split("T")[0];
      return hours.map((hour, index) => {
        let date = new Date(dateindex).setHours(hour,0,0);
        return [date, entity.attributes[dateindex][index]];
      });
  - entity: sensor.sessy_XXXX_energy_price
    yaxis_id: price
    name: Energy Price
    curve: stepline
    float_precision: 5
    data_generator: |
      let hours = [];
      for(var i = 0; i < 24; i++){ hours.push(i); }
      let date = new Date().getTime();
      let dateindex = new Date(date).toISOString().split("T")[0];
      return hours.map((hour, index) => {
        let date = new Date(dateindex).setHours(hour,0,0);
        return [date, entity.attributes[dateindex][index]];
      });
PimDoos commented 4 months ago

Looks nice!

PimDoos commented 4 months ago

Added, thanks! image