How to make use of generic 433Mhz sensors?

Thanks got it working but not able to connect to mqtt now.
Attempting MQTT connection…
failed, rc=
-2

I have put the same settings in userconfig.h as they are on my homeassistant mqtt server.

What does the serial i/f show, does the NodeMCU connect to WIFI OK?

It gives me -

.
.
.
.
WiFi connected
client mqtt not connected, trying to connect
Attempting MQTT connection…
failed, rc=
-2
try again in 5 seconds
Attempting MQTT connection…

-2 : MQTT_CONNECT_FAILED - the network connection failed so something is wrong with your mqtt setup, probably the broker address?

Got it working… My bad had to give manuall ip as i was not using DHCP.

Please help me

https://community.home-assistant.io/t/how-to-create-your-own-433mhz-rf-smart-outlets/17435?u=smile

Looks like your code is…

off 1114388
on 1114389
protocol 1
However it looks like your transmitter is not working, do you have another you could try?

I think also code is
off 1114388
on 1114389
protocol 1
Do you watch video which i have attached ? When I click switch on Homeassistant then can see code on PuTTY which transmitter sending to socket.

Sorry yep it looks like rfrx is receiving the same code that the remote is sending so I guess the tx’er is working. I would try with another tx/rx program like pilight.

Thanks :slight_smile: I will try pilight.

How do you get the state to be on / off or motion detected / no motion ?

I only get the value and not the state.

1 Like

MQTT binary_sensor status is updating too late. When I open the door or trigger the motion sensor, first attemp instantly displayed on my iPhone Home app. But second attempt (or toggling sensor status) not update the sensor icon status on iPhone. I need to kill Home app and relunch for getting latest status of binary_sensor.

Here is my config code in yaml:

 binary_sensor 
    - platform: mqtt
      name: "Balkon Motion"
      state_topic: "home/433toMQTT"
      payload_on: '1795210'
      payload_off: '1795210off'
      sensor_class: motion

Home assistant states works normally. Any advice?

@kayhanbelek

I believe this isn’t an issue with the sensor but the Iphone home app not updating timely. You can verify this by using the home assistant web page from a computer and watching the iphone at the same time. If the computer updates then it is the iphone app at issue.

thanks your advice. but all other sensors are updating immediately in Home App. only RF-MQTT (via nodemcu) updating unstable

I’m thinking of using this Sonoff RF to control some of my devices. But I’m having problem replacing the firmware. I’m wondering is it possible to control this purely using your gateway without connecting it to WiFi?

If openmqttgateway is able to listen the code of the remote control it shouldnt be a problem to replicate it to control the sonoff.

Hi,
I have upload the code successfully but when i run “sudo mosquitto_sub -t home/# -v” getting following message:

Connection Refused: not authorised.

and above message is repeating…

I have uploaded sketch with following detail:

Please let me know what I am doing wrong?

You showed pictures of your arduino but your error is with the server mosquitto… Is it installed? Is it running? I logged into my Pi3 where my mosquitto is installed and ran the above command in a terminal window and it worked. Hope this helps…

mqtt server is running, please see bellow video:

I just removed the IR receiver from the breadboard and now its showing following message in serial monitor:

SmartLink
OpenMQTTGateway ip adress:
0.0.0.0
.
.
WiFi connected
Attempting MQTT connection…
connected to broker
subscription OK to the subjects defined

but when I run “sudo mosquitto_sub -t home/# -v” in putty it says “Connection Refused: not authorised.”