Arm / by-pass message not broadcast-ed to MySensor module
-
I was busy creating a security type of sensor which i needed to set in the arm and by-pass mode.
However Vera showed the correct status (arm/by-pass) the sensor was not aware that it was by-passed.Looking trough the Vera: I_Arduino.lua code i did figure out the setArmed on caused a local variable update.
Bij adding a sendCommand function call my mysensor gets an update on setArmed. This is the new code (MySensors version 1.4.1):
-- Security commands function setArmed(device, newArmedValue) -- Line added by BartE sendCommand(luup.devices[device].id,"ARMED",newArmedValue) -- Add ends setVariableIfChanged(tVarTypes.ARMED[2], tVarTypes.ARMED[3], newArmedValue, device) endIn a sketch running on an Arduino one can handle the setArmed like this
void incomingMessage(const MyMessage &message) { if (message.type==V_ARMED) { bArmed = message.getBool(); // Do something wise with the global bArmed boolean } } -
Nice :) I did make both pull requests
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login