Skip to content

CurrentCost Home Assistant Custom Component

Notifications You must be signed in to change notification settings

jysaloma/CurrentCost_HA_CC

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CurrentCost Custom Component for Home Assistant

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

Configuration

To setup a CurrentCost sensor to your installation:

  1. Create a folder called custom_components in your config folder (same folder where configuration.yaml is locate, if that folder does not already exist)
  2. Create a folder called currentcost (no spaces, lowercase)
  3. Copy the files from this repo into the currentcost folder
  4. Add the following to your configuration.yaml file under the sensor 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

serial_port:

description: Local serial port where the sensor is connected and access is granted.
required: true
type: string

name:

description: Friendly name to use for the frontend. Default to "Current Cost".
required: false
type: string

baudrate:

description: Baudrate of the serial port. 57600 is the value needed for EnviR devices.
required: false
default: 57600 Bps
type: integer

devices:

description: List of appliance numbers paired with a CurrentCost sensor
required: false
default: 0
type: integer

About

CurrentCost Home Assistant Custom Component

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%