How to make use of generic 433Mhz sensors?

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

It is a good question even if I’m not a security expert I will try to answer; I think it is a question of risk versus means that we want to make in our security systems. Several points:

  • Regarding jamming, every RF transmission could be jammed, wifi, bluetooth, 2G, 3G, 4G, 433mhz, zigbee etc the safer way would be to be with wired sensors, as soon as we are going RF we are exposed to powerfull emitters that emit on multi frequencies. Unfortunately it seems quite easy to find frequency jammers.
    –>What can be done is to detect jammer, by sending a regular signal by RF and check if this signal is received by the central

  • Regarding making a study of RF codes emitted, to know if you are home or not I think in all the case if someone target your home and do some observation he can deduct this quite easily (if you haven’t taken some actions to prevent this).
    –>Do you know that there is function of certain home automation systems that record the change of lights, plugs … and reproduce it as a presence simulation scenario. Even if you don’t have this function you can produce a script with some random properties to reproduce your presence when you are not here.

In my side I think I have a very low risk for sniffing and even if they succeed in, my alarm can’t be deactivated by RF. I think the risk of jamming is higher. That’s why I have some wired sensors like security cameras. In all the case putting zigbee, zwave, proprietary protocols or using wifi will not help against jamming.

1 Like

Can’t say, I would be interested if it is the case but I don’t think it will work out of the box. We will need someone to hack the signal and modify rcswitch library.

1 Like

Thanks, you mean that if there is a second instance of switch you need to add a dash before “platform”?

Thanks everyone for your input on the security. I guess 433Mhz sensors are good enough for home use but not for sensitive places like a bank vault.

IMHO, 433Mhz sensors are more suitable for usage at the exterior of the house such as balcony, car porch, backyard, front door, back door, windows, etc… because there is no point sniffing the code when a burglar can visually monitor the areas.

That’s a good idea. I think I can create an automation in HA to do just that.

Yes, I know that and I plan to do that when I change all my wall switches or bulbs to smart one that can be integrated into HA.

I guess the only way to find out is to get my hand on one of these babies.

please let me know how it works out, because then i will buy some to.

Yes. From what I can tell most use style 1 on this page: https://home-assistant.io/getting-started/devices/ This allows for using include files seen in the cookbook section. (If you use style 2 everything has a unique name with no dashes)
So in style 1 there is one category for switches, lights, groups etc. So if you have multiple switches, you simply add the dashes before each platform under the switch section. (don’t forget spacing)

OK. Now I have a major concern in regards to the magnetic door sensor.

If the sensor can only send a signal when the door is open, how do I know when the door is close?

Without any signal when the door is close, I cannot use it for certain automations such as…

  1. Alert me when the window is not close during rainy days.
  2. Switch on light when the door is open and switch off light when the door is close
  3. Alert me to close the window when outdoor temperature is hotter than indoor and vice versa.

I cannot use the off timer automation used for motion sensors because it does not reflect the real situation.

Do any of you know any 433Mhz door sensors that have open and close signals?

the sensor you have is an alarm sensor.

for Obvious reasons you only want to be warned when a window or door is opened by a burglar.
he probably wont close it anyway.

if there are simple doorautomationsensors with 433 mhz i dont know.
i know you can use a simple sensor on an arduino (magnetic, PIR, distance, power, etc.)
but you need an arduino(or nodeMCU) somewhere in the neibourhood from your windows(s) and door(s)

1 Like

I think you want a few of these…

2 Likes