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.
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.
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.
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!
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?
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!
Since you never replied, I didnât see these messages 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
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).
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.
```
thanks for you (bit late) 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!