Home Assistant : Q&A, Tips & Tricks, Your Configs

Priapus

Honorary Master
Joined
Jun 8, 2008
Messages
11,422

Tinuva

The Magician
Joined
Feb 10, 2005
Messages
12,478
Have you tried this card ? Tried it and literally grinded my home assistant pc to a halt where the page didn't respond at all. Tried with cahce enabled in the card and without, no diffirence. Even tried setting the update interval to 4 hours.
Yeah that screenshot is from my own home assistant.

Screenshot 2021-08-04 at 14.11.31.png

Interesting...its suppose to render client side? Works fine for me.

This is my code (mostly copied from another user):
Code:
type: custom:apexcharts-card
graph_span: 36h
span:
  start: day
  offset: '-6h'
header:
  show: true
  title: Solar Production vs. forecast
  show_states: true
now:
  show: true
  label: now
apex_config:
  legend:
    show: false
series:
  - entity: sensor.goodwe_ppv
    name: Actual
    unit: W
    fill_raw: last
    extend_to_end: false
    group_by:
      func: avg
      duration: 30min
  - entity: sensor.solcast_forecast_average_30min
    transform: return x * 1000;
    name: Forecast
    unit: W
    fill_raw: last
    extend_to_end: false
  - entity: sensor.solcast_forecast_data
    type: line
    extend_to_end: false
    unit: W
    show:
      in_header: false
    data_generator: |
      return entity.attributes.forecasts.map((entry) => {
         return [new Date(entry.period_end), entry.pv_estimate*1000];
       });

Source: https://community.home-assistant.io...ls-on-post-to-external-url-solcast/143238/116
 

w1tw0lf

Expert Member
Joined
Sep 29, 2009
Messages
1,192
This is pretty cool actually. Thanks for sharing
thank you.

Would love to get it into hacs as a custom component, but I am complete noob with python and I know from look/comparing/copying/pasting from other code :p

Trying to split where it shows clients on 2.4ghz and 5ghz per ap. The screenshot shared is from wifi 6 ap which uses different code for this and works. My other 2 ap's are both wifi 5 and shows the total for both on each cards. Only my wifi 6 ap shows correct.
 

w1tw0lf

Expert Member
Joined
Sep 29, 2009
Messages
1,192
Yeah that screenshot is from my own home assistant.

View attachment 1120238

Interesting...its suppose to render client side? Works fine for me.

This is my code (mostly copied from another user):
Code:
type: custom:apexcharts-card
graph_span: 36h
span:
  start: day
  offset: '-6h'
header:
  show: true
  title: Solar Production vs. forecast
  show_states: true
now:
  show: true
  label: now
apex_config:
  legend:
    show: false
series:
  - entity: sensor.goodwe_ppv
    name: Actual
    unit: W
    fill_raw: last
    extend_to_end: false
    group_by:
      func: avg
      duration: 30min
  - entity: sensor.solcast_forecast_average_30min
    transform: return x * 1000;
    name: Forecast
    unit: W
    fill_raw: last
    extend_to_end: false
  - entity: sensor.solcast_forecast_data
    type: line
    extend_to_end: false
    unit: W
    show:
      in_header: false
    data_generator: |
      return entity.attributes.forecasts.map((entry) => {
         return [new Date(entry.period_end), entry.pv_estimate*1000];
       });

Source: https://community.home-assistant.io...ls-on-post-to-external-url-solcast/143238/116

Strange... must be using a pc for home assistant server with more power than me.

Have a look at https://github.com/RomRider/apexcharts-card
1628080024205.png
 
Last edited:

Tinuva

The Magician
Joined
Feb 10, 2005
Messages
12,478
Strange... must be using a pc for home assistant server with more power than me.

Have a look at https://github.com/RomRider/apexcharts-card
View attachment 1120266
Interesting.

My HA runs on a Minnowboard Turbot which has this CPU: Intel(R) Atom(TM) CPU E3826 @ 1.46GHz
2 cores and 2GB ram only. The only fast part on it is the SSD I am running on it. A Pi4 should be faster.

ps. the default setting for cache is true, so it should be using cache by default.

I think the part that is maybe slow for you is when it hits your database for the data points for the graph. Are you running on sd-card, normal hdd, usb or ssd?
 

xrapidx

Honorary Master
Joined
Feb 16, 2007
Messages
40,312
Need a bit of advice, is there anything with both temp input and dimming capabilities? I want to run dimmable IR bulbs - and dim them based on temp - preferably as one unit.
 

w1tw0lf

Expert Member
Joined
Sep 29, 2009
Messages
1,192
Interesting.

My HA runs on a Minnowboard Turbot which has this CPU: Intel(R) Atom(TM) CPU E3826 @ 1.46GHz
2 cores and 2GB ram only. The only fast part on it is the SSD I am running on it. A Pi4 should be faster.

ps. the default setting for cache is true, so it should be using cache by default.

I think the part that is maybe slow for you is when it hits your database for the data points for the graph. Are you running on sd-card, normal hdd, usb or ssd?

Running on an old Lenovo ThinkCentre with Intel(R) Celeron(R) CPU J1800 @ 2.41GHz with 2 cores, 4gb ram and ssd. Which in should be very close with similar performance.

Will check again as I had a few issues with my pc when I tried it. Testing windows 11 :p Or it might have been the graph_span that I used. See you have 36 hours. Under correction I was trying 30 days. Wanted a graph that showed 30 days usage per day of total data usage per day.
 

TedLasso

Expert Member
Joined
Feb 23, 2016
Messages
3,760
Need a bit of advice, is there anything with both temp input and dimming capabilities? I want to run dimmable IR bulbs - and dim them based on temp - preferably as one unit.
Don't know if this helps, but I was pretty impressed (but not thoroughly ) with the Shelley DW2 sensors. The WiFi magnetic switch has both a lux and temperature sensor so using that as in input you could Dim lights.

Why I am not thoroughly impressed :- I put them on doors that don't open often (maybe once or twice a month) - front door / scullery door. We use another door to get into house. As they don't trigger (because door doesn't open) , they drop off the network or stop reporting data. One of them , batteries did not even last two week (also only opened once a week). It was in WiFi range but at the edge of coverage so think it ate those CR123 batteries quickly.

For the doors that are opened regularly , they are working fine. Screenshot_2021-08-04-15-47-11-591_allterco.bg.shelly.jpg
 

Tinuva

The Magician
Joined
Feb 10, 2005
Messages
12,478
Running on an old Lenovo ThinkCentre with Intel(R) Celeron(R) CPU J1800 @ 2.41GHz with 2 cores, 4gb ram and ssd. Which in should be very close with similar performance.

Will check again as I had a few issues with my pc when I tried it. Testing windows 11 :p Or it might have been the graph_span that I used. See you have 36 hours. Under correction I was trying 30 days. Wanted a graph that showed 30 days usage per day of total data usage per day.
ok woah 30 days is a lot, depending on how you select the data I guess. Pretty sure that wont be fast.
 

w1tw0lf

Expert Member
Joined
Sep 29, 2009
Messages
1,192
ok woah 30 days is a lot, depending on how you select the data I guess. Pretty sure that wont be fast.
Tried again and it seems like it works with few days, but the moment you start pushing for a lot like 30 days, it kills the server. Would have been nice to have a graph for that, but then it is over kill as well. :cool:
 

Tinuva

The Magician
Joined
Feb 10, 2005
Messages
12,478
Tried again and it seems like it works with few days, but the moment you start pushing for a lot like 30 days, it kills the server. Would have been nice to have a graph for that, but then it is over kill as well. :cool:
What you want to graph 30 days of?
 

w1tw0lf

Expert Member
Joined
Sep 29, 2009
Messages
1,192
Was more playing around than wanted one... as a nice to have. But no stress. Nuked the idea.

To give an idea, I have one page that purely monitor and control everything on my network, from a nas to proxmox, printer, vm's, docker, printer and all my network switch/ap's and so on. Thought it might be "nice" to tracker daily data usage for fiber
 

Tinuva

The Magician
Joined
Feb 10, 2005
Messages
12,478
Was more playing around than wanted one... as a nice to have. But no stress. Nuked the idea.

To give an idea, I have one page that purely monitor and control everything on my network, from a nas to proxmox, printer, vm's, docker, printer and all my network switch/ap's and so on. Thought it might be "nice" to tracker daily data usage for fiber
you need to generate a single daily value for each entity, then I am sure it will be quick to graph if you read 1 entry per day instead of 5 min intervals spread over the day (if not seconds etc).
 

w1tw0lf

Expert Member
Joined
Sep 29, 2009
Messages
1,192
you need to generate a single daily value for each entity, then I am sure it will be quick to graph if you read 1 entry per day instead of 5 min intervals spread over the day (if not seconds etc).
will play around tomorrow., thanks
 

Tinuva

The Magician
Joined
Feb 10, 2005
Messages
12,478
ok the new energy dash is pretty cool now that I have set it up. Didnt take long as I already have all the sensors...well most. Some I still need to set up.

Screenshot 2021-08-04 at 18.15.20.png
Screenshot 2021-08-04 at 18.15.36.png
 
Top