Page 1 of 1

Electra Air Conditioner and Setting The Timer

Posted: Mon Jun 08, 2020 10:10 am
by iamjon
Thank you so much for the amazing product and help.hoping
I've read the posts in the forum about Electra, but might have missed something.
Here is my issue, it's a bit of a long read hope you don't mind.
I have raspberry pi that is using this library to manipulate the air conditioner
The library is generating raw codes and using to actually fire the request.

Generating raw codes is a similar approach used by

Both IRelecra and Electra-AC-Remote do not offer the timer functionality only the toggle. For my needs I need to be able to program the timer.

I was able to connect analysir to my pi and did the following:
For each time period I took out the batteries from my remote, set the time to midnight, the temperature was 24 degrees, the fan at highest, ac/mode:
on in 10 minutes
on in 20 minutes
on in 30 minutes
on in 40 minutes
on in 50 minutes
on in 60 minutes
on in 120 minutes
off in 10 minutes
off in 20 minutes
off in 30 minutes
off in 40 minutes
off in 50 minutes
off in 60 minutes
off in 120 minutes

Analysir was able to decode the inputs when set to ac mode and lsb8. I have the hex and the binaries and from the binary have a basic idea how the time is set.

Option 1: Was to hack through the c code in Electra-AC-Remote to add the new functionality, but unfortunately my knowledge of c is very limited. I'm good with javascript.
Option 2: Was to compile my own little program that would send the commands using irslingers nec or rc5 but so far nada.

Here's the binary from tests and I can see the pattern for the timer and also for where the other settings are. I can probably map them out quite quickly too.
00000100 00000110 00010010 00000000 01 000000 //toggle

00000000 00000100 00010010 00000000 01 101000 //off050
00000000 00000100 00010010 00000000 01 001000 //off040
00000000 00000100 00010010 00000000 01 110000 //off030
00000000 00000100 00010010 00000000 01 010000 //off020
00000000 00000100 00010010 00000000 01 100000 //off010

00000000 00000100 00010010 00100000 01 000000 // on010
00000000 00000100 00010010 00010000 01 000000 // on020
00000000 00000100 00010010 00110000 01 000000 // on030
00000000 00000100 00010010 00001000 01 000000 // on040
00000000 00000100 00010010 00101000 01 000000 // on050
00000000 00000100 00010010 00110100 01 000000 // on01-30

00000000 00000100 00010010 00000000 01 000000 //set time

I'm attaching the history file as well

Any help or direction would be appreciated

Re: Electra Air Conditioner and Setting The Timer

Posted: Tue Jun 09, 2020 12:15 pm
by AnalysIR
I am not sure what you specifically want help with.

I loaded your signals into AnalysIR and using the reverse engineering tool(Powertools Menu), it is clear to see which bits change as the settings change.

I expect you can work from that.

Also, please post what you are using for an IR receiver (model # or link).
Similarly the make & model # of both AC and remote.

Re: Electra Air Conditioner and Setting The Timer

Posted: Wed Jun 10, 2020 11:53 am
by iamjon
Hi thank you for the reply,
My question was how to I turn the decoded hex or binary into the raw format that the library I'm using can understand...or how can I use irslinger in nec or rc5 mode with the decoded signal. I was hoping someone with experience in c or with irslinger could give me a hand. I understand if it's outside of the scope of the software. The software works amazingly.

My IR reciever is a dinky thing I got from ali express, I'm attaching an image of it. It works just fine, I get the signals from the pi without any problem using a socket.

Remote is electra rc-5 also attaching an image of a reproduction...i took mine apart

Re: Electra Air Conditioner and Setting The Timer

Posted: Wed Jun 10, 2020 5:51 pm
by AnalysIR
Electra uses Manchester encoding (study for RC5 or RC6 )

Based on a quick review of the slinger example you linked it won't work....because it does not support Manchester Encoding.

However, the electra example from BarakW should work fine.

All you need to do is to make sure you provide the correct bit patterns for each field defined(34 bits on all).

I see he is using some Zeros fields (1-4). One of these could possibly be your timer field & you would need to extend the code by including support for these bit additional positions(It seems he is just setting them to zero).

Of course a simpler solution would be to have your RPi control the timing function and just send an ON and then x minutes later send an OFF from the RPi. This would remove the need to delve into the details.

To be extra sure you could send the ON signal a few times to make sure it gets thru and similarly for the off signal.

Re: Electra Air Conditioner and Setting The Timer

Posted: Wed Jun 10, 2020 8:23 pm
by iamjon
Thank you so much for you help.
I've been trying to wrap my head around Manchester coding, I'll read up on the links you sent to see if I can better understand them.
BarakW unfortunately did it for Arduino and also doesn't use the timer, I think both libraries are the same.

When you peeked at irslinger did you look at the irSlingRC5 function? Could that be used. I'm guessing pulseDuration would need to be determined...but I have no idea.

Right now I am using RPI as a timer, and with repeating events. The problem of course is that if someone uses the ac before the timer is supposed to go off it will have the opposite effect to the desired action as the power function is a toggle.
So let's say I want my ac to be on at 14:00 every day. If the ac is on at 13:00 the toggle signal will shut it down.

Setting the timer to on does not toggle the ac, if it is on it keeps running (I checked)

Re: Electra Air Conditioner and Setting The Timer

Posted: Thu Jun 11, 2020 12:04 pm
by AnalysIR toggle.

If you wasn't full could continually send a jamming signal to block any other use of a remote or just remove the remote. (A bit dramatic!)

Maybe you should just look at using LIRC . Build up the signal you need for the timer in raw format(using your favourite RPi language) and then use the LIRC raw option to send the signal from the RPi.

Another approach could be to use some USB module like our A.IR Shield Nano (can plug into the RPi via USB) or our ESP8266/ESP32 WiFi shields to send the signal directly(no need for an RPi). However, you will still need to build up your 'RAW' signal and the code from BarakW seems like a good starting point - once you delve into Manchester encoding.

Re: Electra Air Conditioner and Setting The Timer

Posted: Sun Jun 14, 2020 7:09 pm
by iamjon
I think the jamming would be overkill and I don't even know where to begin.

Using lirc, would have been a possibility, but I built and entire web based interface to interact with the pi, c code and the air conditioner. I want to be able to have almost full control of the ac and understand what is happening, saving the raw values seems like an easy way out.

In the meantime I've made a bit of progress:
I still have a very faint understanding of what manchester encoding is, even after reading your links, and watching a few videos, but I'll figure it out eventually.

I realized that library I'm using actually plots out the Manchester encoding for the ac command. What led me to that realization was your comment about the zeros. Both nryhbhue and barakwei are using the same pointer references to set the same things

If you look at barak's comments here: ... ra.cpp#L57

And the update functions in nryhbhue here: ... oder.c#L21

We see for example fan is pointer 28, mode pointer 30, temperature pointer 19, swing pointer 25
So that tells me (well actually you told me but still) that one of pointers 27-26, 24-23: or 17- 2 is controlling the timer.

We also know from the analysir that the off timer and and on timer are separate parts of the binary string. Which leads me to guess that there is going to be an on pointer and an off pointer:
00000000 00000100 00010010 00100000 01000000 // on010
00000000 00000100 00010010 00000000 01100000 //off010
The on command is in the 4th byte while the off command is in the 5th byte. The leading 01 of the 5th byte is shared in all the commands (so it's one of 24 degrees, fan 3, swing off etc as I kept the same settings but only set the timer to see what changed.

Setting pointer 23 to the hex value of 10 did nothing. Well, the raw values changed, the air conditioner beeped but nothing happened. I'll keep going through the pointers setting each to 10 to see if it will work.

Re: Electra Air Conditioner and Setting The Timer

Posted: Mon Jun 15, 2020 12:04 pm
by AnalysIR
- Make sure to use the reverse engineering tool in AnalysIR to find out which bits represent which functions.
- You can check out the video here:
- Also beware that bit order can be reversed. Check out the MSB vs LSB8 with AnalysIR

Re: Electra Air Conditioner and Setting The Timer

Posted: Mon Jun 15, 2020 12:53 pm
by iamjon
Holy crap it works. It's bit 7 for on!!!

Re: Electra Air Conditioner and Setting The Timer

Posted: Mon Jun 15, 2020 1:08 pm
by AnalysIR