1
0

Add 3d printer power consumption

This commit is contained in:
Przemek Grondek 2021-08-22 18:31:28 +02:00
parent aa26eb8698
commit 78dc5dccc0

View File

@ -325,19 +325,6 @@ sensor:
port: 993
username: 'home-assistant@nerull7.info'
password: !secret imap_password
# Fix 3d_printer power sensor
- platform: integration
source: sensor.3d_printer_power
name: energy_spent
unit_prefix: k
round: 2
# - platform: filter
# entity_id: sensor.3d_printer_power
# filters:
# - filter: range
# lower_bound: 0
# unit_prefix: k
# round: 2
binary_sensor:
- name: Desktop
@ -550,3 +537,20 @@ input_number:
max: 3
step: 1
icon: "mdi:weather-windy"
template:
- sensor:
- name: "3d_printer_kWh"
friendly_name_template: "3D printer energy (Total)"
unit_of_measurement: "kWh"
state_class: measurement
device_class: energy
state: >
{% set power = states('sensor.3d_printer_energy') | float %}
{% if (power > 0) %}
{{ power }}
{% else %}
{{ states('sensor.3d_printer_kWh') }}
{% endif%}
attributes:
last_reset: '1970-01-01T00:00:00+00:00'