How to make use of generic 433Mhz sensors?

I’m not sure it helps or not but this is what I selected in the IDE…

to me that seems that it isnt the power but some problem in the sketch.

1 Like

yeah. i think there is no problem with the power.

Now I have powered it like this…

more views from other angles…

still no success :disappointed:

Hello,

I just tried with a phone charger and it worked, I have the same board parameter as you for info.
I see that there is no antenna on your emitter and receiver. When you have done the test with and without the usb cable ,was your RF sensor at the same distance from the receiver between the two tests?

i just added the antennas using a one core wire and still no success.

the distance with and without the USB cables are the same.

:cry:

Do you have some voltmeter to check the voltage with and without the usb cable at the different circuit points(Vin, emitter vcc, receiver vcc)?

Another test could be to comment the line:
Serial.begin(9600);

and put TRACE to 0:
define TRACE 0

You can also try to remove the emitter.

Forget my last answer, here is a good track to follow:
http://www.esp8266.com/viewtopic.php?f=32&t=11492

Try putting the receiver on pin D1 = GPIO5
and replace in the code:
mySwitch.enableReceive(0); // Receiver on pin D3
by
mySwitch.enableReceive(5); // Receiver on pin D1

1 Like

Excellent! It works!! Thank you so so much! I spend so much time on this and I almost gave up. Now, I can even powered it by using a power bank and plug it directly into the microUSB port. :joy:

OK now I’m going to put it into HA. I realize that it only publishes to a single topic; home/433toMQTT. I think that’s fine if I only have one sensor in the house. But what if I have more than one?

Great to heard, documentation and sketch has been updated thanks to your test :slight_smile:
I really don’t explain why it was working in my config and not yours.

Regarding HA that I don’t have to test, maybe you could change the payload values:
Switch:

  • platform: mqtt
    name: “Office Fan1”
    state_topic: “home/433toMQTT”
    command_topic: “home/MQTTto433/”
    payload_on: “1382147”
    payload_off: “1382156”
    optimistic: true
    retain: true

Switch:

  • platform: mqtt
    name: “Office Fan2”
    state_topic: “home/433toMQTT”
    command_topic: “home/MQTTto433/”
    payload_on: “1382134”
    payload_off: “1382178”
    optimistic: true
    retain: true

But HA expert will be more competent than me to answer

@1technophile, thanks again for your sample. I can see it is for switch. How about the presence sensor or the door sensor? The presence sensor only transmit a single code when there is a movement. It doesn’t transmit another code for the opposite. I assume the same for the door sensor. How do you put it in HA?

I have tried using the presence sensor as a binary sensor. This is what I have in my configuration…

binary_sensor:
  platform: mqtt
  state_topic: "home/433toMQTT"
  name: "Motion Sensor 1"
  payload_on: "3316132"
  sensor_class: motion

Now I have a new entity known as binary_sensor.motion_sensor_1 and when there is a motion, the state turns to on. The problem is, the state remains on forever :sweat_smile:. Is there anyway to change the state back to off after awhile?

Maybe you could use some kind of timer in HA to turn it off after a predefined time?

Example comes from @Partybug thanks to him

1 Like

@1technophile. i guess i need to setup an automation to change the entity state to off after certain duration. This is what I come up with so far…

The binary sensor:

binary_sensor:
  platform: mqtt
  state_topic: "home/433toMQTT"
  name: Motion Sensor 1
  payload_on: 3316132
  payload_off: '3316132off'
  sensor_class: motion

The automation:

- alias: 'Off Timer - Motion Sensor 1'
  trigger:
    platform: state
    entity_id: binary_sensor.motion_sensor_1
    state: 'on'
    for:
      seconds: 10
  action:
    service: mqtt.publish
    data:
      topic: 'home/433toMQTT'
      payload: '3316132off'
      retain: 'true'

So far so good :smile:

3 Likes

Now I am planning to make things more exciting by adding this broadlink wall switch into the mix. Since it is also using 433Mhz, do you think it will work?

You are awesome 1technophile! In my config, I had trouble with two instances of “Switch:” The dash (-) denotes a second instance of the switch. If you have only one remove the dash and spaces accordingly:

Switch:
2- platform: mqtt
4name: “Office Fan1”
4state_topic: “home/433toMQTT”
4command_topic: “home/MQTTto433/”
4payload_on: “1382147”
4payload_off: “1382156”
4optimistic: true
4retain: true
2- platform: mqtt
4name: “Office Fan2”
4state_topic: “home/433toMQTT”
4command_topic: “home/MQTTto433/”
4payload_on: “1382134”
4payload_off: “1382178”
4optimistic: true
4retain: true
#__- platform: mqtt
#____name: “Future Switch ready to deploy”
#____state_topic: “home/433toMQTT”
#____command_topic: “home/MQTTto433/”
#____payload_on: “1382468”
#____payload_off: “1382135”
#____optimistic: true
#____retain: true

A leading number or “_” equals a space (I have yet to figure out how to display a leading space on webpages.But it’s important in YAML.)

I buy a set of 5 Etekcity switches. Sniff the codes and remark them out of my YAML like I have shown, but they are ready to go.

i have been thinking on the security aspect of this setup. if i can find out my motion sensors code by simply using some electronic parts, then anyone else can do that as well.

what if a burglar use it to monitor the codes? he will know when there is no one in the home if no new data is transmitted from the sensors, right?

Like what @brusc has said,

the signal can be jammed as well.

What do you guys think? How secure is this and how do you guys make it more secure? What kind of application do you use these sensors for?

I’m not concerned with security at all. In fact, I’ve published my Etekcity remote code just in case you want to turn on and off my office fan in my town of Seymour, Indiana.

  1. Sometimes security gets a little paranoid. For example: WEP. Once this wireless security protocol was broken no one used it and it is no longer available. Did you read about someone breaking into a WEP internet router and doing massive damage? So is the security really necessary?

  2. Opportunity… How many people on this forum will be in Seymour IN to “sniff” my 433Mhz codes and turn off my fan or lights?

  3. Why would they want to? A burglar is more likely to listen to a scanner than your 433Mhz traffic. Get a home security system and a dog. Burglars avoid both of those but they won’t target your home because you use 433Mhz devices. And I highly doubt they will sit outside your home long enough to listen to your codes. If they did, they wouldn’t know what the codes were for. They could listen for other devices like a garage door opener, or wireless remotes etc.

Someone could jam or sniff my codes even if I didn’t automate them with HAss…

Hope this helps.

2 Likes

you are right that if you use 433mhz for your homeprotection that it isnt bulletproof.
and it is probably unwise to automate with 433 mhz to open your frontdoor.

but if you use it for light, heating, motion, etc. control i see no problem.
a burglar would need to yam your system as well as do all other things to be detected.
and he would probably expect that if a house is automated with 433 mhz, that there are other things he cant yam there which show that he is there.

so no im not worried about securing my 433 mhz products.

1 Like