Power usage, not showing up, after connecting Fibaro home center

Hi guys,

After almost 3 years on the Domoticz platform, I gave it up that my problems would be fixed within this platform. Updates where becoming less frequent and I was keep having issues with my Z-wave devices.

So when I found out that Home assistant had the possibility to integrate a Fibaro Home center, I was thrilled. Bought an Fibaro HCL, kissed Domoticz goodbye and welcomed Home assistant on my server. :smile:

Loving it so far.
The diversity and the flexibility in dashboard setups is a big releaf in comparrison.
The Fibaro HCL, among other devices, is connected and is working, almost as I would expect.

One thing, I don’t be able to find out, is how to get the power consumption of my devices to show up in home assistant, wich is measured by my fibaro wall plugs. I can see the switch, the voltage and the current, but not the power usage. (see the attachements).
I searched the fora and the docs for a solution, but didn’t find it yet.

Hope anyone can tell me what I am doing wrong?

Hope to hear from you!

kind regards,

J.W.

The power usage might be an attribute of the switch. If you look at the developer tools (hammer icon) >> states, and type the name of the switch, it should show you the attributes.

Given you have Voltage and Amps reported, you essentially have power reported as well. If you would like a power sensor (in Watts), this is what template sensors are for!

A template sensor is a new sensor that you create that gets information from other sources. In this case, we’ll take the volts and amps reading from the switch and make a power sensor.

In your configuration.yaml, add a new sensor. If you don’t have any, create the ‘sensor:’ section. If you do have some, just add it under there.

sensor:
  - platform: template
    sensors:
      keuken_vaatwasser_power:
        friendly_name: "Power Monitor"
        unit_of_measurement: 'W'
        device_class: power
        # Value template is the 'state'. W = V*A
        value_template: "{{ (states('sensor.kueken_vaatwasser_78') | float) * (states('sensor.kueken_vaatwasser_79') | float) | round(2) }}"

Don’t worry too much about the syntax of that template. states(‘sensor.entity_id’) will return the value of the sensor. | float will convert the reported sensor value (as a string) into a float so we can do real math on it. Then I round it to 2 decimal places.

“{{ }}” basically means to convert everything inside those brackets to something else.

Now you should have a new sensor (sensor.keuken_vaatwasser_power) that you can use like any other sensor.

Hello Jim OConnor,

many thanks for the template and your suggestion to look under the developer tools.
I indeed can see the power usage of the fibaro devices. So it is indeed coming in.

I don’t have been able to try your solution, about adding the template. But I will sure give it a try coming weekend.
I will let you know!

Thanks for your help!

kind regards,

Hello Jim OConnor,

today I dived in to the template instructions and your suggested.
As I said I found the devices indeed via de developer tools.
See my attachement for what I see.

The power usage in Watts, is directly given by the smart plug, but I am not able to use it in a Dashboard.
I think I should make a sensor, wich shows the parameters given by the smart-plug.
But got no idea how.
Any suggestions?

hope to hear from you!

kind regards,

Julian

Hi Jim,

found it.
the energyconsumption of the smart plug is located in the attribute table.
I had to configure a sensor in configuraration.yaml a sensor, wich refers to this attribute.

After I did this, the sensor en the energy readings are available for an dashboard.
Works like a charm!

thanks for your help and pointing me in the right direction!

kind regards,

Julian

Can you explain how you did that? I have the same problem that it doesn’t show it in my dashboard

Since you never replied, I didn’t see these messages :frowning: I think I took a break and had something like 100 unread forums so I just clicked ‘mark all read’. If you reply directly, it goes into my inbox instead.

Sorry! But, I’m glad you were able to figure it out! Would have felt worse if the last thing you posed was “HELP”!

Only noticed because @Skaven posted so it showed up in my ‘unread’ box :stuck_out_tongue:

If you click the ‘reply’ button, it should auto reply to someone. If you want, you can put their name after an @ sign and it will also send them a direct message saying they were mentioned in a post (like I did with Skaven above).

1 Like

@JWM22 Can you explain how you did that? I have the same problem that it doesn’t show it in my dashboard

Hello Skaven,

sorry for my late response. I have some troubles with Hass.io supervisor, so I cannot acces my configuration.yaml.
But I think I fixed that, and now can acces my configuration.

You need to enter a sensor in your configuration.yaml, for the specific device of wich you want to see the energy-consumption.

When you go to the section "developmenttools (the one with the hammer icon) And look in the first tab, I think it is called "states" (mine is in dutch, so not sure what the english is for it) you can search for the entity wich should have the energy consumption, you can see with the state attributes there is the energy consumption.

As I understand it, you have to tell Home assistant, is has to show this value as an sensor. Therefore you have to add in your configuration.yaml a template for the sensor. 

Below an example for my fridge in the garage. 
After you added this to you configuration and reload it, you can add the sensor as an entity in your dashboard.

sensor koelkast:
  - platform: template
    sensors:
      fridge_sensor_current:
        friendly_name: "Energieverbruik Koelkast(garage)"
        entity_id: switch.garage_koelkast_29
        unit_of_measurement: 'w'
        value_template: "{{ state_attr('switch.garage_koelkast_29', 'current_power_w') }}"

Hope, this helps you!

kind regards.
```
2 Likes

Hi Jim,

thanks for you (bit late) :slight_smile: reply.
No problem, your tips lead me in the right direction and with help from some other topics, I was able to set it up in Home assistant, working flawlessly ever since.

So no problem you didn’t replied directly. It forced me to search on, And that helped me to get home in home assistant pretty fast! :smile:

1 Like