CurrentCost Component for Home Assistant

It’s registering correctly with the one sensor.

Question: although timed tiers do not apply here as we have threshold based - up to 675 kWh is $0.0939, above that is $0.140, how do I set the Normal price on the CC128? I’ve set the low price and start time but then it simply asks for the normal price start time and does not ask what the normal price is…

I am unable to see sensor.total_energy as a source in HA Energy.
It has state_class: total_increasing and device_class: energy but it’s not showing


See https://www.home-assistant.io/more-info/statistics/.


Thanks.

I have no idea how to change the price on the CC128. Mine came preset and I never tried to adjust it.

Can you share the part of the config where you created the template sensor pls?

sensors.yaml:

  - 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
  # Add this sensor if you want to see data in the energy tab
  - platform: integration
    source: sensor.current_cost
    name: Total Energy
    unit_prefix: k
    round: 2

configuration.yaml:

template:
  - sensor:
      - name: "CurrentCost Temperature"
        unit_of_measurement: '°C'
        state: '{{ state_attr("sensor.current_cost", "Temperature") | float -3 }}' # Manual adjustment of -3°C in case the temp sensor is high than real temperature
        device_class: temperature
        state_class: measurement # Add state_class: measurement for long term statistics are required
  - sensor:
      - name: "CurrentCost Power"
        unit_of_measurement: 'W'
        state: '{{ state_attr("sensor.current_cost", "Appliance 0") }}'
        device_class: power
        state_class: measurement
#  - sensor:
#      - name: "Dehumidifier Power"
#        unit_of_measurement: 'W'
#        state: '{{ state_attr("sensor.current_cost", "Appliance 2") }}'
#        device_class: power
#        state_class: measurement
  - sensor:
      - name: "Total Energy Used Last 24h" # Note: this data is published by the Current Cost device every 2h
        state: '{{ state_attr("sensor.current_cost", "Appliance 0 Last 24h") }}'
        device_class: energy
        state_class: total_increasing
        unit_of_measurement: 'KWh'

  - sensor:
      - name: "Total Energy Used Last 30d"
        state: '{{ state_attr("sensor.current_cost", "Appliance 0 Last 30 days") }}'
        device_class: energy
        state_class: total_increasing
        unit_of_measurement: 'KWh'

I’ve done some reading up on statistic sensors (never used before) and now have this config:
packages/current_cost.yaml (updated 3/8/2022):

sensor:
  - platform: currentcost
    serial_port: /dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller-if00-port0
    name: Current Cost
    baudrate: 57600
    devices:
      - 0

# Integration
  - platform: integration
    name: Current Cost Total Energy
    source: sensor.current_cost
    unit_prefix: k
    round: 3

# Statistics
  - platform: statistics
    name: Current Cost Avg kWh
    entity_id: sensor.current_cost_kwh
    state_characteristic: mean
    sampling_size: 600

  - platform: statistics
    name: Current Cost Power Avg Watts Hourly
    entity_id: sensor.current_cost
    state_characteristic: mean
    sampling_size: 600

  - platform: statistics
    name: Current Cost Power Avg Watts Daily
    entity_id: sensor.current_cost
    state_characteristic: mean
    sampling_size: 14400

template:
  - sensor:
      - name: "Current Cost Temperature"
        unique_id: current_cost_temperature
        unit_of_measurement: '°F'
        state: '{{ state_attr("sensor.current_cost", "Temperature") | float(default=0) - 12 }}' # Manual adjustment of -3°C in case the temp sensor is high than real temperature
        device_class: temperature
        state_class: measurement # Add state_class: measurement for long term statistics are required
  - sensor:
      - name: "Current Cost Watts"
        unique_id: current_cost_watts
        state: '{{ state_attr("sensor.current_cost", "Appliance 0") }}'
        device_class: power
        state_class: measurement
        unit_of_measurement: 'W'
###
  - sensor:        
      - name: "Current Cost kWh"
        unique_id: current_cost_kwh
        state: "{{ states('sensor.current_cost')|float(default=0) / 1000 }}"
        device_class: energy
        state_class: measurement
        unit_of_measurement: 'kWh'
  - sensor:
      - name: "Current Cost kWh Last 24h" # Note: this data is published by the Current Cost device every 2h
        unique_id: current_cost_kwh_last_24h
        state: '{{ state_attr("sensor.current_cost", "Appliance 0 Last 24h") }}'
        device_class: energy
        state_class: measurement
        unit_of_measurement: 'kWh'
  - sensor:
      - name: "Current Cost kWh Last 30d" # Note: this data is published by the Current Cost device every 24h
        unique_id: current_cost_kWh_last_30d
        state: '{{ state_attr("sensor.current_cost", "Appliance 0 Last 30 days") }}'
        device_class: energy
        state_class: measurement
        unit_of_measurement: 'kWh'
  - binary_sensor:
      - name: Current Cost Monthly Energy Tariff Limit
        unique_id: current_cost_monthly_energy_tariff_limit
        state: '{{ states("sensor.monthly_energy_step_1")|float(default=0) >= states("sensor.number_of_days_in_this_month")|float(default=0) * 22.1918 }}'
        attributes:
          limit: '{{ states("sensor.number_of_days_in_this_month")|float(default=0) * 22.1918 }}'
          step_1: '{{ states("sensor.monthly_energy_step_1") }}'
          step_2: '{{ states("sensor.monthly_energy_step_2") }}'
          
utility_meter:
  daily_energy:
    source: sensor.current_cost_total_energy
    name: Daily Energy
    cycle: daily
    delta_values: false

  weekly_energy:
    source: sensor.current_cost_total_energy
    name: Weekly Energy
    cycle: weekly
    delta_values: false

  monthly_energy:
    source: sensor.current_cost_total_energy
    name: Monthly Energy
    cycle: monthly
    delta_values: false
    offset:
      days: 10
    tariffs:
      - step_1
      - step_2

Energy tab now offers my new sensor plus the one I should have seen initially from the currentcost integration (and have now re-named); not sure why it’s showing now…

Looks like I am off to the races…

1 Like

There are a couple of things you can do to enhance currentcost the first one is just to create a numeric input helper for the unit price. then you can easily change it when the unit price changes. the second is to break out the yaml into its own currentcost.yaml file.

# Configure a default setup of Home Assistant (frontend, api, etc)
homeassistant:
  packages: !include_dir_named integrations

What these 2 lines at the start of your configuration.yaml file do, is tell HomeAssistant to look in the integrations folder for yaml files.

so you need to create a directory called integrations and in that directory called integrations create a file called currentcost.yaml copy paste the yaml code given in the currentcost integration docs when you installed it from hacs and save it.

what you have done effectively is create a single integration module for currentcost and you shouldn’t have to touch it again unless there is an upgrade to the currentcost integration.

I highly recommend watching this video It goes into splitting configuration.yaml in detail.

Almost every tutorial on any integration says at some point put this yaml in your configuration.yaml file and it’s very bad advice! very little should go in your configuration.yaml file Instead create a new yaml file for each integration you add into a folder called integrations.

It makes it more modular for home assistant and bugs in one integration don’t affect your other integrations. This speeds up Home Assistant a lot and makes it easier to figure out where you have problems.

If I make an indentation wrong in my currentcost.yaml file my configuration will not validate and it will point to the offending line. If it passes validation and still doesn’t work right i know that that file is the first place to look.

In configuration.yaml errors in adding a new integration can lead to being told an existing line is now wrong and if you try to ‘fix’ that existing line it will just result in more lines of existing code being flagged as being wrong.

Maybe one of the best things is that the yaml that you are given to add to your configuration.yaml file is exactly the same as goes in your separate yaml integration file.

Your configuration.yaml file truly gets in a mess when you add a second or third integration.

You end up with sensors from integration A mixed with integration B and Integration C… This is a bit like using goto in basic as HA switches between A to B to A to C spaghetti code.

Much better to setup A then B then C by having A.yaml B.yaml and C.yaml just don’t use A or B C as filenames use a sensible name like currentcost.yaml and add comments.

I think HomeAssistant will setup little worker tasks. Separated that’s 3 workers for A B and C. Mixed together and you get one worker to do ABC together. That’s a problem because if A has to wait for something tasks B and C also wait.
This results in a slow unresponsive system.

Hopefully this is enough to convince you not to lump everything into configuration.yaml.

1 Like

Thanks John. I had done that initially using my utility bill total / # days in billing cycle. My utility company uses a stepped rate based on usage so the average cost will be close. The calculations they use are:
The threshold for the lower Step 1 rate is calculated by multiplying the number of days in the billing period by 22.1918 kWh per day.
Then:

So I went gone one step further last night after discovering the utility meter…

  daily_energy:
    source: sensor.current_cost_total_energy
    name: Daily Energy
    cycle: daily
    delta_values: false

  weekly_energy:
    source: sensor.current_cost_total_energy
    name: Weekly Energy
    cycle: weekly
    delta_values: false

  monthly_energy:
    source: sensor.current_cost_total_energy
    name: Monthly Energy
    cycle: monthly
    delta_values: false
    offset:
      days: 10
    tariffs:
      - step_1
      - step_2

I am billed monthly based on when the utility meter is read so I used an average # days per month (365 / 12) since I do not know exactly when they read the meter. My last meter reading was Aug 11 and billing period was July - Aug 10. My next meter reading is “on or around September 10”. I could go one step further and use the 10th each month which would be 28, 29, 30 or days.
3 input numbers:

A template trigger for when monthly kWh exceeds 22.1918 x 30.415

  - binary_sensor:
      - name: Current Cost Monthly Energy Tariff Limit
        state: >
          {% if states('sensor.monthly_energy_step_1')|float > 22.1918 * 30.417 %}
            true
          {% else %}
            false
          {% endif %}

And automations:

  mode: single
- id: '1630839102281'
  alias: BCHydro Monthly Tariff Change
  description: ''
  trigger:
  - platform: state
    entity_id: binary_sensor.current_cost_monthly_energy_tariff_limit
    to: 'off'
    id: step_1
  - platform: state
    entity_id: binary_sensor.current_cost_monthly_energy_tariff_limit
    to: 'on'
    id: step_2
  condition: []
  action:
  - service: utility_meter.select_tariff
    target:
      entity_id: utility_meter.monthly_energy
    data:
      tariff: '{{trigger.id}}'
  mode: single
- id: '1630839406053'
  alias: BCHydro Set Current Rate
  description: Sets the BCHydro Current Rate when the Tariff level changes
  trigger:
  - platform: state
    entity_id: utility_meter.monthly_energy
    to: step_1
    id: step_1_rate
  - platform: state
    entity_id: utility_meter.monthly_energy
    to: step_2
    id: step_2_rate
  condition: []
  action:
  - service: input_number.set_value
    target:
      entity_id: input_number.bchydro_current_rate
    data_template:
      value: '{{ states("input_number.bchydro_" + trigger.id) }}'
  mode: single

I’ve been running with a split configuration.yaml for a while now.

default_config:

homeassistant:
  customize: !include customize.yaml
  packages: !include_dir_named packages/

automation: !include automations.yaml
binary_sensor: !include binary_sensors.yaml
cover: !include covers.yaml
group: !include groups.yaml
light: !include lights.yaml
nest: !include nest.yaml
notify: !include notify.yaml
scene: !include scenes.yaml
script: !include scripts.yaml
sensor: !include sensors.yaml
switch: !include switches.yaml
.
.
.

template:
  - sensor:
      - name: "Current Cost Temperature"
        unit_of_measurement: '°C'
        state: '{{ state_attr("sensor.current_cost", "Temperature") | float -3 }}' # Manual adjustment of -3°C in case the temp sensor is high than real temperature
        device_class: temperature
        state_class: measurement # Add state_class: measurement for long term statistics are required
  - sensor:
      - name: "Current Cost Watts"
        unit_of_measurement: 'W'
        state: '{{ state_attr("sensor.current_cost", "Appliance 0") }}'
        device_class: power
        state_class: measurement
  - sensor:        
      - name: "Current Cost kWh"
        state: "{{ state_attr('sensor.current_cost_power_per_minute', 'total') / (1000 * 10) }}"
        device_class: power
        state_class: measurement
        unit_of_measurement: 'kWh'
  - binary_sensor:
      - name: Current Cost Daily Energy Tariff Limit
        state: >
          {% if states('sensor.daily_energy_step_1')|float > 22.1918 %}
            true
          {% else %}
            false
          {% endif %}
  - binary_sensor:
      - name: Current Cost Monthly Energy Tariff Limit
        state: >
          {% if states('sensor.monthly_energy_step_1')|float > 22.1918 * 30.417 %}
            true
          {% else %}
            false
          {% endif %}
utility_meter:
  daily_energy:
    source: sensor.current_cost_kWh
    name: Daily Energy
    cycle: daily
    tariffs:
      - step_1
      - step_2
  monthly_energy:
    source: sensor.current_cost_kWh
    name: Monthly Energy
    cycle: monthly
    tariffs:
      - step_1
      - step_2

I just need to do some re-work now and migrate from legacy templates to the modern configuration…

1 Like

Do you know where can I buy the data cable in Spain?
I already have the CC128 ENVI transmitter, jaw and display but I don’t have the data cable. And it is needed to use this very interesting component!

Have you tried eBay? That’s where I bought mine

Yes! But the transport and fees are more expensive than the cable itself. Thanks for your suggestion!

I know the cable did cost me quite a bit to buy in the UK.
Just wondering whether you could use “any” RJ45 to USB cable, or even build your own?
I can’t find anything that would prove or disprove this online…

recent changes mean float should now be written as float(0) before it had an assumed default value of 0 now it has a declared default value of 0

Current Cost Electricity2

Does anyone have any idea why I’m getting regular dips to ZERO in my electricity usage
I’m currently using 7 devices
2 OptiSmart sensors (1 on Solar generation Meter & 1 on Electricity Meter)
1 GaSmart (Gas Meter)
3 IAMS
The electricity is the only 1 doing this
Transmitter has had new batteries fitted to eliminate that possibility

Do you use a template for your CurrentCost Electricity sensor? If so can you share it?
I know a picture speaks a thousand words, but a few more details would help :wink:

1 Like

##########################

Current Cost EnviR

##########################

  - platform: currentcost
    serial_port: /dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller-if00-port0
    name: Current Cost
    baudrate: 57600
    devices:
      - 0
      - 1
      - 2
      - 3
      - 4
      - 5
      - 6
      - 7
      - 8
      - 9
  - platform: template
    sensors:
      currentcost_temperature:
        entity_id: sensor.current_cost
        unit_of_measurement: '°C'
        value_template: '{{ state_attr("sensor.current_cost", "Temperature")  }}'
        friendly_name: CurrentCost Temperature
      #currentcost_temperature_2:
        #entity_id: sensor.current_cost
        #unit_of_measurement: '°C'
        #value_template: "{{ (states('sensor.currentcost_temperature')| float) | round (1) }}"
        #friendly_name: CurrentCost Temperature 2
      currentcost_electricity:
        entity_id: sensor.current_cost
        unit_of_measurement: 'W'
        value_template: '{{ state_attr("sensor.current_cost", "Appliance 0")  }}'
        friendly_name: CurrentCost Electricity
      currentcost_electricity_2:
        entity_id: sensor.current_cost
        unit_of_measurement: 'kWh'
        value_template: "{{ (states('sensor.currentcost_electricity')| float /1000 | float) | round (3) }}"
        friendly_name: CurrentCost Electricity 2
      currentcost_garage_solar:
        entity_id: sensor.current_cost
        unit_of_measurement: 'W'
        value_template: '{{ state_attr("sensor.current_cost", "Appliance 1")  }}'
        friendly_name: CurrentCost Garage Solar
      currentcost_garage_solar_2:
        entity_id: sensor.current_cost
        unit_of_measurement: 'kWh'
        value_template: "{{ (states('sensor.currentcost_garage_solar')| float /1000 | float) | round (2) }}"
        friendly_name: CurrentCost Garage Solar 2
      currentcost_gas:
        entity_id: sensor.current_cost
        unit_of_measurement: 'W'
        value_template: "{{ (state_attr('sensor.current_cost', 'Appliance 2') | float *1.02264 | float *40.1 | float /3.6 | float) | round (3)  }}"
        friendly_name: CurrentCost Gas
      currentcost_gas_2:
        entity_id: sensor.current_cost
        unit_of_measurement: 'W'
        value_template: "{{ (states('sensor.currentcost_gas')| float) | round (0) }}"
        friendly_name: CurrentCost Gas 2
      currentcost_gas_3:
        entity_id: sensor.current_cost
        unit_of_measurement: 'kWh'
        value_template: "{{ (states('sensor.currentcost_gas')| float /1000 | float) | round (2) }}"
        friendly_name: CurrentCost Gas 3
      currentcost_gas_4:
        entity_id: sensor.current_cost
        unit_of_measurement: 'kWh'
        value_template: "{{ (states('sensor.currentcost_gas_2')| float +127 | float) | round (3) }}"
        friendly_name: CurrentCost Gas 4
      currentcost_shed_solar:
        entity_id: sensor.current_cost
        unit_of_measurement: 'W'
        value_template: '{{ state_attr("sensor.current_cost", "Appliance 3")  }}'
        friendly_name: CurrentCost Shed Solar
      currentcost_shed_solar_2:
        entity_id: sensor.current_cost
        unit_of_measurement: 'kWh'
        value_template: "{{ (states('sensor.currentcost_shed_solar')| float /1000 | float) | round (2) }}"
        friendly_name: CurrentCost Shed Solar 2
      #currentcost_shed_solar_3:
        #entity_id: sensor.current_cost
        #unit_of_measurement: 'W'
        #value_template: "{{ (states('sensor.currentcost_shed_solar')| float /1000 | float) | round (2) }}"
        #friendly_name: CurrentCost Shed Solar 3
      #currentcost_solar_iboost:
        #entity_id: sensor.current_cost
        #unit_of_measurement: 'W'
        #value_template: '{{ state_attr("sensor.current_cost", "Appliance 4") | float  }}'
        #friendly_name: CurrentCost Solar iBoost
      #currentcost_spare_1:
        #entity_id: sensor.current_cost
       # unit_of_measurement: 'W'
        #value_template: '{{ state_attr("sensor.current_cost", "Appliance 5") }}'
       # friendly_name: CurrentCost Spare 1
      #currentcost_spare_2:
        #entity_id: sensor.current_cost
       # unit_of_measurement: 'W'
        #value_template: '{{ state_attr("sensor.current_cost", "Appliance 6") }}'
       # friendly_name: CurrentCost Spare 2
      currentcost_electricity_meter:
        entity_id: sensor.current_cost
        value_template: "{{ (state_attr('sensor.current_cost', 'Impulses 7')| float /1000 +12.79 | float) | round (1) }}"
        friendly_name: CurrentCost Electricity Meter
      #currentcost_electricity_meter_2:
        #entity_id: sensor.current_cost
        #unit_of_measurement: 'kWh'
        #value_template: "{{ (state_attr('sensor.current_cost', 'Impulses 7')| float /1000 +12.78 | float) | round (1) }}"
        #friendly_name: CurrentCost Electricity Meter 2
      #currentcost_electricity_meter_3:
        #entity_id: sensor.current_cost
        #unit_of_measurement: 'kWh'
        #value_template: "{{ (states('sensor.currentcost_electricity_meter_2')| float) | round (1) }}"
        #friendly_name: CurrentCost Electricity Meter 3
      #currentcost_electricity_meter_4:
        #entity_id: sensor.current_cost
        #unit_of_measurement: 'kWh'
        #value_template: "{{ (states('sensor.currentcost_electricity_meter_2')| float) | round (1) }}"
        #friendly_name: CurrentCost Electricity Meter 4
      currentcost_garage_solar_meter:
        entity_id: sensor.current_cost
        value_template: "{{ (state_attr('sensor.current_cost', 'Impulses 8')| float /1000 +20.579 | float) | round (1) }}"
        friendly_name: CurrentCost Garage Solar Meter
      currentcost_garage_solar_meter_2:
        entity_id: sensor.current_cost
        #unit_of_measurement: 'kWh'
        value_template: "{{ (state_attr('sensor.current_cost', 'Impulses 8')| float /1000 +20.579 | float) | round (1) }}"
        friendly_name: CurrentCost Garage Solar Meter 2
      currentcost_garage_solar_meter_3:
        entity_id: sensor.current_cost
        unit_of_measurement: 'kWh'
        value_template: "{{ (states('sensor.currentcost_garage_solar_meter_2')| float) | round (3) }}"
        friendly_name: CurrentCost Garage Solar Meter 3
      currentcost_garage_solar_meter_4:
        entity_id: sensor.current_cost
        #unit_of_measurement: 'kWh'
        value_template: "{{ (states('sensor.currentcost_garage_solar_meter_2')| float) | round (1) }}"
        friendly_name: CurrentCost Garage Solar Meter 4
      currentcost_gas_meter:
        entity_id: sensor.current_cost
        value_template: "{{ (state_attr('sensor.current_cost', 'Impulses 9')| float /100 +15711.318 | float) | round (3) }}"
        friendly_name: CurrentCost Gas Meter
      currentcost_gas_meter_2:
        entity_id: sensor.current_cost
        #unit_of_measurement: 'kWh'
        value_template: "{{ (state_attr('sensor.current_cost', 'Impulses 9')| float /100 +15711.318 | float) | round (3) }}"
        friendly_name: CurrentCost Gas Meter 2
      currentcost_gas_meter_3:
        entity_id: sensor.current_cost
        unit_of_measurement: 'kWh'
        value_template: "{{ (states('sensor.currentcost_gas_meter')| float *1.02264 | float *40.1 | float /3.6 | float) | round (3) }}"
        friendly_name: CurrentCost Gas Meter 3
      currentcost_gas_meter_4:
        entity_id: sensor.current_cost
        #unit_of_measurement: 'kWh'
        value_template: "{{ (states('sensor.currentcost_gas_meter_2')| float) | round (3) }}"
        friendly_name: CurrentCost Gas Meter 4      
      currentcost_gas_meter_5:
        entity_id: sensor.current_cost
        unit_of_measurement: 'W'
        value_template: "{{ (states('sensor.currentcost_gas_meter_3')| float /1000 | float) | round (3) }}"
        friendly_name: CurrentCost Gas Meter 5 ```

Do you have a device on each channel (0-10)?
I wonder if this is what gives you a 0 when the component tries to get data from a chanel that has no device attached…
Can you also try and set your logging level to debug for the component and post the content once you’ve caught a 0 (ideally with an indication of the UTC time it happened)?
(be sure to then restore the logging level else it’ll flood your hard drive)
Add this to your configuration.yaml:

logger:
  default: error
  logs:
    custom_components.currentcost: debug

I’m currently not using device 4,5,6 & 7 so I’ve disabled them

I’ve set my log to debug so will post results when / if it catches a 0
Thanks for the help, much appreciated

This is a section of my log
The affected sensor is sensor 0 which has a hickup @ 06:38:47

2022-03-27 07:39:29 DEBUG (MainThread) [custom_components.currentcost.sensor] Line Received: <msg><src>CC128-v1.29</src><dsb>02606</dsb><time>06:38:26</time><tmpr>20.4</tmpr><sensor>2</sensor><id>02392</id><type>1</type><ch1><watts>00000</watts></ch1></msg>
2022-03-27 07:39:29 DEBUG (MainThread) [custom_components.currentcost.sensor] Line Received: <msg><src>CC128-v1.29</src><dsb>02606</dsb><time>06:38:26</time><tmpr>20.4</tmpr><sensor>0</sensor><id>02284</id><type>1</type><ch1><watts>00470</watts></ch1><ch2><watts>00000</watts></ch2><ch3><watts>00000</watts></ch3></msg>
2022-03-27 07:39:30 DEBUG (MainThread) [custom_components.currentcost.sensor] Line Received: <msg><src>CC128-v1.29</src><dsb>02606</dsb><time>06:38:26</time><tmpr>20.4</tmpr><sensor>1</sensor><id>03641</id><type>1</type><ch1><watts>00081</watts></ch1></msg>
2022-03-27 07:39:32 DEBUG (MainThread) [custom_components.currentcost.sensor] Line Received: <msg><src>CC128-v1.29</src><dsb>02606</dsb><time>06:38:29</time><tmpr>20.4</tmpr><sensor>6</sensor><id>03001</id><type>1</type><ch1><watts>00000</watts></ch1></msg>
2022-03-27 07:39:32 DEBUG (MainThread) [custom_components.currentcost.sensor] Line Received: <msg><src>CC128-v1.29</src><dsb>02606</dsb><time>06:38:29</time><tmpr>20.4</tmpr><sensor>3</sensor><id>03485</id><type>1</type><ch1><watts>00004</watts></ch1></msg>
2022-03-27 07:39:35 DEBUG (MainThread) [custom_components.currentcost.sensor] Line Received: <msg><src>CC128-v1.29</src><dsb>02606</dsb><time>06:38:32</time><tmpr>20.4</tmpr><sensor>2</sensor><id>02392</id><type>1</type><ch1><watts>00000</watts></ch1></msg>
2022-03-27 07:39:35 DEBUG (MainThread) [custom_components.currentcost.sensor] Line Received: <msg><src>CC128-v1.29</src><dsb>02606</dsb><time>06:38:32</time><tmpr>20.4</tmpr><sensor>1</sensor><id>03641</id><type>1</type><ch1><watts>00081</watts></ch1></msg>
2022-03-27 07:39:38 DEBUG (MainThread) [custom_components.currentcost.sensor] Line Received: <msg><src>CC128-v1.29</src><dsb>02606</dsb><time>06:38:35</time><tmpr>20.4</tmpr><sensor>6</sensor><id>03001</id><type>1</type><ch1><watts>00000</watts></ch1></msg>
2022-03-27 07:39:40 DEBUG (MainThread) [custom_components.currentcost.sensor] Line Received: <msg><src>CC128-v1.29</src><dsb>02606</dsb><time>06:38:37</time><tmpr>20.4</tmpr><sensor>0</sensor><id>02284</id><type>1</type><ch1><watts>00469</watts></ch1><ch2><watts>00000</watts></ch2><ch3><watts>00000</watts></ch3></msg>
2022-03-27 07:39:40 DEBUG (MainThread) [custom_components.currentcost.sensor] Line Received: <msg><src>CC128-v1.29</src><dsb>02606</dsb><time>06:38:37</time><tmpr>20.4</tmpr><sensor>2</sensor><id>02392</id><type>1</type><ch1><watts>00000</watts></ch1></msg>
2022-03-27 07:39:44 DEBUG (MainThread) [custom_components.currentcost.sensor] Line Received: <msg><src>CC128-v1.29</src><dsb>02606</dsb><time>06:38:41</time><tmpr>20.4</tmpr><sensor>6</sensor><id>03001</id><type>1</type><ch1><watts>00000</watts></ch1></msg>
2022-03-27 07:39:46 DEBUG (MainThread) [custom_components.currentcost.sensor] Line Received: <msg><src>CC128-v1.29</src><dsb>02606</dsb><time>06:38:42</time><tmpr>20.4</tmpr><sensor>3</sensor><id>03485</id><type>1</type><ch1><watts>00003</watts></ch1></msg>
2022-03-27 07:39:46 DEBUG (MainThread) [custom_components.currentcost.sensor] Line Received: <msg><src>CC128-v1.29</src><dsb>02606</dsb><time>06:38:43</time><tmpr>20.4</tmpr><sensor>1</sensor><id>03641</id><type>1</type><ch1><watts>00081</watts></ch1></msg>
2022-03-27 07:39:46 DEBUG (MainThread) [custom_components.currentcost.sensor] Line Received: <msg><src>CC128-v1.29</src><dsb>02606</dsb><time>06:38:43</time><tmpr>20.4</tmpr><sensor>9</sensor><id>01460</id><type>2</type><imp>0001625378</imp><ipu>0100</ipu></msg>
2022-03-27 07:39:50 DEBUG (MainThread) [custom_components.currentcost.sensor] Line Received: <msg><src>CC128-v1.29</src><dsb>02606</dsb><time>06:38:47</time><tmpr>20.4</tmpr><sensor>0</sensor><id>02284</id><type>1</type><ch1><watts>00000</watts></ch1></msg>
2022-03-27 07:39:51 DEBUG (MainThread) [custom_components.currentcost.sensor] Line Received: <msg><src>CC128-v1.29</src><dsb>02606</dsb><time>06:38:48</time><tmpr>20.4</tmpr><sensor>7</sensor><id>03588</id><type>2</type><imp>0030611706</imp><ipu>1000</ipu></msg>
2022-03-27 07:39:51 DEBUG (MainThread) [custom_components.currentcost.sensor] Line Received: <msg><src>CC128-v1.29</src><dsb>02606</dsb><time>06:38:48</time><tmpr>20.4</tmpr><sensor>8</sensor><id>04062</id><type>2</type><imp>0021174811</imp><ipu>1000</ipu></msg>
2022-03-27 07:39:52 DEBUG (MainThread) [custom_components.currentcost.sensor] Line Received: <msg><src>CC128-v1.29</src><dsb>02606</dsb><time>06:38:49</time><tmpr>20.4</tmpr><sensor>2</sensor><id>02392</id><type>1</type><ch1><watts>00000</watts></ch1></msg>
2022-03-27 07:39:52 DEBUG (MainThread) [custom_components.currentcost.sensor] Line Received: <msg><src>CC128-v1.29</src><dsb>02606</dsb><time>06:38:49</time><tmpr>20.4</tmpr><sensor>3</sensor><id>03485</id><type>1</type><ch1><watts>00004</watts></ch1></msg>
2022-03-27 07:39:56 DEBUG (MainThread) [custom_components.currentcost.sensor] Line Received: <msg><src>CC128-v1.29</src><dsb>02606</dsb><time>06:38:53</time><tmpr>20.4</tmpr><sensor>0</sensor><id>02284</id><type>1</type><ch1><watts>00464</watts></ch1><ch2><watts>00000</watts></ch2><ch3><watts>00000</watts></ch3></msg>
2022-03-27 07:39:57 DEBUG (MainThread) [custom_components.currentcost.sensor] Line Received: <msg><src>CC128-v1.29</src><dsb>02606</dsb><time>06:38:53</time><tmpr>20.4</tmpr><sensor>6</sensor><id>03001</id><type>1</type><ch1><watts>00000</watts></ch1></msg>
2022-03-27 07:39:57 DEBUG (MainThread) [custom_components.currentcost.sensor] Line Received: <msg><src>CC128-v1.29</src><dsb>02606</dsb><time>06:38:54</time><tmpr>20.4</tmpr><sensor>1</sensor><id>03641</id><type>1</type><ch1><watts>00081</watts></ch1></msg>
2022-03-27 07:39:57 DEBUG (MainThread) [custom_components.currentcost.sensor] Line Received: <msg><src>CC128-v1.29</src><dsb>02606</dsb><time>06:38:54</time><tmpr>20.4</tmpr><sensor>2</sensor><id>02392</id><type>1</type><ch1><watts>00000</watts></ch1></msg>
2022-03-27 07:39:59 DEBUG (MainThread) [custom_components.currentcost.sensor] Line Received: <msg><src>CC128-v1.29</src><dsb>02606</dsb><time>06:38:56</time><tmpr>20.4</tmpr><sensor>3</sensor><id>03485</id><type>1</type><ch1><watts>00003</watts></ch1></msg>
2022-03-27 07:40:01 DEBUG (MainThread) [custom_components.currentcost.sensor] Line Received: <msg><src>CC128-v1.29</src><dsb>02606</dsb><time>06:38:58</time><tmpr>20.4</tmpr><sensor>0</sensor><id>02284</id><type>1</type><ch1><watts>00469</watts></ch1><ch2><watts>00000</watts></ch2><ch3><watts>00000</watts></ch3></msg>
2022-03-27 07:40:02 DEBUG (MainThread) [custom_components.currentcost.sensor] Line Received: <msg><src>CC128-v1.29</src><dsb>02606</dsb><time>06:38:59</time><tmpr>20.4</tmpr><sensor>1</sensor><id>03641</id><type>1</type><ch1><watts>00086</watts></ch1></msg>
2022-03-27 07:40:03 DEBUG (MainThread) [custom_components.currentcost.sensor] Line Received: <msg><src>CC128-v1.29</src><dsb>02606</dsb><time>06:39:00</time><tmpr>20.4</tmpr><sensor>2</sensor><id>02392</id><type>1</type><ch1><watts>00000</watts></ch1></msg>
2022-03-27 07:40:05 DEBUG (MainThread) [custom_components.currentcost.sensor] Line Received: <msg><src>CC128-v1.29</src><dsb>02606</dsb><time>06:39:02</time><tmpr>20.4</tmpr><sensor>3</sensor><id>03485</id><type>1</type><ch1><watts>00003</watts></ch1></msg>
2022-03-27 07:40:06 DEBUG (MainThread) [custom_components.currentcost.sensor] Line Received: <msg><src>CC128-v1.29</src><dsb>02606</dsb><time>06:39:03</time><tmpr>20.4</tmpr><sensor>0</sensor><id>02284</id><type>1</type><ch1><watts>00467</watts></ch1><ch2><watts>00000</watts></ch2><ch3><watts>00000</watts></ch3></msg>
2022-03-27 07:40:08 DEBUG (MainThread) [custom_components.currentcost.sensor] Line Received: <msg><src>CC128-v1.29</src><dsb>02606</dsb><time>06:39:05</time><tmpr>20.4</tmpr><sensor>1</sensor><id>03641</id><type>1</type><ch1><watts>00086</watts></ch1></msg>
2022-03-27 07:40:0```

Sorry been kept busy at work.
I can’t think of a reason why you’re getting 0 watts.
The received line shows 0 watts so it would be an issue with the device itself. Maybe use a filter sensor to filter out the 0 value?

1 Like