-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Support: Innr SP 120 smart plug #588
Comments
Can you try with {
zigbeeModel: ['SP 120'],
model: 'SP 120',
vendor: 'Innr',
description: 'Smart Plug',
supports: 'on/off, power measurement',
fromZigbee: [fz.generic_state, fz.ignore_onoff_change, fz.ignore_electrical_change, fz.SP120_power],
toZigbee: [tz.onoff],
configure: (ieeeAddr, shepherd, coordinator, callback) => {
const device = shepherd.find(ieeeAddr, 1);
const cfgOnOff = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0};
const cfgVoltage = {direction: 0, attrId: 1285, dataType: 33, minRepIntval: 10, maxRepIntval: 1000, repChange: 1};
const cfgCurrent = {direction: 0, attrId: 1288, dataType: 33, minRepIntval: 10, maxRepIntval: 1000, repChange: 1};
const cfgPower = {direction: 0, attrId: 1291, dataType: 41, minRepIntval: 10, maxRepIntval: 1000, repChange: 1};
const actions = [
(cb) => device.bind('genOnOff', coordinator, cb),
(cb) => device.foundation('genOnOff', 'configReport', [cfgOnOff], foundationCfg, cb),
(cb) => device.foundation('haElectricalMeasurement', 'configReport', [cfgVoltage], foundationCfg, cb),
(cb) => device.foundation('haElectricalMeasurement', 'configReport', [cfgCurrent], foundationCfg, cb),
(cb) => device.foundation('haElectricalMeasurement', 'configReport', [cfgPower], foundationCfg, cb),
];
execute(device, actions, callback);
},
}, |
Thx @Koenkk for your reply. No errors after start of zigbee2mqtt:
How often would the electrical measurement be reported in the console? No output after 5 minutes. |
I expect it to be reported when the consumption changes. Try attaching a bulb to it. |
No output about the measurement if I attach a bulb (40W) to the plug. |
Found some hints in the deCONZ issues. Maybe it helps. Unlike the other smart plugs, the innr SP 120 uses the ZLL profile. Adds SP 120 in deCONZ |
{
zigbeeModel: ['SP 120'],
model: 'SP 120',
vendor: 'Innr',
description: 'Smart Plug',
supports: 'on/off, power measurement',
fromZigbee: [fz.generic_state, fz.ignore_onoff_change, fz.ignore_electrical_change, fz.SP120_power],
toZigbee: [tz.onoff],
configure: (ieeeAddr, shepherd, coordinator, callback) => {
const device = shepherd.find(ieeeAddr, 1);
const cfgOnOff = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0};
const cfgVoltage = {direction: 0, attrId: 1285, dataType: 33, minRepIntval: 1, maxRepIntval: 300, repChange: 1};
const cfgCurrent = {direction: 0, attrId: 1288, dataType: 33, minRepIntval: 1, maxRepIntval: 300, repChange: 100};
const cfgPower = {direction: 0, attrId: 1291, dataType: 41, minRepIntval: 1, maxRepIntval: 300, repChange: 1};
const actions = [
(cb) => device.bind('genOnOff', coordinator, cb),
(cb) => device.foundation('genOnOff', 'configReport', [cfgOnOff], foundationCfg, cb),
(cb) => device.foundation('haElectricalMeasurement', 'configReport', [cfgVoltage], foundationCfg, cb),
(cb) => device.foundation('haElectricalMeasurement', 'configReport', [cfgCurrent], foundationCfg, cb),
(cb) => device.foundation('haElectricalMeasurement', 'configReport', [cfgPower], foundationCfg, cb),
];
execute(device, actions, callback);
},
}, This should be the same as the deCONCZ configuration. Can you try with this and provide your log? |
Here is the log: |
No luck yet. Could you provide all entries of |
I repaired it, thats why it is now id12 instead id7 from the first post.
|
Ok, we need to extend the logging a bit. Can you change https://github.com/Koenkk/zigbee-shepherd/blob/master/lib/components/af.js#L576 to
|
Extended Log: |
If I understand it right. Could you provide a longer log? (5 mins) |
Yes thats right, Hopefully 30 mins are ok: |
No reports yet :( Ive also bought this plug so will try adding support for it once i receive it. |
Took 28 days to arrive (😐), however it's supported now! (in the dev branch). |
Does it really support power measurement? I did not find a website (not even from innr) which lists this feature. |
Of course |
@hansblafoo yes! I use it to automatically switch of the plug once the kettle has finished. |
Can you recommend this plug as a Zigbee router? |
Yes |
My innr plugs do not seem to report their state via zigbee once I switch them on with the button. Can someone confirm that this is the case? |
Mine do the same.. if someone switches the plug on at the button on the plug I get no status message in zigbee2mqtt. Should this device report status?
|
@gally789 there was a bug in zigbee2mqtt 1.7.1 causing this. To fix:
If it still doesn't work, please provide your |
Thanks. Upgrading and adding the devices again to my network fixed it for me. |
@Koenkk is the reporting interval configurable? From the code it looks like it is defined in your code... |
@runningman84 it's not configurable indeed (but the default should be a good value) |
It looks like my zigbee network is spammed with messages, it would be great if we could specify the interval. I think sometimes my xiaomi sensors fail to send messages due to the high zigbee network load... |
You can try adjusting the reporting interval in the functions (https://github.com/Koenkk/zigbee-herdsman-converters/blob/master/devices.js#L2642) to find a new good default value. Note that every time you change it you need to bump the configure key by one (https://github.com/Koenkk/zigbee-herdsman-converters/blob/master/devices.js#L2637) |
what would be needed to make this setting as a config option in the configuration.yaml? In this case I could change this value without rebuilding the whole image... |
Indeed, I experience similar issues with status reports flooding my FHEM server putting a huge load on my zigbee network making other sensor less responsible. |
Could you please giva an example how to do this? At the moment there is no reporting interval listed for the SP120. I also think adding the interval to the configuration.yaml would be good for most of the users. 5 seconds may still be too much for some environments. But for my (general) understanding: these 5 seconds are configured in the devices itself? Because in the syslog I only see what is pushed to the mqtt broker? And these messages I can reduce with the debounce option to reduce size of my home assistant database. But then still the zigbee messages are in the air (invisible) and may block other devices. I also found an interesting post here, but this seems not to work: https://zigbee2mqtt.discourse.group/t/configure-attribute-reporting-for-innr-sp120-or-any-zigbee-device/457 |
@Koenkk can you also configure this plug to have a default 'on' state? i want it to measure the power from my washing machine but power cuts should not put the plug into an 'off' state. |
@webunity I'm not aware this is possible with this plug. Maybe someone can check if it's possible via the original gateway, in that case we can also add it. |
i'll check with deconz. In the meantime as an alternative i could also poll the switch and turn it on in case it was off. |
@monotonus did you ever figure out how to change the reporting interval? |
@Appelg unfortunately no. In the meanwhile I sold the device again and I'm using now the Xiaomi Smart Plug which doesn't update that often. |
@Koenkk sorry for bumping this old issue again... I changed the devices.js to this
Will that actually tell the device to only report changes of 10 over zigbee, or will it only limit these changes against MQTT? Why does some devices seem to have a more advanced "config"?
Also: Is it possible to configure this via "bridge/config/device_options"? Is there a way to do a "get" to see the structure of the message to send to config? |
Zigbee
It depends on the granularity of the reported values, this differs per device, the main goal is to prevent spamming. Some devices already have a correct reporting interval by default so additional configuration is not necessary.
This is not configurable |
@Koenkk thanks for the feedback. One final question:
Is consumption not supported? |
@Appelg currently not, can you try changing the definition in {
zigbeeModel: ['SP 120'],
model: 'SP 120',
vendor: 'Innr',
description: 'Smart plug',
supports: 'on/off, power measurement',
fromZigbee: [fz.electrical_measurement_power, fz.on_off, fz.ignore_genLevelCtrl_report, fz.metering_power],
toZigbee: [tz.on_off],
meta: {configureKey: 5},
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(1);
await bind(endpoint, coordinatorEndpoint, ['genOnOff', 'haElectricalMeasurement', 'seMetering']);
await configureReporting.onOff(endpoint);
// Gives UNSUPPORTED_ATTRIBUTE on readEletricalMeasurementPowerConverterAttributes.
endpoint.saveClusterAttributeKeyValue('haElectricalMeasurement', {
acCurrentDivisor: 1000,
acCurrentMultiplier: 1,
});
await configureReporting.activePower(endpoint);
await configureReporting.rmsCurrent(endpoint);
await configureReporting.rmsVoltage(endpoint);
// Gives UNSUPPORTED_ATTRIBUTE on readMeteringPowerConverterAttributes.
endpoint.saveClusterAttributeKeyValue('seMetering', {
multiplier: 1,
divisor: 1,
});
await configureReporting.currentSummDelivered(endpoint);
},
}, Might take some time for the See https://www.zigbee2mqtt.io/how_tos/how_to_support_new_devices.html how to edit |
@Koenkk that did work, thanks! Took a couple of hours before the energy showed up, if anyone else tries this. One problem tho: After this change, I can't add more Innr SP 120, it fails during "interview". This is the error I got when trying to add another device with the above code change:
|
@Appelg when you revert does it work again? |
So pairing with the new code still fails? |
Sorry for the late reply. I just tested to remove it, and then pair it, it works now. I did pull a new version of the dev-image today, no idea if that made the difference or if it was just some bad state I was stuck in last time. |
Good, could you make a pr? |
@Koenkk sorry for getting back this late, after the PR. I finally had time to set up my Grafana graphs, and look at the data... Is there a way to figure out what unit the device sends? I base this on two things:
16:53 - 156 enery, 70 power So an hour gave a difference of 8. Therefore a multiplication by 10 seems what I need in order to get Wh. |
@Appelg energy values should be in kWh not wH so we should divide by 1000 instead of multiplying by 10. This can be done by changing the |
Yeah, divide, of course. But with 100? But is there a way to verify? Does the zigbee protocol have a way to ask the device? Or is the only way to contact the manufacturer and ask for a spec? So all the other divisor/multipler in the devices.js has been figured out empirically? |
Normally the |
I have the same problem as described above, the SP120 is flodding my network every 5 seconds, which results in commands not going through. I have adjusted the configuration file for the SP 120 (.../iobroker/data/node_modules/zigbee-herdsman-converters/devices/innr.js) and added the "{change: XX}" parameter behind the awaits. However this did not fix my problem (see https://github.com/ioBroker/ioBroker.zigbee/issues/1483. |
I have two Innr SP 120 Smart Plugs (https://shop.innrlighting.com/en/shop/113/smart-plug) which is a unknown device.
I started with the "How to support new devices" Wiki.
After pairing the new entry in database.db:
Added new device with report in devices.js
fromZigbee.js
If I started zigbee2mqtt with
DEBUG=zigbee-shepherd* npm start
on/off via mqtt topic works. Incoming message would be send twice. No idea why...
In deCONZ it works fine:
No electrical measurement. What could I do next? Thx
The text was updated successfully, but these errors were encountered: