Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added basic support for Hive Active Plug #48

Closed
wants to merge 6 commits into from

Conversation

matchett808
Copy link
Contributor

I'll fixup the power reporting at some point, but for now, here's the plug itself

@matchett808
Copy link
Contributor Author

Further testing reveals this is 💩 - not getting all the events (turnon/turnoff) propogating back to hass, checked it out and they aren't making to MQTT, it's a start but needs more

@Koenkk
Copy link
Owner

Koenkk commented Aug 9, 2018

Maybe you need to try something like:

        configure: (ieeeAddr, shepherd, coordinator, callback) => {
            const device = shepherd.find(ieeeAddr, 1);
            const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0};
            const actions = [
                (cb) => device.bind('genOnOff', coordinator, cb),
                (cb) => device.foundation('genOnOff', 'configReport', [cfg], foundationCfg, cb),
            ];

            execute(device, actions, callback);
        },

@matchett808
Copy link
Contributor Author

So - this is mostly working with your changes - here's the DB:

{"id":12,"type":"Router","ieeeAddr":"0x001e5e0902293394","nwkAddr":16447,"manufId":4153,"manufName":"Computime","powerSource":"Mains (single phase)","modelId":"SLP2b","epList":[9],"status":"offline","joinTime":null,"endpoints":{"9":{"profId":260,"epId":9,"devId":81,"inClusterList":[0,1,2,3,4,5,6,9,1026,1794],"outClusterList":[25],"clusters":{"genBasic":{"dir":{"value":1},"attrs":{"65533":1,"zclVersion":1,"appVersion":20,"stackVersion":2,"hwVersion":1,"manufacturerName":"Computime","modelId":"SLP2b","dateCode":"20170215","powerSource":1}},"genPowerCfg":{"dir":{"value":1},"attrs":{"65533":1,"mainsVoltage":2467,"mainsFrequency":25}},"genDeviceTempCfg":{"dir":{"value":1},"attrs":{"65533":1,"currentTemperature":54}},"genIdentify":{"dir":{"value":1},"attrs":{"65533":1,"identifyTime":0}},"genGroups":{"dir":{"value":1},"attrs":{"65533":1,"nameSupport":128}},"genScenes":{"dir":{"value":1},"attrs":{"65533":1,"count":0,"currentScene":0,"currentGroup":0,"sceneValid":0,"nameSupport":128}},"genOnOff":{"dir":{"value":1},"attrs":{"65533":1,"onOff":1}},"genAlarms":{"dir":{"value":1},"attrs":{"65533":1}},"genOta":{"dir":{"value":2},"attrs":{}},"msTemperatureMeasurement":{"dir":{"value":1},"attrs":{"65533":1,"measuredValue":0,"minMeasuredValue":0,"maxMeasuredValue":0}},"seMetering":{"dir":{"value":1},"attrs":{"65533":1,"currentSummDelivered":{"0":0,"1":1},"powerFactor":-1,"status":0,"unitOfMeasure":0,"multiplier":1,"divisor":1000,"summaFormatting":0,"demandFormatting":0,"historicalConsumpFormatting":0,"meteringDeviceType":0,"instantaneousDemand":0}}}}},"_id":"1w9MlU2K1J9iWl9k"}

What's interesting is:

  • msTemperatureMeasurement- this is the same as the motion sensor has, but unfortunately I don't get a message at all
    -Think this line is wrong:
    (cb) => device.report('haElectricalMeasurement', 'activePower', 10, 1000, 1, cb),

In fact - it definately is, it's seMetering rather than haElec...ment - onwards and etc lol

@matchett808
Copy link
Contributor Author

Most recently I've been doing this:

            const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0};                                                             
            const IODcfg = {direction: 0, attrId: 1024, dataType: 42, minRepIntval: 0, maxRepIntval: 1000, repChange: 1};                                                       
                                                                                                                                                                                
                                                                                                                                                                                
            const actions = [                                                                                                                                                   
                (cb) => device.bind('genOnOff', coordinator, cb),                                                                                                               
                (cb) => device.foundation('genOnOff', 'configReport', [cfg], foundationCfg, cb),                                                                                
                                                                                                                                                                                
                (cb) => device.bind('genPowerCfg', coordinator, cb),                                                                                                            
                (cb) => device.foundation('genPowerCfg', 'configReport', [cfg], foundationCfg, cb),                                                                             
                (cb) => device.report('seMetering', 'instantaneousDemand', 10, 60, 1, cb),  // Just added this - as an alternative to the next 2 lines, doesn't work though                                                                                                                                                                                
                (cb) => device.bind('seMetering', coordinator, cb),                                                                                                             
                (cb) => device.foundation('seMetering', 'configReport',  [IODcfg], foundationCfg, cb),                                                                          
            ]; 

Feel like it's almost there - found some useful info here: https://github.com/mozilla-iot/wiki/wiki/Zigbee-Attributes

Testing is v. slow as I'm trying not to bork my full environement lol - it does fail to configure them, will get the debug log and be in touch 👍

@matchett808
Copy link
Contributor Author

🎉
It's working

  1. msTemp is a red herring, it's always 0 (lazy hive devs)
  2. no Idea what unit the power consumption is reported in (Watts? my drill charger can't be 30W though, can it? - maybe)
  3. fixing the PR

@matchett808
Copy link
Contributor Author

@Koenkk This is good from my eye and tests - PLO

@matchett808
Copy link
Contributor Author

Not sure if I'm just being a spoon but can't PR the other repo -

'SLP2b': [configurations.switch, configurations.sensor_power],

Above line needs added to lib/homeassistant.js

@matchett808
Copy link
Contributor Author

Little bit of research shows that drill chargers can be anywhere from a few watts up to 300, the hive app never reports usage (unused feature 🎉) so can't take a guess from there - this can be merged while I do further research (gotta work out a way to do that first though lol)

@Koenkk
Copy link
Owner

Koenkk commented Aug 24, 2018

When pressing the button on the plug, do you see any No converters available message?

@matchett808
Copy link
Contributor Author

matchett808 commented Aug 25, 2018

Ooo - I hadn't checked my logs, but was looking at adding the smartthings multi sensor (another version than is currently supported) I see the converter message periodically now - this is likely to asking it to report 'genOnOff':


2018-8-25 15:30:48 - warn: No converter available for 'SLP2b' with cid 'genOnOff', type 'attReport' and data '{"cid":"genOnOff","data":{"onOff":1}}'
2018-8-25 15:30:48 - warn: No converter available for 'SLP2b' with cid 'genOnOff', type 'devChange' and data '{"cid":"genOnOff","data":{"onOff":1}}'
2018-8-25 15:30:48 - warn: No converter available for 'SLP2b' with cid 'genOnOff', type 'devChange' and data '{"cid":"genOnOff","data":{"onOff":1}}'
2018-8-25 15:30:48 - warn: No converter available for 'SLP2b' with cid 'seMetering', type 'devChange' and data '{"cid":"seMetering","data":{"instantaneousDemand":4}}'
2018-8-25 15:30:53 - warn: No converter available for 'SLP2b' with cid 'msTemperatureMeasurement', type 'attReport' and data '{"cid":"msTemperatureMeasurement","data":{"measuredValue":0}}'

Will look into this further 👍

@Koenkk
Copy link
Owner

Koenkk commented Aug 25, 2018

Ok good, I think the generic_state converter can be used for this.

@tb-killa
Copy link
Contributor

@matchett808
you could test this:

with latest converters (master branch):
remove and ignore: fz.hiveInstantDemandMetering => fromZigbee.js

on devices,js section replace

fromZigbee: [fz.hiveInstantDemandMetering],

to

fromZigbee: [fz.generic_state,fz.ignore_onoff_change,fz.EDP_power,fz.ignore_metering_change,fz.generic_temperature,fz.ignore_temperature_change],

and test again.

you shouldn´t see any warn messages anymore :)
Please report.

@Koenkk We should rename EDP_power to something like generic_power and populate!

@Koenkk
Copy link
Owner

Koenkk commented Jan 6, 2019

Closed due to inactivity

@Koenkk Koenkk closed this Jan 6, 2019
xmow49 pushed a commit to xmow49/zigbee-herdsman-converters that referenced this pull request Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants