This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
RF-433
Creating an app to replace my 433MHz remote for dual relay controller
DIYglenn
Member
I got a simple $6 dual relay controller, set to switch between two relays (latching) so that it controls a linear actuator.
Now, this is what I ordered, but it isn't exactly the same, but in short there are a bunch of these on eBay, pretty much the same thing all of them, and at least mine is using the chip "SYN470R" on the 433MHz board.
This is what I got:
Anyways, my actual question is HOW can I get this talking to Homey? Maybe I should've used Arduino/Wemos and MQTT with a dual relay board instead, but I'm up for a challenge, I want to learn something.
I got everything working, I just want that remote to be on the balcony where the window is, and automate the closing/opening with Homey.
I was hoping I'd be able to add this from any of the existing apps, but I guess not.
I'd be happy to contribute and make an app for it, but I need some help to be pushed in the right direction.
Do I need a logic analyzer?
Can Homey's signal recording be enough?
There's a learn button, will Homey have to be connected to it in "learn" mode?
Will the signal still always be the same code?
Do I add support for the remote or the board?
There's probably a lot of uses for controllers like these, even though they're not "rolling code" and therefore not safe, but for greenhouses etc. they are of excellent value.
I appreciate any help I can get. The balcony gets really hot now that the sun is back after the winter, so I would love a way to open the window automatically based on temperature and wind/rain conditions.
This is what I got:
Anyways, my actual question is HOW can I get this talking to Homey? Maybe I should've used Arduino/Wemos and MQTT with a dual relay board instead, but I'm up for a challenge, I want to learn something.
I got everything working, I just want that remote to be on the balcony where the window is, and automate the closing/opening with Homey.
I was hoping I'd be able to add this from any of the existing apps, but I guess not.
I'd be happy to contribute and make an app for it, but I need some help to be pushed in the right direction.
Do I need a logic analyzer?
Can Homey's signal recording be enough?
There's a learn button, will Homey have to be connected to it in "learn" mode?
Will the signal still always be the same code?
Do I add support for the remote or the board?
There's probably a lot of uses for controllers like these, even though they're not "rolling code" and therefore not safe, but for greenhouses etc. they are of excellent value.
I appreciate any help I can get. The balcony gets really hot now that the sun is back after the winter, so I would love a way to open the window automatically based on temperature and wind/rain conditions.
Tagged:
Comments
explains it all pretty much...
I used the signal tool and held the lock button, and then recorded again when I held unlock and now got two VCD files (the remote repeats the signal as long as it is held).
I then opened GTKwave and can now see a pattern. I'm not familiar with GTKwave at all, so I don't know how to get both signals in the same window to compare, I now only have one signal and have to open two tabs to compare them.
Where do I go from here? Is there a way to mark the signal and convert to something Homey can use?
Lock:
Unlock:
Thanks!
Edit:
I guess I'm mixing two different methods here... I'm now following the guide you linked to more thoroughly, the signal seems to be a really simple one, but it's all new to me here...
https://forum.athom.com/uploads/editor/az/eztw1rmmuuap.pdf
also, I think https://github.com/athombv/node-homey-433/wiki/How-to-record-a-signal is easier to read
(Are they (Athom) really going to remove the Mac/PC app?! I don't like the new iPhone app, but a potential iPad app is welcome, but only in addition to an app I can use on my Mac... The developer console is great!)
At first I didn't get one that stood out from the rest, (1-3 on all) or I would get two with equal numbers (44), but sometimes I would get one with 80 or more (number 50). I did it several times to be sure.
Now.. The numbers aren't perfectly matching, so now I'm over to the part about creating an average. A lot for a newbie here, but I can see that it's maybe easier to get the information I'm looking for this way
I'm posting my results so it might help others know what they are looking for (I've tried formatting it to be more readable)
You can discect the Start Of Signal and End Of Signal and calculate the average (better) values of 434 and 1380 in the bits. Then you also have the signal send.
I'll see if I can work my brain around this. Coding is new for me, not to mention decoding 433MHz signals.
One question though; What do you mean when you say that the values "will lead to a bit"?
Edit:
Oh, that the previous two are considered a word, and are not together with EOF?
How do I know if my signal has SOF and EOF? The high end value makes me think, as your suggestion, that it is [456,3846], but what about SOF? There doesn't seem to be any definite value there.
I'm not sure I get how to convert this to anything useful, what exactly does it mean if something can be "parsed" or not?
(Reading the PDF)
So I set SOF and EOF to "2" and then "predictedWords" as follows:
Does this seem correct?
I now have this:
Does this make sense from the data I provided earlier?
If so, should it now be repeated for the next button on the remote...?
This means than words should be defined the other way around? Or doesn't it matter? I mean, it starts with number [1408, 546] so this would be word1? And [462, 1322] would be word2? Does this order matter? I guess otherwise it would invert 1 and 0?
For some reason, the first one does have a higher average on both values, but I do agree that it still doesn't make sense to have it set as SOF.
So what will the next step be?
Should I use the 433MHz app generator?
Does the above data make sense?
as there probably is no SOF for this device, it starts high and goes low, should this be considered the first word like above?
From the example text, [110, 1100] , [1100, 110] seems to be typical for the two words, but mine are opposite, the first starting high.
Does this mean that my device starts with the binary value 1?
Where does the button value appear in all this? There is a lock and unlock button.
How about pairing?
Are there any functioning safety measures at all, or can “anyone” just send this signal and open my window?
I’m not concerned about safety on this particular installation, because it doesn’t matter for my house safety, but IF I were to use something similar on a window in the house, could that be hacked?
And then opened that folder and ran
This gave me this error about a folder not existing
I created that folder, but this gave me a new error:
I created that file (an empty one), then ran the command as "sudo" and it went through, but this doesn't seem correct...
Should the folder and config be generated automatically?
Would love if someone could help me further.
I'm considering doing a write-up afterwards for people like me - that aren't developers, but still like to utilize the tools created, and use Homey to learn.
Where do I go from here? Devs?
RFDriver, 433MHz app generator? Are any of these two still usable, or should everything be made from scratch?
I don't get it...
But that app seems to be built from the generator as well?
I’ll try to work my way through it.
I now tried running with "athom app run", but get this:
Changed to 0.5 and it worked immediately.
I'm not quite sure where to go from here though, the app is installed, and I tried the pairing wizard. Clicking the button did give me a binary code in the terminal window, both for lock and unlock button. The only difference was "0" and "1" at the end. And sometimes the first number was 0 instead of 1, which seems to be incorrect.
The pairing wizard didn't go further though, so I couldn't add the device.
Is this what it reads from the key, or is it using what I defined as SOF/EOF/Words?
I'm still a bit unsure about my words, as it seems like most of these things has the first word with a low to high value, f.ex. [100, 1000] while mine is opposite. I don't know if this matters.
So my payload is 24 here?
Do I write payload.length === 24?
Not sure about that "slice" part.
I guess this is to "skip" the first 23 numbers and only focus on the "1" and "0" at the end as usable variables?
you have to define an Address part, that is the pattern that Homey uses to recognize, so that part must always be the same, in this case, you can use the part from the second bit and leave away the last 2 bits, the counting starts with bit-0 so you need bit-1 to bit-22 (22 not included): address: this.bitArrayToString(payload.slice(1, 22)), x000011111100010000000xx
For state: payload[1], // I would take a bit that is always 1 so probably bit-6 state: payload[6], // since it's a pushbutton, there is no real "state", if it was a switch, you should take the bit that is changing with ON and OFF.
Then there is the part: data.address && data.address.length === 16 && that must fit your signal, so this must be