Fibaro Wall plug inconsistant values

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
kryptonneke
Posts: 13
Joined: Tuesday 31 October 2017 11:18
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Fibaro Wall plug inconsistant values

Post by kryptonneke »

I've got a fibaro wall plug FGWPE-102 that can monitor electricity usage.

The plug exposes a number of devices in domoticz, one of which shows the current power usage (W)(type/subtype = usage/electricity) and the other that shows power usage & energy consumed (kWh) (type/subtype = energy/kwh).

I'm using the power usage reported to monitor when a washing machine starts and to send a noficication when the washer is finished. I've found a script on this site that I adapted to dzVentss like this.

Code: Select all


-- Check the wiki at
-- http://www.domoticz.com/wiki/%27dzVents%27:_next_generation_LUA_scripting
return {

	-- 'active' controls if this entire script is considered or not
	active = true, -- set to false to disable this script

	-- trigger
	on = {
		timer = {
			-- timer triggers.. if one matches with the current time then the script is executed
			'every minute'
		}
	},

	-- actual event code
	-- in case of a timer event or security event, device == nil
	execute = function(domoticz, device)
	    local title                 = "Wasmachine"
	    local powermeter_device     = 'kWh Meter Wasmachine'	            --Name of Z-Wave plug that contains actual consumption of washingmachine (in Watts)
	    local usage_device          = 'Usage Wasmachine'	                --Name of Z-Wave plug that contains actual consumption of washingmachine (in Watts)
	    
	    local status_uservar        = 'wasmachine_status'
        local counter_uservar       = 'wasmachine_counter'               --Name of the uservariable that will contain the counter that is needed
        
        local idle_minutes          = 10                                --The amount of minutes the consumption has to stay below the 'consumption_lower' value
        local consumption_upper     = 20                                --If usage is higher than this value (Watts), the washingmachine has started
        local consumption_lower     = 5.0                                --If usage is lower than this value (Watts), the washingmachine is idle for a moment/done washing
	    
        local myPowermeterDevice    = domoticz.devices(powermeter_device)
        local myUsageDevice         = domoticz.devices(usage_device)
        
        local myStatusVar           = domoticz.variables(status_uservar)
        local myCounterVar          = domoticz.variables(counter_uservar)
        
        
        --Actual start of the script
		domoticz.log('Checking ' .. title.. ' status:')
        
        domoticz.log(title .. ': Powermeter device used    : ' .. myPowermeterDevice.name)
        domoticz.log(title .. ': Last update               : ' .. myPowermeterDevice.lastUpdate.getISO())
        domoticz.log(title .. ': Usage                     : ' .. myPowermeterDevice.usage.. 'W')
        domoticz.log(title .. ': WhActual                  : ' .. myPowermeterDevice.WhActual.. 'W')
        
        --domoticz.log('-------------------------')
        --myWasherPowermeter.dump()
        
        domoticz.log('-------------------------')
        
        domoticz.log(title .. ': Usage device used         : ' .. myUsageDevice.name)
        domoticz.log(title .. ': Last update               : ' .. myUsageDevice.lastUpdate.getISO())
        domoticz.log(title .. ': WhActual                  : ' .. myUsageDevice.WhActual .. 'W')
        
        --domoticz.log('-------------------------')
        --myWasherUsage.dump()
        
        if (myPowermeterDevice.WhActual ~=  myUsageDevice.WhActual) then
            domoticz.log('-------------------------')
            domoticz.log(title .. ': USAGE FROM USAGE METER & POWER METER ARE NOT THE SAME!!!')
        end
        
        domoticz.log('-------------------------')
        
        domoticz.log(title .. ': Status     : ' .. myStatusVar.value)
        domoticz.log(title .. ': Counter    : ' .. myCounterVar.value)
	    

        local washer_usage = myUsageDevice.WhActual

		--Status is set to off and actual power used is below lower limit: Washing machine is off
		if (myStatusVar.value == 0) and (washer_usage <= consumption_lower) then
		   domoticz.log('Current power usage (' ..washer_usage.. 'W) remains below lower boundary (' ..consumption_lower.. 'W), ' .. title .. ' is off')
		end
		
		--Status is set to off but actual power used is above upper limit: Washing machine has started
		if (myStatusVar.value == 0) and (washer_usage > consumption_upper) then
		    myStatusVar.set(1)
            domoticz.log('Current power usage (' ..washer_usage.. 'W) is above upper boundary (' ..consumption_upper.. 'W), so ' .. title .. ' has started!')
            myCounterVar.set(idle_minutes)
        end
        
        --Status is set to on but actual power used is above upper limit: Washing machine is still washing
		if (myStatusVar.value == 1) and (washer_usage > consumption_upper) then
            domoticz.log('Current power usage (' ..washer_usage.. 'W) is above upper boundary (' ..consumption_upper.. 'W), so ' .. title .. ' is still washing')
            if (myCounterVar.value ~= idle_minutes) then
                myCounterVar.set(idle_minutes)
                domoticz.log('Resetting ' .. title .. ' Idle Timer')
            end 
        end
        
        --Status is set to on but actual power used is below lower limit: Washing machine is idle
		if (myStatusVar.value == 1) and (washer_usage <= consumption_lower) then
		    if (myCounterVar.value == idle_minutes) then
                domoticz.log('Current power usage (' ..washer_usage.. 'W) is below lower boundary (' ..consumption_lower.. 'W), ' .. title .. ' seems idle')
            else
                domoticz.log('Current power usage (' ..washer_usage.. 'W) is below lower boundary (' ..consumption_lower.. 'W), ' .. title .. ' has been idle for ' ..idle_minutes - myCounterVar.value .. ' minutes' )
            end
            myCounterVar.set(myCounterVar.value-1)
        end
        
        --Washing machine is done
        if (myStatusVar.value == 1) and (myCounterVar.value <= 0) then
            domoticz.log(title .. ' is done!')
            myStatusVar.set(0)
            domoticz.notify(title, 'The ' .. title .. ' is ready!', domoticz.PRIORITY_NORMAL)
        end
        
	end
}

Problem is that the values for power usage reported by the two 'devices' is not always consistent (especially at lower values).

What would be the preferred way of monitoring the state of the machine, use the power usage only device or the device that also reports energy consumption.

Besides that I find it so strange that a single plug can report two different values for the same parameter.
daand
Posts: 1
Joined: Wednesday 06 December 2017 12:02
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Fibaro Wall plug inconsistant values

Post by daand »

Did you ever found out why the Fibaro Wall Plug is sending inconsistent power measurements? I have the exact same issue and did send a support ticket to Fibaro about it. However, thery have not replied (yet?).

Below is my log over incoming values reported by the plug. When plug is off (no power consumption) everything is OK. But when plug is turned on and power is drawn every second measurement in the combined W/Wh channel is reporting 0 on the power usage. This is not correct and also it does not match the value of the single channel that reports only the power (without accumulated counter value).

Code: Select all

2017-12-06 01:03:29.181 LUA: Effekt: 0.0 (W)
2017-12-06 01:03:29.184 LUA: Förbrukning: 0.000;1110.000 (W;Wh)

2017-12-06 01:35:50.199 LUA: Förbrukning: 0.000;1110.000 (W;Wh)

2017-12-06 02:03:29.180 LUA: Effekt: 0.0 (W)
2017-12-06 02:03:29.184 LUA: Förbrukning: 0.000;1110.000 (W;Wh)

2017-12-06 02:35:50.177 LUA: Förbrukning: 0.000;1110.000 (W;Wh)

2017-12-06 03:03:29.182 LUA: Effekt: 0.0 (W)
2017-12-06 03:03:29.185 LUA: Förbrukning: 0.000;1110.000 (W;Wh)

2017-12-06 03:35:50.174 LUA: Förbrukning: 0.000;1110.000 (W;Wh)

2017-12-06 04:03:29.173 LUA: Effekt: 0.0 (W)
2017-12-06 04:03:29.176 LUA: Förbrukning: 0.000;1110.000 (W;Wh)

2017-12-06 04:35:50.191 LUA: Förbrukning: 0.000;1110.000 (W;Wh)

2017-12-06 05:03:29.170 LUA: Effekt: 0.0 (W)
2017-12-06 05:03:29.174 LUA: Förbrukning: 0.000;1110.000 (W;Wh)

2017-12-06 05:35:50.168 LUA: Förbrukning: 0.000;1110.000 (W;Wh)

2017-12-06 06:03:29.172 LUA: Effekt: 0.0 (W)
2017-12-06 06:03:29.176 LUA: Förbrukning: 0.000;1110.000 (W;Wh)

2017-12-06 06:35:50.164 LUA: Förbrukning: 0.000;1110.000 (W;Wh)

2017-12-06 07:00:01.651 Schedule item started! Name: Brytare, Type: On Time, DevID: 3, Time: 2017-12-06 07:00:01
2017-12-06 07:00:01.652 OpenZWave: Domoticz has send a Switch command! NodeID: 2 (0x02)

2017-12-06 07:00:02.463 LUA: Effekt: 21.6 (W)
2017-12-06 07:00:02.466 LUA: Förbrukning: 21.600;1110.000 (W;Wh)

2017-12-06 07:35:50.183 LUA: Förbrukning: 0.000;1130.000 (W;Wh)

2017-12-06 08:00:02.164 LUA: Effekt: 21.2 (W)
2017-12-06 08:00:02.168 LUA: Förbrukning: 21.200;1130.000 (W;Wh)

2017-12-06 08:35:50.162 LUA: Förbrukning: 0.000;1150.000 (W;Wh)

2017-12-06 09:00:02.160 LUA: Effekt: 21.3 (W)
2017-12-06 09:00:02.165 LUA: Förbrukning: 21.300;1150.000 (W;Wh)

2017-12-06 09:35:50.161 LUA: Förbrukning: 0.000;1170.000 (W;Wh)

2017-12-06 10:00:02.160 LUA: Effekt: 20.9 (W)
2017-12-06 10:00:02.164 LUA: Förbrukning: 20.900;1170.000 (W;Wh)

2017-12-06 10:35:50.180 LUA: Förbrukning: 0.000;1190.000 (W;Wh)

2017-12-06 11:00:02.160 LUA: Effekt: 21.2 (W)
2017-12-06 11:00:02.164 LUA: Förbrukning: 21.200;1190.000 (W;Wh)

2017-12-06 11:35:50.160 LUA: Förbrukning: 0.000;1210.000 (W;Wh)

2017-12-06 12:00:02.172 LUA: Effekt: 21.0 (W)
2017-12-06 12:00:02.175 LUA: Förbrukning: 21.000;1210.000 (W;Wh)
frustreerMeneer
Posts: 39
Joined: Tuesday 21 March 2017 11:56
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Fibaro Wall plug inconsistant values

Post by frustreerMeneer »

I'm experiencing the same problem.
Did you find a solution?
Clipboard01.jpg
Clipboard01.jpg (21.6 KiB) Viewed 441 times
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest