ilcato / homebridge-Fibaro-HC2

Homebridge plugin for Fibaro Home Center 2 (and Home Center Lite ...)
Apache License 2.0
66 stars 27 forks source link

Report Wall Plug as an HomeKit power consumption accessory #96

Open lboue opened 6 years ago

lboue commented 6 years ago

Hello,

Could you please add an HomeKit power consumption accessory mapped? I found few following exemples:

We can get this value from the Fibaro API http://:80/api/energy/now-3600/now/single/devices/power/

Exemple for my Fibaro Wall Plug FGWP101, I got the the current energy ('W' value):

Energy API call

http://<IP>:80/api/energy/now-3600/now/single/devices/power/56 
{"id":1,"kWh":0.0,"W":17.8,"min":0.5,"max":17.8,"avg":0.0}

Devis API call

{"id":56,"name":"Guirlande","roomID":1,"type":"com.fibaro.FGWP101","baseType":"com.fibaro.FGWP","enabled":true,"visible":true,"isPlugin":false,"parentId":30,"remoteGatewayId":0,"interfaces":["deviceGrouping","energy","fibaroFirmwareUpdate","light","power","zwave","zwaveAlarm","zwaveConfiguration","zwaveSlaveRouting"],"properties":{"parameters":[{"id":1,"lastReportedValue":1,"lastSetValue":1,"size":1,"value":1},{"id":16,"lastReportedValue":1,"lastSetValue":1,"size":1,"value":1},{"id":34,"lastReportedValue":63,"lastSetValue":63,"size":1,"value":63},{"id":35,"lastReportedValue":0,"lastSetValue":0,"size":1,"value":0},{"id":39,"lastReportedValue":600,"lastSetValue":600,"size":2,"value":600},{"id":40,"lastReportedValue":80,"lastSetValue":80,"size":1,"value":80},{"id":42,"lastReportedValue":15,"lastSetValue":15,"size":1,"value":15},{"id":43,"lastReportedValue":30,"lastSetValue":30,"size":1,"value":30},{"id":45,"lastReportedValue":10,"lastSetValue":10,"size":1,"value":10},{"id":47,"lastReportedValue":3600,"lastSetValue":3600,"size":2,"value":3600},{"id":49,"lastReportedValue":1,"lastSetValue":1,"size":1,"value":1},{"id":50,"lastReportedValue":300,"lastSetValue":300,"size":2,"value":300},{"id":51,"lastReportedValue":500,"lastSetValue":500,"size":2,"value":500},{"id":52,"lastReportedValue":6,"lastSetValue":6,"size":1,"value":6},{"id":60,"lastReportedValue":25000,"lastSetValue":25000,"size":2,"value":25000},{"id":61,"lastReportedValue":1,"lastSetValue":1,"size":1,"value":1},{"id":62,"lastReportedValue":0,"lastSetValue":0,"size":1,"value":0},{"id":63,"lastReportedValue":1,"lastSetValue":1,"size":1,"value":1},{"id":70,"lastReportedValue":65535,"lastSetValue":65535,"size":2,"value":65535}],"pollingTimeSec":0,"zwaveCompany":"Fibargroup","zwaveInfo":"3,3,52","zwaveVersion":"25.25","alarmLevel":"0","alarmType":"0","color":"white","configured":true,"dead":"false","deviceControlType":"2","deviceGroup":"[]","deviceGroupMaster":"0","deviceIcon":"124","emailNotificationID":"0","emailNotificationType":"0","endPointId":"0","energy":"766.42","firmwareUpdate":"{\"info\":\"\",\"progress\":0,\"status\":\"UpToDate\",\"updateVersion\":\"25.25\"}","icon":"{\"path\":\"fibaro/icons/com.fibaro.FGWP_EU/plug1.png\",\"source\":\"HC\"}","isLight":"true","liliOffCommand":"","liliOnCommand":"","log":"","logTemp":"","manufacturer":"","markAsDead":"true","model":"","nodeId":"2","parametersTemplate":"225","power":"17.80","productInfo":"1,15,6,0,16,0,25,25","pushNotificationID":"0","pushNotificationType":"0","remoteGatewayId":"0","saveLogs":"true","serialNumber":"","showEnergy":"true","smsNotificationID":"0","smsNotificationType":"0","updateVersion":"","useTemplate":"true","userDescription":"","value":"true"},"actions":{"associationGet":1,"associationSet":2,"getParameter":1,"reconfigure":0,"reset":0,"setParameter":2,"turnOff":0,"turnOn":0,"updateFirmware":1},"created":1515007566,"modified":1515007566,"sortOrder":22}

Regards, Ludovic

darrenmcuk commented 6 years ago

yes that would be great to see this

HajLender commented 6 years ago

It would be great!

Dakkerad commented 6 years ago

I have a switch that does this aswell, I can see current consumption, overall, and today. The edomoticz example has them all