29 lines
723 B
Nix
29 lines
723 B
Nix
{ config, pkgs, ... }:
|
|
let
|
|
in {
|
|
services.home-assistant.customComponents = with pkgs.home-assistant-custom-components; [
|
|
epex_spot
|
|
];
|
|
|
|
services.home-assistant.config = {
|
|
sensor = [
|
|
{
|
|
platform = "template";
|
|
sensors = {
|
|
electricity_price = {
|
|
friendly_name = "Current Price of electricity";
|
|
unit_of_measurement = "EUR/kWh";
|
|
value_template = ''
|
|
{{ ((states('sensor.epex_spot_data_price') | float ) + (0.0149 + 0.074 + 0.007 + 0.0074 + 0.0006)) | float }}
|
|
'';
|
|
entity_id = [
|
|
"sensor.epex_spot_data_price"
|
|
"sensor.time"
|
|
];
|
|
};
|
|
};
|
|
}
|
|
];
|
|
};
|
|
}
|