Skip to content

Commit

Permalink
Home Assistant
Browse files Browse the repository at this point in the history
  • Loading branch information
fboundy committed Apr 26, 2024
1 parent 25cf139 commit 0374ff2
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 0 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
__pycache__/
*.sqlite3
.git
home_assistant/
Binary file modified api/__pycache__/views.cpython-312.pyc
Binary file not shown.
75 changes: 75 additions & 0 deletions home_assistant/apex_chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
type: custom:apexcharts-card
apex_config: null
header:
show: true
show_states: true
colorize_states: true
graph_span: 7d
yaxis:
- id: price
decimals: 0
apex_config:
tickAmount: 8
stacked: false
span:
start: day
series:
- entity: sensor.octopus_energy_electricity_19m*******_************_current_rate
name: Actual Agile Import (current rate)
transform: return x * 100;
show:
in_chart: false
unit: p/kWh
- entity: >-
event.octopus_energy_electricity_19m*******_************_current_day_rates
yaxis_id: price
name: Actual Agile Import (current day)
color: yellow
opacity: 1
stroke_width: 2
extend_to: now
type: column
unit: p/kWh
data_generator: |
return entity.attributes.rates.map((entry) => {
return [new Date(entry.start), entry.value_inc_vat*100];
});
offset: '-15min'
show:
in_header: false
legend_value: false
offset_in_name: false
- entity: event.octopus_energy_electricity_19m*******_************_next_day_rates
yaxis_id: price
name: Actual Agile Import (next day)
color: yellow
opacity: 1
stroke_width: 2
type: column
unit: p/kWh
data_generator: |
return entity.attributes.rates.map((entry) => {
return [new Date(entry.start), entry.value_inc_vat*100];
});
offset: '-15min'
show:
in_header: false
legend_value: false
offset_in_name: false
- entity: sensor.agile_predict
yaxis_id: price
name: Predicted Agile
color: red
opacity: 1
stroke_width: 3
extend_to: now
unit: p/kWh
data_generator: |
return entity.attributes.prices.map((entry) => {
return [new Date(entry.date_time), entry.agile_pred];
});
offset: '-15min'
show:
in_header: false
legend_value: false
offset_in_name: false
12 changes: 12 additions & 0 deletions home_assistant/sensor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
sensor:
- platform: rest
resource: https://prices.fly.dev/api/G
scan_interval: 900
name: Agile Predict
value_template: "{{ value_json[0]['name']}}"
json_attributes_path: "$[0]"
json_attributes:
- "created_at"
- "prices"


0 comments on commit 0374ff2

Please sign in to comment.