Some angular help

Hi All,

My lights are displaying usage correctly in Watts, but I’d like to add a real time usage in kW which my Zwave items show fine.

My code is as below, its displaying 1.24KW despite there only being about 23.4Ws used

Can someone help ? Thankyou

<div class="value">{{itemValue('LivingRoomNum2')*1 + itemValue('KitchenNum2')/1000 | number:2}} kW</div>

Do I understand right, LivingRoomNum2 and KitchenNum2 are values in W and you want to sum them and show as kWh?

Hello @hr3 thats correct.

The Zwave item has a kw channel, i am adding both channels of the KW together. The channels display in KW i believe, not Watts

Num1 is Watts for both Lights. Num2 is KW/Hours

  <div class="widget">
			<div class="icon off"><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/squidink.svg#thunder-1"></use></svg></div>
			<div class="name">Power</div>
			<div class="valueGroup">
        <div class="value">{{itemValue('LivingRoomNum2')*1 + itemValue('KitchenNum2') | number:2}} kW</div>
        <div class="value">{{itemValue('LivingRoomNum1')}} W (Living)</div>
        <div class="value">{{itemValue('KitchenNum1')}} W (Kitchen)</div>
        </div>			
		</div>
<div class="value">{{(itemValue('LivingRoomNum2')*1 + itemValue('KitchenNum2')*1)/1000}} kW</div>
1 Like

Don’t confuse W and Wh
W is power
Wh is energy, not the same thing

If a light bulb generates 10W it uses 10Wh or 36000 Joules in one hour
As light bulb generating 1W uses 1 Joule per second

Your energy meter for your house for example is exactly that, an ENERGY meter. It mesure the amount of POWER your house uses and integrates it over TIME to get the ENERGY supplied.

Thank you! @hr3

@vzorglub hmmm. My Fibaro has a kwh meter and a watt meter. Are you saying what Im computing isnt accurate? Im confused now :smiley:

No, it means that the Fibaro make the integration itself and provide you with both power and energy usage figure.

As Vincent says. W=(Watt) is NOT the same as Wh (Watt/hour).

You´r Fibraro do the calculation for you,

When Fibraro shows Wh, it shows the generated Energy the light has consumed, calculated in hours.
When Fibraro shows Watt, is shows you the actual power consuming when the light is ON.

If you want to calculate yourself, then you need to understand the difference between W and Wh. And then you have to calculate from what Vincent says.

One 10Watt bulb set to ON (max dimming assumed) in one hour, will have consumed 10Wh Energy.
In two hours, it will have generated 20Wh of Energy.

In practice, (assuming your Fibraro has been reset til zero):
When you turn ON the above 10Watt bulb, Fibraro will show 10W consuming in real time.
After one hour with light set to ON, Fibraro will show 10Wh as well, as this is the power consumed in one hour. Also called Energy. (Fibraro shows this data in real time as well, because it do the calculation for you).

Totalt energy consuming Wh will be the sum of all time the light has been set to ON. This is the energy you will be charged for as well, from you power/grid supplier. (electric company).

Another example:
A 500Watt “thing” turned ON for 10 minutes, will have consumed 500/6 = 83.33Wh Energy after one hour.
If you turn it ON twice within the same hour, or leave it ON for 20 minutes, it would be 500/3 = 166.66Wh Energy in an hour.

This calculation can be done for normal restistance (Ohm) things. Don´t know the exact word in english. But a few things is a bit more complex to calculate, ie transformers, 2/3-phase motors, electric heaters etc. To calculate those, you´ll have to include cos/fi as well, (as far as I remember), which makes it rather complex. But most stuff in a normal household can be calculated direct from the above.

not generated, consumed

The bulb generates power by using energy

1 Like

Correct, typo mistake… to many consume/generate words I guess :wink:

Understood. I dont want to reinvent the wheel or do calculations, just display what Fibaro already tells me :slight_smile:

So my Watt channel is displaying my actual power consumed , and the KW/h is my energy usage for the hour. Thats great. Thats all I need

Fibraro Watt channel is displaying, actual power using (or generating).
Fibraro kWh channel is displaying, actual energy consumed.

This is a screendump from my Fibraro dimmer in the control panel of PaperUI.

Notice:
“Electric Meter (kWh)”
and
“Electric Meter (watts)”

I assume these are the items you´re searching for?

1 Like

@Kim_Andersen

Yes, ive had no issues in locating the items. I just wantd to display them, correctly in HabPanel.

If Electric Meter (kWh) is usage, does that number just increase over time, ie when the lights go on/off it will just keep going up and is not reset?

Yes, it will be the total amount of Energy.

1 Like

When you turn off the lights, watt = 0 and Wh will keep still. It will start to increase again when you turn on the power.

1 Like

Great! :slight_smile: thanks guys!

Does anyone know why when the item turns on it doesnt turn green as per patricks Matrix theme?

When its open, it should be green. And grey when closed… Ie open = on, closed = off


<div class="section">

	<div class="sectionIconContainer"><div class="sectionIcon"><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/squidink.svg#window"></use></svg></div></div>
	<div class="title">Gate</div>
	<div class="controls"></div>      
      
      <div class="widget" ng-click="sendCmd('GateFullyProxy', 'ON')">
      <div class="icon off" ><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/matrixicons.svg#on"></use></svg></div>
      <div class="name">Open/Close Full</div>
    </div>

     <div class="widget" ng-click="sendCmd('GatePartialProxy', 'ON')">
      <div class="icon off" ><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/matrixicons.svg#on"></use></svg></div>
      <div class="name">Open/Close Partial</div>
    </div>
    
      <div class="widget" ng-if="itemValue('Gate')!='Off'">
      <div class="icon off" ><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/matrixicons.svg#off"></use></svg></div>
      <div class="name">State: {{itemValue('Gate')}}</div>
                  
    </div>

Anyone? :frowning:

Ive racked my brain…

I cannot get the state to display, even when Ive got a contact for state and I cant get it to open/close consistently.

Surely someone knows how this works??

<div class="section">

	<div class="sectionIconContainer"><div class="sectionIcon"><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/squidink.svg#window"></use></svg></div></div>
	<div class="title">Gate</div>
	<div class="controls"></div>      
      
<div class="widget" ng-if="itemValue('GateFullyProxy')=='ON'" ng-click="sendCmd('GateFullyProxy', 'OFF')">
      <div class="icon off" ><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/matrixicons.svg#off"></use></svg></div>
      <div class="name">Open/Close {{itemValue('GateFullyProxy')}}</div>
    </div>
      <div class="widget" ng-if="itemValue('GateFullyProxy')=='OFF'" ng-click="sendCmd('GateFullyProxy', 'ON')">
      <div class="icon on" ><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/matrixicons.svg#on"></use></svg></div>
      <div class="name">Open/Close {{itemValue('GateFullyProxy')}}</div>
    </div>