433toMQTTto433 Bidirectional Arduino Gateway

@Partybug

Not close to Seymour, but would be happy if I could mess with my own 433 devices! lol

Question: the state_topic: “home/433toMQTT”, how do you get that particular data?
I have a node-red setup with 433 and Im trying to have HA send 433 binary codes through HA to MQTT to control my 433 (doorbell, fan, etc)

I know it may sounds like a stupid question but I tried something similar:

Switch:

  • platform: mqtt
    name: “DoorBell”
    state_topic: “home/433toMQTT”…???
    command_topic: “home/MQTTto433/”
    payload_on: “my binary code here”
    payload_off: “my other binary code here”
    optimistic: true
    retain: true

Does it look ok?

@aelg305,
The command topic is the MQTT topic that HA uses to send codes to the device.
To answer your question, the state_topic is the mqtt topic to listen to data from an external source which in my case is the remote control that came with my switch. So if your fan has a remote control, you press the button on the remote and the 433toMQTTto433 gateway would “hear” that remote too (like the fan did) and send the MQTT traffic to HA to change the state of the fan so that HA in synch with the fan’s status.

I’m not familiar with node-red, but you didn’t mention your MQTT broker which is needed to “operate” the traffic for MQTT topics. I use Mosquitto (an MQTT broker) on the same Pi with HA. After Mosquitto is setup and you can listen and send mqtt manually, don’t forget to add this information to HA with this configuration.

mqtt:
broker: 192.168.xxx.xxx
port: 1883 (match to yours)
client_id: xxxx (mine is named hass)
keepalive: 60

I found this website which could be helpful to you: https://www.rs-online.com/designspark/building-distributed-node-red-applications-with-mqtt

And if your ever in Seymour Indiana…

1 Like

@Partybug i know you have a some 433 mhz etekcity, but i have a question for you.
i have a similar etekcity, but the other debrand.
its has one phisically button, its possible when i press the phisically button , HA knows the state of etekcity?

got the topics working:
using node red, I used the “debug” function.
To answer the question about the broker: mosquitto as well, setup similar to yours.

Im able now to send messages from the hass “set state” page manually, working now on getting the same results with automation, etc.

Thanks for the article…it did help

1 Like

How many devices do you think you could safely proxy thru an arduino? What about multiple events coming in at the same time (or when it is pushing the message to mqtt)?

I have 15 devices emitting by 433mhz running without problem. Difficult to say what could be the maximum quantity that could pass to the arduino, a load test should be done. I 'm quite confident If I increase the number of sensor to 20-30 it will be ok.
About multiple events coming at the same time, before having a bottleneck with MQTT you could have a wave superposition in 433mhz.
I did some test with two remote control sending two different code, if I press the two buttons at the same time the signal is not caught. If I introduce a little gap less than 0,5s the both signals are read. Indeed my sensors are not able to receive an acknowledgement so as to know when the message is caught by the gateway. By the way not able to repeat in case of a message not received.
For my home automation this constraint is not disturbing me I don’t need to have acknowledgement, I prefer to have several cheap sensors compared to one with acknowledgement more expensive.

Regarding the other direction pushing the message from MQTT to 433mhz it is working well, the gateway is not pushing signals at the same time. I have some scene that require several plugs to be turned ON and they are turned ON one by one.

Thanks for the feedback.

I had planned to start with those inexpensive door/window sensors. I have 18 windows that I’d put them on, and maybe some doors. The windows will be such a rare event, that I don’t expect much traffic from them.

I was thinking, however, if I expected it out, like temperature/humidity, motion, etc.

I have a Pi I was going to use for another purpose and I thought, instead of an Arduino, I could run this on the Pi. I did hear there was a bit of an issue with the Pi feeding back noise.

I am waffling between Arduino and Pi. I considered spending the money for the setup over at pilight that includes a filter (since I don’t feel like putting it together myself), but they seem to be out of the filters at the moment.

You have also the esp8266 gateway solution:

It’s a quite simple solution.

I have never tested to connect directly the rf receiver and emitter to the pi, mainly due to the fact that I’m handling some emergency function at the arduino gateway level for reliability concerns (siren of the alarm), and i don’t want to deport that to the pi

PS: I have also 433mhz motion, temp , hum as sensors and also smoke detectors

I thought about that too. In a nutshell, the “other” stuff I was going to put on it, is 3 switch inputs on GPIO pins and also run a bluetooth ibeacon. It is the ibeacon part that trips up the arduino. There are solutions, but they seem rather expensive really. I already have the Pi3 and it has bluetooth. And I wanted to wire the network.

I wonder if maybe the ESP32 would work. It will also have bluetooth and ble. I’ll do some reading on it. It wouldn’t satisfy the wired requirement, but I don’t really need it wired. It would be nice, but oh well.

On the paper ESP32 would be perfect, but I’m not sure that there is sufficient ressources in the net to do the job with it unless you are a specialist.

Why not combining the approaches, a pi for HA, the ibeacon detection and your switch and an esp8266 or arduino for the 433mhz communications?

Yeah, I agree. I only spent about 30 seconds looking at the ESP32 before I posted.

I will probably do something like that. I actually have a NUC that I’m running HA on, and it has bluetooth in it as well. A lot of options. The big question and and back on track of the thread, is that, the Arduino will probably suffice for the type of 433 traffic I will have in the foreseeable future.

can you show me whats smoke, humity and temperature you use? its are rf too?

Smoke:
http://www.banggood.com/433MHZ-Home-Security-System-Wireless-Smoke-Detector-Fire-Alarm-p-967105.html

For hum and temp they are home made:

I don’t have smoke, just temperature and humidity. I am using (before I found HA) the tags from wireless tags. I’ve had them for a while now. I had to write a Kumo app to post the changes into HA.

http://wirelesstag.net/

I wouldn’t really recommend them. They aren’t much cheaper than some of the zwave solutions (and more than some others).

It was a bit of effort to get them in HA.

1 Like

heys guys, i trying find the solution for my case. and i find this:

I want to control my lamps by a normal switch and home assistant,but i want that HOME ASSISTANT knows what the state of lamps.
by the RF commands, its easy with solution of 1technophile sniffing the codes.
but phisically the home assistant dont knows the real state …if on or off.
anyone have the solution for this case?

i dont want spend much money.

excelent solution and very cheap… your automation is the more cheap of this forum , i like that.
i went to see what you used, and you use arduino, but i can use esp right?
Do you think it is possible to put the images of your blog online? They are offline
I saw that you used openhab but you can do the same tutorial but for the home assistant?

I have ordered some 433Mhz items for use in HA and they are in their way. Some have already arrived. This is what I will have…

15 door/window sensors
6 PIR motion sensors
4 PIR curtain motion sensors
4 weather stations (temperature + humidity)
1 doorbell
1 siren
1 smoke detector
1 gas detector

I have 6 occupants and they are mostly in the house.

I’m wondering too how well will this gateway handle the load. Only time will tell.

@masterkenobi

If you have bought weather stations like a WT450 (ie all in on temp/humidity, not one you make yourself) the station will likely use a Manchester encoding method that is not supported by the RCSwitch library used in the gateway in this thread.

This has been my issue in the past also.

If you want something that can accept more complicated signals (like Manchester encoding), you could look at RFLink, or roll your own - which I have struggled to do myself.

I have built a link between RFLink and MQTT, which can then be used in HASS as MQTT sensors & switches. RFLink needs an arduino mega which becomes a black box of their software, I have added an ESP8266 (NodeMCU in my case) to the arduno to convert the RFLink data to MQTT. See https://community.home-assistant.io/t/project-rflink-to-mqtt-using-esp8266-and-arduino-ide/7131

There is also a component being developed if you want the arduino mega to be physically attached to your HASS device by USB cable. See https://community.home-assistant.io/t/support-for-rflink-gateway/996/40

1 Like

I bought this one…

https://www.aliexpress.com/item/433MHz-Wireless-Weather-Station-Digital-Thermometer-Humidity-Sensor/32590571931.html

Someone said it works with RFXCOM in the review and it is also listed in RFLink : Supported devices list.

I always thought if it works with RFLink, it will work in this gateway too.

Anyway, I hope it will work with this gateway. Otherwise I will consider your solution. Thanks for sharing.

Yes there is several alternatives of rflink bridge to mqtt including this one which seems interesting also

Rflink is interesting for the number of protocols supported and the ability of the developpers to add them. If we had so much protocols with rcswitch it will be great. My main concern with rflink is its blackbox principle, in my case i need to add some logic at arduino level and i can’t as we don’t have access to the code. It s a developper choice that i can understand.