ni-c / heimcontrol.js

Home-Automation with node.js and Raspberry PI
MIT License
1.41k stars 297 forks source link

TriState to Decimal 433mhz #80

Closed thenetw0rk closed 10 years ago

thenetw0rk commented 10 years ago

hi

is there anyway to send the decimal code from the 433mhz transmitter instead of tri-state codes

i have received the sending codes from my RC with the receiver but it says Tristate not applicable

or is there a way to edit the coding so it sends decimals instead of tristate

can anyone help

thanks

tjanson commented 10 years ago

Yes, you could change the code, but it shouldn't be necessary, because there is probably an equivalent tri-state code to your binary code.

I can't confirm it right now, but I believe 01 (bin) is F and 00 is 0. E.g., FF0F is 01010001.

I'd use the rc-switch library's SendDemo Arduino sketch to make sure the codes are actually working with your sockets, then plug those into heimcontrol.

What kind of sockets are you using?

thenetw0rk commented 10 years ago

still cant work it out

this is my code for turning socket 1 on

decimal : 5522351 bin : 010101000100001110101111

can you help change the code so i can use it

i have tried again receiving the codes with a receiver but there is no tri-state code

tjanson commented 10 years ago

Ok, I see why it’s not convertible, it’s composed of not just 00 and 01. Again, what’s model of socket are you using? Which manufacturer?

I’d try using the SendDemo.pde example sketch to send those exact codes to your sockets, e.g.,

  mySwitch.send("010101000100001110101111");

That will confirm that the rc-switch library is compatible with them. And if that’s the case, then it’ll be easy to adapt Heimcontrol. Please try this and tell us whether it worked.

thenetw0rk commented 10 years ago

hi thanks for coming back

the manufacturer is STATUS and model number is SREMSOC3PK3

i have used SendDemo.pde sketch to send the codes and both codes can turn the socket on

mySwitch.send("010101000100001110101111"); or mySwitch.send("5522351");

so the rc-switch library is compatible

how can i adapt the heimcontrol which the above codes

thanks again

tjanson commented 10 years ago

Ok, great, glad it’s compatible. Heimcontrol and duino can only handle tristate codes so far. So let’s change that! :) I’ll try to get this done in the next few days.

thenetw0rk commented 10 years ago

thank you very much for helping with this.. this would be a great help

thank you again

tjanson commented 10 years ago

I’ve got it working. :) I’ll need to clean up so the interface is usable, then I’ll publish it.

thenetw0rk commented 10 years ago

thank you very much, your are genius. cant wait till its published

tjanson commented 10 years ago

Okay, so can you go ahead and try the version at tjanson/heimcontrol.js@fa25de63a85b9bb830c38b9d7e6f6d416a1c3824:

That should be it, just use the "binary code" option in the web interface. Let me know whether it works.

thenetw0rk commented 10 years ago

hi thanks for that..

when i try and upload the code to the arduino i get the following error

'irsend' was not declared in this scope

tjanson commented 10 years ago

There should be a menu option like "Add library", use that to add both the IRSend and RC-Switch libraries — they're under duino/src/libs or something like that.

tjanson commented 10 years ago

PS. Be sure to use the ones from my version of duino, not the old one that npm installs.

thenetw0rk commented 10 years ago

done that and im still getting that error message

tjanson commented 10 years ago

Is IRremote shown in the menu like this? IRremote in Arduino library menu

thenetw0rk commented 10 years ago

no.. just duino

tjanson commented 10 years ago

Use that menu ("Add Library") to select the folders IRremote and RCSwitch at src/libs of this duino version. It should look like the screenshot then.

thenetw0rk commented 10 years ago

uploaded it to arduino so just going to test it now

thenetw0rk commented 10 years ago

ok.. put the bin codes on.. but when i click on it crashes and puts the following errors

/root/heimcontrol.js/node_modules/mongodb/lib/mongodb/connection/base.js:242 throw message; ^ TypeError: Object [object Object] has no method 'decimal' at /root/heimcontrol.js/plugins/arduino/index.js:86:40 at /root/heimcontrol.js/libs/PluginHelper.js:34:11 at /root/heimcontrol.js/node_modules/mongodb/lib/mongodb/cursor.js:162:16 at commandHandler (/root/heimcontrol.js/node_modules/mongodb/lib/mongodb/cursor.js:706:16) at /root/heimcontrol.js/node_modules/mongodb/lib/mongodb/db.js:1806:9 at Server.Base._callHandler (/root/heimcontrol.js/node_modules/mongodb/lib/mongodb/connection/base.js:442:41) at /root/heimcontrol.js/node_modules/mongodb/lib/mongodb/connection/server.js:485:18 at MongoReply.parseBody (/root/heimcontrol.js/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5) at null. (/root/heimcontrol.js/node_modules/mongodb/lib/mongodb/connection/server.js:443:20) at EventEmitter.emit (events.js:95:17)

tjanson commented 10 years ago

Have you replaced the heimcontrol.js/node_modules/duino with my version (again this link)?

thenetw0rk commented 10 years ago

yes yes yes, i got it working... wwwwwooooooohhhhh lol... well happy now..

thank you again for all of your help with the coding etc your a life saver :)

tjanson commented 10 years ago

No problem, glad I could help! :)

thenetw0rk commented 10 years ago

thanks... :)