Home Assistant

Nordpool and ApexCharts-card

This are notes for me. Not for you.

	Install SSH
	Settings | Add-ons
	Terminal & SSH


	mkdir /homeassistant/www && cd /homeassistant/www && wget https://github.com/RomRider/apexcharts-card/releases/download/v2.1.2/apexcharts-card.js


	mkdir /homeassistant/custom_components/nordpool && cd /homeassistant/custom_components/nordpool
	wget https://github.com/custom-components/nordpool/archive/refs/tags/0.0.17.zip
	unzip 0.0.17.zip
	mv nordpool-0.0.17/custom_components/nordpool/* .


	Settings | Dashboard | Resources
	Add
	/local/apexcharts-card.js
	as JavaScripti module
	Reboot and refresh page with shift + F5!


	Create new template:
	{{ ((states('input_number.price_of_electricity_transfer_snt_kwh')|float + (states('sensor.nordpool_kwh_fi_eur_3_10_0')|float) * 1.255) / 100) | round(4) }}


	Add new Dashboard with ApexCharts-Card custom card:
	
	type: custom:apexcharts-card
	graph_span: 24h
	apex_config:
	  chart:
		height: 200px
	show:
	  last_updated: true
	experimental:
	  color_threshold: true
	header:
	  title: Nordpool (incl. VAT + margin) ver 2
	  show: true
	  show_states: true
	  colorize_states: true
	span:
	  start: day
	now:
	  show: true
	  label: Nyt
	series:
	  - entity: sensor.nordpool_kwh_fi_eur_3_10_0
		show:
		  extremas: true
		  in_header: raw
		  header_color_threshold: true
		type: column
		data_generator: |
		  return entity.attributes.raw_today.map((start, index) => {
			return [new Date(start["start"]).getTime(), entity.attributes.raw_today[index]["value"] * 1.255 + 0.41];
		  });
		color_threshold:
		  - value: 0
			color: darkgreen
			opacity: 1
		  - value: 5
			color: goldenrod
		  - value: 10
			color: darkred
		  - value: 15
			color: red