-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Innr SP-242 Smart Plug not reporting status automatically #6747
Comments
@ukgrant can you confirm this issue? |
Yes, I've just tested these steps and it behaves exactly as described by @davmc123 :( |
Pushed a fix, let me know if it works. Changes will be available in the dev branch in a few hours from now. |
Updated to the latest Z2M development image, but still getting the same behaviour where reporting stops working after a power cycle of the smart plug
|
Could you provide the debug log of this? See this on how to enable debug logging. |
Powered off the Smart Plug "Innr Smart Plug 2" at 23:09:40 and back on at 23:10:00, I'm not sure if the log is really showing anything useful though. "Innr Smart Plug 2" doesn't appear again in the log until 23:26:13 when I some switch on/off commands from home assistant I also attached the full log file but I don't think it will provide any more insight than the short one. |
I would expect a "device announce" when the device is plugged back into power, @ukgrant does it do this in your case? |
I've tested and no announcement is published when power cycling this device. Others do... |
Then I cannot solve this problem from Z2M, it has to be fixed in the firmware. I've notified my contact person at Innr about this issue. |
Just FYI: The Innr SP-240 device suffers from exactly the same bug. |
Innr confirmed this issue and is looking into a solution, once fixed they will probably provide an OTA update (which can be done via Z2M) |
I have the SP 242 with the same issues. Fortunately mine won't often be power cycled, so I hit the various apply buttons in the Reporting tab and it's been working well. I have however noticed the green button flashes at random intervals. I can find no mention of this in any documentation. Could this be a side effect of this issue or the work around? |
No workaround has been implemented as of now. |
Apologies, I meant the action of going into the reporting menu and hitting apply on the various endpoints. |
What is the issue with this? |
It might not be an issue; I just wouldn't expect the power button to flash rapidly for a few seconds every minute or so, especially when the device state is off. It almost looks as if it's in a pairing mode (which it isn't). I'll raise it with Innr directly as it's probably not related to this issue and I don't want to derail this issue any further. |
FYI, my SP-242 device, same fw 1.4.3, exhibits the same issues reported. |
Chiming in with SP244's exhibiting the same issue. fwiw edit: I've been in contact with Innr and they report their expected ETA for the firmware update is Feb 20. It will be turned over immediately to the Z2M team for a commit to their code, after which we will be able to update the plugs themselves. |
Eagerly awaiting this firmware upgrade. I don't currently see my two SP 242 plugs under the OTA section on Z2M. Is that expected? I do see my other SP 222 plugs in there so thought I'd check to see if you guys are seeing the same? |
@jrossouw777, Zigbee2mqtt allows only the OTA capability when there is firmware available in the Zigbee-OTA repo. So until then the device won't show in the OTA section |
Just bought myself a few SP 242’s with f/w 1.4.3 to then stumble across this issue. I’ve tried hitting the Apply button for all lines in the reporting tab but after 24hrs only 1 out of 4 plugs is still reporting back. Any news on the firmware update from Innr? |
No updates from Innr yet |
Shame as these look potentially good plugs. Thanks for confirming no update yet, means I’m not missing anything from my OTA setting. |
Is there a way to programatically set the reporting intervals via HA scripts or similar whilst we wait for a firmware? The fix for the firmware, is that to remember the reporting interval across power cycles, or just to broadcast an announce message when power is restored? (Looks like there's logic to reapply the intervals if an announce occurs in that potential fix that was merged) |
I have several SP 222 which do not exhibit the same problems. |
To answer my own question, while we wait for a firmware update we can update the configuration to use polling to update the stats regularly (every 60s by default): I've stolen the method the tuya plugs with the same issue use, and inlined it in this definition so it won't break if the tuya method is modified / removed. As per that implementation there's a field called Definition file:- SP242.js const {onOff, electricityMeter} = require('zigbee-herdsman-converters/lib/modernExtend');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const globalStore = require('zigbee-herdsman-converters/lib/store');
const utils = require('zigbee-herdsman-converters/lib/utils');
const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const e = exposes.presets;
const ea = exposes.access;
async function onEventMeasurementPoll(type, data, device, options,
electricalMeasurement=true, metering=false) {
const endpoint = device.getEndpoint(1);
if (type === 'stop') {
clearTimeout(globalStore.getValue(device, 'measurement_poll'));
globalStore.clearValue(device, 'measurement_poll');
} else if (!globalStore.hasValue(device, 'measurement_poll')) {
const seconds = utils.toNumber(
options && options.measurement_poll_interval ? options.measurement_poll_interval : 60, 'measurement_poll_interval');
if (seconds === -1) return;
const setTimer = () => {
const timer = setTimeout(async () => {
try {
if (electricalMeasurement) {
await endpoint.read('haElectricalMeasurement', ['rmsVoltage', 'rmsCurrent', 'activePower']);
}
} catch (error) {/* Do nothing*/}
try {
if (metering) {
await endpoint.read('seMetering', ['currentSummDelivered']);
}
} catch (error) {/* Do nothing*/}
setTimer();
}, seconds * 1000);
globalStore.putValue(device, 'measurement_poll', timer);
};
setTimer();
}
}
const definition = {
zigbeeModel: ['SP 242'],
model: 'SP 242',
vendor: 'Innr',
description: 'Automatically generated definition',
extend: [onOff({"powerOnBehavior":false}), electricityMeter({current: {divisor: 1000}, voltage: {divisor: 1}, power: {divisor: 1}, energy: {divisor: 100}})],
meta: {},
options: [exposes.options.measurement_poll_interval()],
onEvent: (type, data, device, options) =>
onEventMeasurementPoll(type, data, device, options,
true, // polling for voltage, current and power
true, // polling for energy
),
};
module.exports = definition; add the file as an external definition in the configuration.yaml file:- external_converters:
- SP242.js |
I have an SP240 but your script works like a charm after a few adaptions. Thanks |
Thanks! |
I have recently updated my Innr sp242 to the newest firmware and it is not updating the energy value even after removing and readding the plug to MQTT. I have inplemented the external converter above to enable polling to update the energy value for me. all the other figures like watts and voltage seem to be updating as they should just the Energy isnt. Can anyone help me with creating the bindings @GerryInnr suggested above in z2mqtt. I'll get using the external converter listed at the start of this thread for now. |
Did you read the last few posts, it is only updating when there is something to update, you can change the settings to set lower maximum update durations. |
can someone tell me how i do this in home assistant? |
Load up the z2m gui from Settings -> Addons -> Z2M -> Open WebUI. In the devices list, find you device and go into it clicking the name. In the device details goto the Reporting tab. There you have min/max reporting intervals and minimum reporting change values on the end for each parameter. Change one, click apply corresponding to that row. But bear in mind just because one updates and another doesn’t, maybe one just doesn’t have any change to report. They’ll only change as frequently as each other if the devices connected to them are pulling the same amount of energy out the wall (assuming this Reporting tab shows the same configuration variables in each device). If you have an LED bulb in one and the other has a washing machine connected to it, the one with the bulb isn’t going to update as frequently anyway. Not suggesting these are ideal settings or anything but for an idea, I have all my parameters for min report interval as 5 except onoff 0, max report interval as 3600. Min rep change I set power and voltage to 5, current to 50, sumdelivered 500 and onoff 1. I took these from the default values from another brand of plug I had in my network. Find them OK for my automation needs. I assume the intervals are in minutes because for sure if they were seconds, my devices aren’t reporting every 60 minutes. |
Thanks for the instructions. Besides there is energy usage to report by both switches. |
I don’t use it, maybe someone else can help. Started with zha and switched to z2m long time ago, never looked back. |
I recently updated the plugs to 1.7.23 on the latest version of z2m. On all the plugs I updated in the reporting tab of the device page in z2m gui I now have all the clusters duplicated and the plugs have stopped reporting again. Any one else noticed this? Edit, only managed to resolve it by removing all the plugs and re-adding them to the network and configuring all the reporting intervals again. Bit of a pain. |
I am considering buying these plugs to use with z2m. Can someone confirm if the issues have been fixed with the latest update? Thanks in advance! |
Got the same question but with ZHA. |
They work perfectly on Z2M for me now |
For me it is still not working... |
What is not working exactly? |
Set the maximum interval down on currentsumdelivered from 65000 to how often you want it to report no? I think how you have it will only update every 18 hours. |
Oh boy... I feel so stupid right now... currentsumdelivered.. Thank you. |
The issue of values not reporting after a power cycle are fixed but the default reporting configuration needs better default values. They seem to get reset after a firmware update so it would be good if the values were adjusted to report at least every 10 minutes or an hour, currently defaults to 18 hours. The minimum could be something like 5 or 10 seconds. Is this something that could get changed in a future release? Is it worth marking this topic as resolved and closed and opening a new topic for the default reporting values? |
Haven't had time to properly test, but happy to close if the consensus is that the original issue of retaining reporting settings over power cycles is fixed? Not sure if default values are a Z2M or an Innr issue. |
The work around is still in the code so it is harder to tell if it's working. The original issue was found because the devices weren't announcing themselves after a power cycle, is that correct? So to confirm we just need to update a device to latest firmware, power cycle it and check the logs for an announcement event from the device. But the issue of default values being wrong after a firmware update is annoying as it makes it seem like it's broken again. My Kasa and Tapo devices are reporting every few seconds and innr devices appear to default to a few times a day. |
It definitely does make it seem that way, after my latest firmware update (beyond the one that changed the tolerances of auto shut off protection, not announcing etc.) I for sure immediately thought it was broken again as it defaulted back to not updating with the long maximum update values resetting. If they can’t persist after firmware updates the defaults really ought to be changed imho. |
We'll check on both issues (default attribute reporting configuration, and not retaining attribute reporting configuration settings across software upgrades) and will provide a fix where applicable. Help of the SDK supplier is probably needed so I cannot provide an ETA yet. I'll leave it up to you to decide whether to keep this issue open or create a new one. |
If im running the plugs using an external converter in z2mqtt do i need to i need to disable the external converter for the new update to show ? As the new update isnt showing as available on my plugs ? Apologies if already been asked |
I cant see it in the OTA list, is there a setting i need to change within the settings ? In my z2mqtt config i do have the disable_automatic_update_check set to false so doubt it would be that |
My guess is that your converter is what is being detected by the zigbee bridge. This means that it can't see the underlying devices to connect them to over-the-air updates. Are you able to connect the zigbee devices directly or do you have to go through this converter? Is it possible to update the firmware through the converter? I don't know what converter you're using but it will need to also pull from the same pool of firmwares. |
Its possible the external converter is blocking it, i would need to disable it and then check again. Will try this in a few days as im away from my main pc to do this. Thanks for your help :) |
Yes removal the external convertor, if you applied it to do the automated polling to work around the firmware issue, its no longer needed and OTA will come back. |
Noted, ill do the change. Thanks |
Just had to setup the reporting of two of my plugs again because for whatever reason, maybe a power cut, they'd reset back to their default and I was only get 1 report a day. Changed to report every max every 60 seconds (minimum 5 seconds) and when volts and watts change by 1 or more and energy and current by 0.01 (So I can see 1 volt and 0.01 amp changes and every 10 watt hours of usage. |
I am considering buying Innr SP24x plugs, and wonder, @GerryInnr , if you may have an update for us on the 2 remaining issues. You mentioned that support from the SDK supplied may be necessary, so it may take a while. Can you perhaps let us know what the current status is? |
Hi @FlorianOosterhof I expect to be able to release a new firmware in December 2024 or January 2025. |
The device support recently added in PR: Add device support for: Innr SP-242 Smart Plug #6703, does not seem to be reporting status information and sensor readings automatically. They only update when the 'Refresh' buttons are pressed in the Z2M 'Exposes' tab. This includes switch 'State', 'Power', 'Voltage' and 'Current'.
If I press the 'Apply' button for each item listed in the 'Reporting' settings menu, the smart plug will start reporting the sensors automatically, one by one.
If the smart plug is unplugged and plugged in again (power cycled) it stops reporting automatically. Pressing the 'Apply' button again for each item allows the automatic reporting to continue.
Smart Plug Info
Zigbee2MQTT Info
The text was updated successfully, but these errors were encountered: