This repo is a custom component for Home Assistant
The currentcost
sensor platform is using the data provided by a CurrentCost device connected to the serial port via a data cable.
The sensor returns the Total Power (usually on Appliance 0) as a state, and the temperature as an attribute. It is also possible to list additional appliances by listing the appliance number that CurrentCost devices are paired with
Confirmed working devices:
- Currentcost EnviR
To setup a CurrentCost sensor to your installation:
- Create a folder called
custom_components
in your config folder (same folder where configuration.yaml is locate, if that folder does not already exist) - Create a folder called
currentcost
(no spaces, lowercase) - Copy the files from this repo into the
currentcost
folder - Add the following to your
configuration.yaml
file under thesensor
header:
# Example configuration.yaml entry
- platform: currentcost
serial_port: /dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller-if00-port0
name: Current Cost
baudrate: 57600
devices:
- 0
- 2
- 9
- platform: template
sensors:
currentcost_temperature:
entity_id: sensor.current_cost
unit_of_measurement: '°C'
value_template: '{{ state_attr("sensor.current_cost", "Temperature")[:-3] | float }}'
friendly_name: CurrentCost Temperature
currentcost_power:
entity_id: sensor.current_cost
unit_of_measurement: 'W'
value_template: '{{ state_attr("sensor.current_cost", "Appliance 0")[:-2] | int }}'
friendly_name: CurrentCost Power
dehumidifier_power:
entity_id: sensor.current_cost
unit_of_measurement: 'W'
value_template: '{{ state_attr("sensor.current_cost", "Appliance 2")[:-2] | int }}'
friendly_name: Dehumidifier Power
description: Local serial port where the sensor is connected and access is granted.
required: true
type: string
description: Friendly name to use for the frontend. Default to "Current Cost".
required: false
type: string
description: Baudrate of the serial port. 57600 is the value needed for EnviR devices.
required: false
default: 57600 Bps
type: integer
description: List of appliance numbers paired with a CurrentCost sensor
required: false
default: 0
type: integer