Battery powered IR sender
-
Hi all !
First message here !
I'm very enjoing play with mysensors to build my own Home Automation devices !I have a question about creating a node powered on battery and sending IR codes !
That means, I would like my sensor sleep for a while, and they get the status of the message.
I don't need in this case a fast responce (few seconds is ok here).So First, I take the sample of the Relay, add a gw.sleep(10000) after process...
but it doesn't work : after the sleep, the message was not received. (If I change state from my controller)
I also try to reduce to 1s, but it's the same
after gw.process, I try to call
digitalWrite(RELAY_1, gw.loadState(1)?RELAY_ON:RELAY_OFF);
same here : the state was not receivedSomeone has a idea to do this ?
(I mean receive a message from Gateway and sleep to keep battery) ?Kytrix.
-
When you sleep the node, it won't receive or process any radio-commands.
And relays is pretty power hungry so it won't last long if you're battery powering it.
-
Yes I know that for sleep mode,
I also choose the relay sample to test purpose, I will not put a relay !
Instead of switching a relay on or off, I want to send an IR code.Because I'm running on batterys, I do not want my node to always call gw.process() ! It will drain the battery quite full !
That's why I was trying to do :
void loop(){
gw.process();
gw.sleep(10000); //10s sleep
}and what I was expecting :
if a message was send from my controlelr (jeedom) during the sleep time,
the gw.process() will retrive this missing message ... but it doesn't.How to do such function ? (save battery and receive message, even asynchronously)
Thanks.
Kytrix.
-
The MySensors.sleep also sleep radio. So it won't pick up any transmits during this period.
Actuators (like this is) must be awake all the time to receive messages/commands.
-
One way of making a sleeping sensor that can receive messages is to make is so that the sensor initialize the sending of the control command.
In other words the sensor wakes up sends a message to the controller that I'm available now so if you have something send it otherwise I will go back to sleep.
Like hek indicated I'm sure it would be allot easier to make the sensor to be always on and I'm not sure how to do this but I thought it would be worth mentioning.
-
Ok, I was thinking that I could ask the state of the message S_LIGHT at every wake up,
and if it changes, do my IR sending ...
But it seems to not work.
I guess for this, the problem is on the controller side, after send the command, without acknowledge , it give up and let the state of the button unchanged.Always on means power supply, This sensor must also get temperature, so I don't want to put it anywhere ...
anyway thanks for you help