Closed subcritical71 closed 3 years ago
The log shows that a CC status was received from the panel with output 35 in an "off" state. If homebridge-elkm1 had turned the output off you would see the line "setting output 35 ...." as you do at the start of the log.
Ok, thank you. I will close as the plugin does not appear to be the source of the off command. Thanks again.
I was looking though the Elk RS232-ASCII reference. In the section to turn on the Control Output Change (to On) there is a time setting.
4.8.2 Control Output On (cn) 0EcnDDDTTTTT00CC(CR-LF) Example: turn on Control Output 1 for 10 seconds: 0Ecn0010001000D8(CR-LF )
What is the plugin setting the TTTTT to? Is it able to accept input from Homekit (actually the Eve App) to populate this value? Below is the scene I created in the Eve App for, in this case, zone 3 of the irrigation system.
Ok, just had a look at elkmon, it seems it does allow to message the M1 with a time;
/**
* Turn output on.
*
* @param {number} outputId
* @param {number} seconds - Number of seconds output will be active
*/
setOutputOn(outputId: number, seconds: number) {
let elk = new ElkMessage(`cn${leftPad(outputId.toString(), 3, '0')}${seconds.toString()}`, null);
this.connection.write(`${elk.message}\r\n`);
}
but the elkm1 plugin is passing a 0 value, which I think is good enough;
async setOutput(value: CharacteristicValue) {
const newState = `${value}` === 'true';
this.platform.log.debug(`Setting output ${this.id} to ${value} newState = ${newState} currentState = ${this.isOn}`);
if (newState !== this.isOn) {
if (newState) {
this.elk.setOutputOn(this.id, 0);
} else {
this.elk.setOutputOff(this.id);
}
this.isOn = newState;
}
}
I'm not much of a programmer, so I don't understand how elkmon is padding the 5 T's to create a proper message format similar to what it did for the output number with the left pad.
The elkmon code does look like it isn't creating the message properly. I only use an output for pulsing my garage door relay. It may be that the m1 handles the non-padded duration correctly or it could be the source of your problem.
I will do some testing when I get home and submit a PR to elkmon if is a bug
That appears to be the issue. I changed the code in elkmon to '00000' and reran my automation. It worked as expected. It would be nice if your plugin could transfer the actual timer value to elkmon. The way I have it now homekit will send an off command when the timer expires. But if the m1 already knows when this off will be it will serve as a backup so I don't leave my sprinklers on for hours in case something hangs. :)
Unfortunately the timer isn’t part of the HomeKit accessory. HomeKit simply turns outputs “on” or “off”. The timer part is logic in the smart irrigation plugin.
I will create a PR for elkmon to fix the message format bug
I have raised an issue - https://github.com/sgentry/elkmon/issues/7 and submitted a PR to elkmon to address it
The elkmon pr has been accepted. Once the new version of elkmon is released this should be resolved.
Great, thanks for the support. I'll close this issue.
Paul, could you increment the version of your plugin with the latest elkmon dependency? For some reason last night my elkmon reverted back to turning on the output without the proper padding.
3.0.4 updates the dependency
@paulw11 Did you mean to remove the dependency to elkmon? Your plug-in will not load now complaining about elkmon being missing.
Not sure what I did there. 3.0.5 is now available
This is still a problem because elkmon 1.2.4 doesn't actually include the fix. See https://github.com/sgentry/elkmon/issues/10
As a work around you can manually make a change to index.js in the elkmon directory under /usr/lib/node_modules/homebridge-elkm1/node_modules/elkmon/dist
let elk = new messages_1.ElkMessage(`cn${utils_1.leftPad(outputId.toString(), 3, '0')}${utils_1.leftPad(seconds.toString(),5,'0')}`, null);
Elkmon 1.2.5 fixes this
First, great product, I have been using it effortlessly for a few months now.
I recently installed a plugin (Smart Irrigation) to better automate my sprinklers. Now I am trying to narrow down an issue I am having with my automations. I am using Homebridge UI (4.41.1), ElkM1 (v3.0.3), and SmartIrrigation (v1.5.1). The SmartIrrigation - [https://github.com/MTry/homebridge-smart-irrigation#readme] creates dummy zones for later control of the irrigation system. I have successfully mapped and can control these dummy zones to the real ELK outputs using Scenes/Rules in the Eve App. I can successfully turn the outputs on and off. The issue comes along when a few minutes into the watering cycle the output turns off. I've looked at the ELKM1 (RP2) log files - No help, and the homebridge log files and can only see the result, not what is taking the action of turning off the output. Is there anything in your code which would trigger an output to turn off?
Using the EKeypad app on an iphone I can turn the output on and it stays on until I turn it off so its not any Elk control panel rules that are shutting it off. The Eve app appears to be operating correctly also. There is a countdown which is still counting when the output turns off, the dummy zones still show ON. Also, turning on the actual ELK irrigation output in Homekit does not result in this turn off behavior either.
Here is what homebridge reports when it occurs (output in this case is ID: 35);
Thanks!