ApexCharts card - A highly customizable graph card

Are you sure you didn’t spell anything wrong?

Shouldn’t it be something like this? (I’m using EnergyZero)
Note the capital letters.

    data_generator: |
      return entity.attributes.Prices.map((record, index) => {
        return [new Date(record.readingDate).getTime(), record.price];
      });

Reading the ‘series Options’ of the Apexcharts-card… next options can be removed from your card.
stroke_width: 2 → Change the width of the line. Only works for area and line
min: 0 → Only used when chart_type = radialBar
opacity: 1 → Is default value

1 Like

When doing this, the result at least is consistent, but doesn’t show any data.

When looking at sensor.nextenergy_average_electricity_price_today it shows the follwing filter attributes:

state_class: measurement
prices_today: 
- time: '2023-03-27 00:00:00+02:00'
  price: 0.35181
- time: '2023-03-27 01:00:00+02:00'
  price: 0.34553
>> a lot more

prices_tomorrow: 
- time: '2023-03-28 00:00:00+02:00'
  price: 0.35752
- time: '2023-03-28 01:00:00+02:00'
  price: 0.36425
>> a lot more

prices: 
- time: '2023-03-27 00:00:00+02:00'
  price: 0.35181
- time: '2023-03-27 01:00:00+02:00'
  price: 0.34553
>> a lot more

unit_of_measurement: €/kWh
attribution: Data provided by ENTSO-e Transparency Platform
device_class: monetary
icon: mdi:currency-eur
friendly_name: Average electricity price today (NextEnergy)

This what I see when reading my sensor:

Prices:
  - price: 0.11
    readingDate: '2023-03-26T23:00:00Z'
  - price: 0.11
    readingDate: '2023-03-27T00:00:00Z'
  - price: 0.1
    readingDate: '2023-03-27T01:00:00Z'

Maybe you have to change

 return entity.attributes.prices.map((record, index) => {

in

 return entity.attributes.prices_today.map((record, index) => {

                  return entity.attributes.prices_today.map((entry) => 
                  {
                    var date = new Date(entry.time);

                    return [date, entry.price];
                  });

Just to confirm, does this graph work on your other devices ?

I’m not really familiar with how to use the data_generator field, but I think this is where your problem lies.
Also because other cards work.
Maybe @Kertz1954 can and is willing to help you further.

Sorry. Replied to the wrong person.

Hi, yes, the non iOS 15.7 devices do work. The last data generator of @boheme61 does, the example of @complex1 I can’t get working at all.

Unfortunately the following code also results in an empty chart:

return entity.attributes.prices_today.map((entry) => 
                  {
                    var date = new Date(entry.time);

                    return [date, entry.price];
                  });

I agree, must be something which older versions of iOS just don’t accept. Just don’t get it.

What IOS version do u have problems with ?

OK, so you now have a data generator that works perfectly well on non iOS 15.7 devices.

I see from one of your posting the data format.

You say this “a lot more”. in it.

Just how many enties are the in total.

Mean while add the following line to your code.

cache: false

and test again.

The iOS which is not working is iOS 15.7.3, latest in the 15 branch.

Indeed, works great on non iOS 15.7 devices.

The entire attribtues:

state_class: measurement
prices_today: 
- time: '2023-03-27 00:00:00+02:00'
  price: 0.35181
- time: '2023-03-27 01:00:00+02:00'
  price: 0.34553
- time: '2023-03-27 02:00:00+02:00'
  price: 0.33933
- time: '2023-03-27 03:00:00+02:00'
  price: 0.33422
- time: '2023-03-27 04:00:00+02:00'
  price: 0.33556
- time: '2023-03-27 05:00:00+02:00'
  price: 0.33803
- time: '2023-03-27 06:00:00+02:00'
  price: 0.37963
- time: '2023-03-27 07:00:00+02:00'
  price: 0.42061
- time: '2023-03-27 08:00:00+02:00'
  price: 0.42996
- time: '2023-03-27 09:00:00+02:00'
  price: 0.3357
- time: '2023-03-27 10:00:00+02:00'
  price: 0.29925
- time: '2023-03-27 11:00:00+02:00'
  price: 0.28556
- time: '2023-03-27 12:00:00+02:00'
  price: 0.21125
- time: '2023-03-27 13:00:00+02:00'
  price: 0.21125
- time: '2023-03-27 14:00:00+02:00'
  price: 0.19658
- time: '2023-03-27 15:00:00+02:00'
  price: 0.18194
- time: '2023-03-27 16:00:00+02:00'
  price: 0.21125
- time: '2023-03-27 17:00:00+02:00'
  price: 0.30493
- time: '2023-03-27 18:00:00+02:00'
  price: 0.35825
- time: '2023-03-27 19:00:00+02:00'
  price: 0.41024
- time: '2023-03-27 20:00:00+02:00'
  price: 0.48797
- time: '2023-03-27 21:00:00+02:00'
  price: 0.42311
- time: '2023-03-27 22:00:00+02:00'
  price: 0.37755
- time: '2023-03-27 23:00:00+02:00'
  price: 0.35005

prices_tomorrow: 
- time: '2023-03-28 00:00:00+02:00'
  price: 0.35752
- time: '2023-03-28 01:00:00+02:00'
  price: 0.36425
- time: '2023-03-28 02:00:00+02:00'
  price: 0.35781
- time: '2023-03-28 03:00:00+02:00'
  price: 0.35195
- time: '2023-03-28 04:00:00+02:00'
  price: 0.35093
- time: '2023-03-28 05:00:00+02:00'
  price: 0.35879
- time: '2023-03-28 06:00:00+02:00'
  price: 0.40165
- time: '2023-03-28 07:00:00+02:00'
  price: 0.44561
- time: '2023-03-28 08:00:00+02:00'
  price: 0.44517
- time: '2023-03-28 09:00:00+02:00'
  price: 0.39457
- time: '2023-03-28 10:00:00+02:00'
  price: 0.36393
- time: '2023-03-28 11:00:00+02:00'
  price: 0.35018
- time: '2023-03-28 12:00:00+02:00'
  price: 0.34493
- time: '2023-03-28 13:00:00+02:00'
  price: 0.33844
- time: '2023-03-28 14:00:00+02:00'
  price: 0.34302
- time: '2023-03-28 15:00:00+02:00'
  price: 0.34935
- time: '2023-03-28 16:00:00+02:00'
  price: 0.35193
- time: '2023-03-28 17:00:00+02:00'
  price: 0.37024
- time: '2023-03-28 18:00:00+02:00'
  price: 0.41165
- time: '2023-03-28 19:00:00+02:00'
  price: 0.44695
- time: '2023-03-28 20:00:00+02:00'
  price: 0.41028
- time: '2023-03-28 21:00:00+02:00'
  price: 0.40452
- time: '2023-03-28 22:00:00+02:00'
  price: 0.39428
- time: '2023-03-28 23:00:00+02:00'
  price: 0.37288

prices: 
- time: '2023-03-27 00:00:00+02:00'
  price: 0.35181
- time: '2023-03-27 01:00:00+02:00'
  price: 0.34553
- time: '2023-03-27 02:00:00+02:00'
  price: 0.33933
- time: '2023-03-27 03:00:00+02:00'
  price: 0.33422
- time: '2023-03-27 04:00:00+02:00'
  price: 0.33556
- time: '2023-03-27 05:00:00+02:00'
  price: 0.33803
- time: '2023-03-27 06:00:00+02:00'
  price: 0.37963
- time: '2023-03-27 07:00:00+02:00'
  price: 0.42061
- time: '2023-03-27 08:00:00+02:00'
  price: 0.42996
- time: '2023-03-27 09:00:00+02:00'
  price: 0.3357
- time: '2023-03-27 10:00:00+02:00'
  price: 0.29925
- time: '2023-03-27 11:00:00+02:00'
  price: 0.28556
- time: '2023-03-27 12:00:00+02:00'
  price: 0.21125
- time: '2023-03-27 13:00:00+02:00'
  price: 0.21125
- time: '2023-03-27 14:00:00+02:00'
  price: 0.19658
- time: '2023-03-27 15:00:00+02:00'
  price: 0.18194
- time: '2023-03-27 16:00:00+02:00'
  price: 0.21125
- time: '2023-03-27 17:00:00+02:00'
  price: 0.30493
- time: '2023-03-27 18:00:00+02:00'
  price: 0.35825
- time: '2023-03-27 19:00:00+02:00'
  price: 0.41024
- time: '2023-03-27 20:00:00+02:00'
  price: 0.48797
- time: '2023-03-27 21:00:00+02:00'
  price: 0.42311
- time: '2023-03-27 22:00:00+02:00'
  price: 0.37755
- time: '2023-03-27 23:00:00+02:00'
  price: 0.35005
- time: '2023-03-28 00:00:00+02:00'
  price: 0.35752
- time: '2023-03-28 01:00:00+02:00'
  price: 0.36425
- time: '2023-03-28 02:00:00+02:00'
  price: 0.35781
- time: '2023-03-28 03:00:00+02:00'
  price: 0.35195
- time: '2023-03-28 04:00:00+02:00'
  price: 0.35093
- time: '2023-03-28 05:00:00+02:00'
  price: 0.35879
- time: '2023-03-28 06:00:00+02:00'
  price: 0.40165
- time: '2023-03-28 07:00:00+02:00'
  price: 0.44561
- time: '2023-03-28 08:00:00+02:00'
  price: 0.44517
- time: '2023-03-28 09:00:00+02:00'
  price: 0.39457
- time: '2023-03-28 10:00:00+02:00'
  price: 0.36393
- time: '2023-03-28 11:00:00+02:00'
  price: 0.35018
- time: '2023-03-28 12:00:00+02:00'
  price: 0.34493
- time: '2023-03-28 13:00:00+02:00'
  price: 0.33844
- time: '2023-03-28 14:00:00+02:00'
  price: 0.34302
- time: '2023-03-28 15:00:00+02:00'
  price: 0.34935
- time: '2023-03-28 16:00:00+02:00'
  price: 0.35193
- time: '2023-03-28 17:00:00+02:00'
  price: 0.37024
- time: '2023-03-28 18:00:00+02:00'
  price: 0.41165
- time: '2023-03-28 19:00:00+02:00'
  price: 0.44695
- time: '2023-03-28 20:00:00+02:00'
  price: 0.41028
- time: '2023-03-28 21:00:00+02:00'
  price: 0.40452
- time: '2023-03-28 22:00:00+02:00'
  price: 0.39428
- time: '2023-03-28 23:00:00+02:00'
  price: 0.37288

unit_of_measurement: €/kWh
attribution: Data provided by ENTSO-e Transparency Platform
device_class: monetary
icon: mdi:currency-eur
friendly_name: Average electricity price today (NextEnergy)

I added the cache, and will check.

Ok, Well i’ve never had iOS, and never even a Latest version of Android :slight_smile:

iPad Air 2
iOS 15.7.3

What is the generation of your iPad Air 2 ?

If it’s below the 4th generation, then it’s no longer supported by the HA iOS Companion App.

End of story if this is the case.

well, maybe for the app, but one could always try a browser window?

otoh, it will become more and more obsolete… pretty quickly

What a terrifying thought. :laughing:

That would generate more questions in this community thread, my graph is not working with IE. :grimacing:

Must drop the subject now, only 2 days to go and I have to bring my beta system inline with my live version.

I’ll just settle with this ;-). I managed to fix it by working around it. A different sensor from a different dynamic energy price provider does work.

Thanks all for your effort!

My Apex Charts change over time, as I’m tracking solar consumption as well as household loads.

I would like to be able to make a 24 hour screen capture video of the changes in the card over a day, maybe taking a snapshot every hour. I have searched but haven’t been able to identify a simple way, short of leaving my desktop running with a screen grabber.

Does anyone have an elegant solution to this problem?


t