Home Assistant beginners

What’re you trying to do? Measure the electricity usage and cost of individual devices or your home as a whole?
Individual device tracking through the Tapo plugs I have and an overall cost with history.

I've got this so far.

pmTnOXl.png


I've installed the Octopus Energy Integration along with PowerCalc but I have absolutely no idea where to go from here.

I'd like to be able to see the energy usage and associated cost of each of the Tapo plugs (will be adding some more today) along with with history. So I can look back and [for example] see that my office used xx kW of electricity last Wednesday and it cost me £xx.xx.

I'd like to see the same for the entire home as well.
 
You can try adding something like this to your config yaml (get the Studio Code Server add-on from the Add Ons page).

template:
- sensor:
- name: "Cost today"
unit_of_measurement: "£"
state: >
{% set consumption = states('sensor.garden_room_ac_today_s_consumption') | float %}
{% set rate = states('sensor.dcc_sourced_smart_electricity_meter_rate') | float %}
{{ ((consumption * rate)) | round(1, default=0) }}


Then go to dev tools and refresh your YAML

You can then add "Cost today" as a sensor to a widget (you can give them all unique names).

Might need some trouble shooting depending on how your Octopus plugin reports tariff. But that'll take the current value and multiply by the current consumption.

Edit: seems to be working @Feek

SyKyClC.png
 
Last edited by a moderator:
A few weeks ago I transferred all my Hive TRVs, boiler control, and thermostat to Zigbee2MQTT with minimal issues. Today I completed the transfer of all my Hue devices - bulbs (Hue and Innr), four switches and a couple of motion detectors. The hardest thing was altering my various automations to pick up the new device names. In total it only took me about four hours. The only thing that tripped me up was that the latest update to Zigbee2MQTT (version 2) meant the switch buttons weren't exposed and I had to turn on Home Assistant Experimental Event Entities in Zigbee2MQTT.

The advantages of Hive and Hue devices on the Zigbee2MQTT network is that I now have only one Zigbee network instead of three which should greatly reduce Wifi and Zigbee interference. The Hive hub especially seemed to put out a very strong signal or was perhaps on a channel that interfered with the wifi as when it was turned off, I noticed stronger and more stable connections for my 2.4Ghz wifi devices. The other advantage is that now that Hive and Hue both required cloud connections to work with HA. Now this has been removed and everything is now local, operations are noticeably faster eg Press a smart light switch and the light comes on instantaneously rather than there being a brief delay.

In short, if you're starting out with HA then consider a Zigbee dongle mandatory and work from there!
 
Edit: seems to be working @Feek

Oh good, thanks.

I couldn't use the file editor you suggested, it seems to crash the HA Pi - I'm only using an old 3B for this as my spare 4 is now being used elsewhere. If I can get it to do what I want, I'll use a better device.

Error loading /config/configuration.yaml: while scanning for the next token
found character '%' that cannot start any token
in "/config/configuration.yaml", line 20, column 2

I edited the two lines with what I think are the correct choices.

JZxASX7.png
 
<snip>

Your/ Dlockers indentation hasn't translated correctly on the copy and paste. @dlockers - if you use the code insert button then the YAML should be correct and Feek can copy/ paste it right into his config file
 
Code:
template:
  - sensor:
      - name: "Cost today"
        unit_of_measurement: "£"
        state: >
          {% set consumption = states('sensor.garden_room_ac_today_s_consumption') | float %}
          {% set rate = states('sensor.octopus_energy_electricity_19l2262519_1012474423759_current_rate') | float %}

          {{ ((consumption * rate)) | round(1, default=0) }}

I'm not sure it is working but that could be because I am selecting the wrong sensors - the maths seems to be OK and I think the path I am following is OK though. Will troubleshoot

(I just checked and its stuck at £1)
 
Last edited by a moderator:
You can try adding something like this to your config yaml (get the Studio Code Server add-on from the Add Ons page).

template:
- sensor:
- name: "Cost today"
unit_of_measurement: "£"
state: >
{% set consumption = states('sensor.garden_room_ac_today_s_consumption') | float %}
{% set rate = states('sensor.dcc_sourced_smart_electricity_meter_rate') | float %}
{{ ((consumption * rate)) | round(1, default=0) }}


Then go to dev tools and refresh your YAML

You can then add "Cost today" as a sensor to a widget (you can give them all unique names).

Might need some trouble shooting depending on how your Octopus plugin reports tariff. But that'll take the current value and multiply by the current consumption.

Edit: seems to be working @Feek

SyKyClC.png
good morning, thank you for introducing the Studio Code Server, as a new user of HAOS i fint it the best tool to edit config files. thank you
 
There's a few ways you can use them, have a read of this.

I've got a few defined in configuration.yaml:

Code:
template:
  - sensor:
      - name: "Internet Download"
        state: "{{ (states('sensor.uxg_wan_in_stats')|float(0)*8/1024/1024)|round(2) }}"
        unit_of_measurement: "Mbps"
      - name: "Internet Upload"
        state: "{{ (states('sensor.uxg_wan_out_stats')|float(0)*8/1024/1024)|round(2) }}"
        unit_of_measurement: "Mbps"

I can then call those sensors elsewhere. Such as:

Code:
type: gauge
entity: sensor.internet_download
name: " Download"
min: 0
max: 900
needle: true
severity:
  green: 0
  yellow: 750
  red: 850

Which gives this:
vdmAm2Z.jpeg


If you're a Facebook user then then the 'Home Assistant UK Community' group is very useful. There's people there that know HA extremely well and are keen to help out.
hello mate, what router you have? Would this work with Virgin Media Hub?
 
I've moved HA from an old RPi to an Intel NUC and I've sort of got the daily device consumption and cost sorted out but it will need some fettling.

In the meantime, looking at the energy tab in HA.

I've got this set for electricity.

URSj8pgl.png


And similar for gas.

The daily consumption figures look correct but why is the cost sitting at zero?

xVIRZIQ.png


My overview is showing all energy stuff is calculating properly.

Pbaub9bl.png
 
Answering my own question.

Gas was set to Current Accumulative rather than Current Consumption.

Prices have now started showing up after I posted - I guess it couldn't back calculate so it's only from when I set it up (at around 14:00, just before I posted above) rather than showing historical cost.
 
Added it through the energy configuration screen, the same way as the electricity one posted above.
oh I know but I mean how did you get it to show up, 3rd party device or something? I got smart meter and whilst electric shows up all I seem to be able to select is previous day cost cant see anything to put in the energy dashboard sensor.
 
oh I know but I mean how did you get it to show up, 3rd party device or something? I got smart meter and whilst electric shows up all I seem to be able to select is previous day cost cant see anything to put in the energy dashboard sensor.
You can use the Hildebrand Glow integration to do what Feek has shown there without a Mini too
 
When I first started HA, it discovered a load of stuff which I didn't want to do anything with at the time and so I deleted them all.

Now I think I'd like to look at some of them and see if I can use them - For example, one was my Draytek router, but I can't find any way to do this. There's no sign of Draytek as an integration. Can I kick this auto discovery off again so it finds everything?
 
When I first started HA, it discovered a load of stuff which I didn't want to do anything with at the time and so I deleted them all.

Now I think I'd like to look at some of them and see if I can use them - For example, one was my Draytek router, but I can't find any way to do this. There's no sign of Draytek as an integration. Can I kick this auto discovery off again so it finds everything?
Top right burger button -> show ignored/ show disabled
 
Back
Top Bottom