433mhz, infrared IR to and from MQTT on ESP8266

I’ve ordered a remote from the compatible list now to test with so will see when it arrives.

Hello to all,
I´m implementing a arduino rf 433mhs receiver and transmitter to control my switches. I was able with the sketch bellow to push the buttons through serial monitor and it´s working fine all switches are responding to the commands.

My big question is, is it possible to integrate this with hassio? I was looking into your project but I´m no programmer and very noobie in all of this so my skill is very low.

I´m running hassio in a rpi , and my arduino it´s a uno with rf transmitter and receiver, I also have a spare nodemcu but I didn´t test the sketch.

Here bellow find the sketch I´m using. Apreaciate any help:

#include <livolo.h>

byte trport =8;              // port of 433-transmitter
Livolo livolo(trport);        // transmitter connected to pin trport
int onoff = 10;               // data from Serial 
unsigned int ID = 6400;       // ID of Remote - type your own ID/ f.e. 6400; 19303; 10550; 8500; 7400
unsigned int IDB = 0;         // Number of remote's button #1: 0, #2: 96, #3: 120, #4: 24, #5: 80, #6: 48, #7: 108, #8: 12, #9: 72; #10: 40, #OFF: 106
unsigned int SCENE1 = 90;     // Number of scene (available 90, 114, 10, 18)

void setup() {
Serial.begin(9600);  // serial init
}

void loop() {

// Serial reading
// 
if (Serial.available() > 0) 
{
onoff = Serial.read()-48;
Serial.println(onoff); 
}

if (onoff == 1)
{
  livolo.sendButton(ID, IDB);
  Serial.println("Button"); 
  delay (1000);
}

if (onoff == 2)
{
  livolo.sendButton(ID, SCENE1);
  Serial.println("Scene"); 
  delay (1000);
}

if (onoff == 0)
{
  
  livolo.sendButton(ID, 106);
  Serial.println("off"); 
  delay (1000);
}
}

To integrate with Home assistant one possibility is to use MQTT, this is where OpenMQTTGateway comes and can answer your need.
Nevertheless I see on your sketch that you use livolo switches and I don’t know if they are compatible with the RF libraries used by OpenMQTTGateway. Maybe some other users already tested that?

1 Like

Hello tks for the quick reply, how could be one way to connect everything to check if it´s possible to work?

I´ve only seen some people using toghther with mysensor and appdaemon but it´s too much for my knowledge.

1 Like

The simple way maybe is to connect your emitter and receiver directly to the PI and find the associated component of HA

Tks for the reply, it seems that someone have already made something here: Livolo RF433 Switches . Quick question for the rpi with hassio comunicate to arduino should I connect them via usb cable? Or should I have transmitters 433mhz and receivers in both? I couldnt understand in the documents.

You don’t need an arduino, just connect your receiver and emitter to raspberry pi and use something like pilight.
Nevertheless I suggest you to go to a dedicated thread related to this solution as this is not related to OpenMQTTGateway

I am trying to decide RF 433 codes,
But unable to decode
I am using nodemcu V3 by wemos but it’s not lolin

Hmm, did you checked the troubleshooting session of the wiki

In all the case if you don’t succeed after reading it we will need more details to help you

Dear,
I have tried all pins,
but am keeping on trying.
Let me know what details do you require?
thanks for taking time.

I am using wemos nodemcu V3 and for RF 433 generic transmitter and receiver,
I would like to get some suggestion.
Is it ok to use generic RF 433 transmitter and receiver, which is not working.
I am trying to get codes from geekcreit 12v 4ch relay module, but got no success.
Do you suggest any other RF 433 transmitter and receiver to get it work with Geekcreit 12v 4ch module relay?

Please guide/suggest

Product which I have
Nodemcu V3

Esp32

Geekcreit 12v 4ch

RF 433mhz

Hello. Did you add antenna to your emitter and receiver ?
If you checked the troubleshooting section , what are your results from it ?
We need more infos about what is working and what is not working.

When I subscribed to home/OpenMQTTGateway on my mosquito,
It does shows me online,
But when I publish message to home/OpenMQTTGateway I can’t see anything on my nodemcu connected on serial port,
I have led attached to my receiver which blinks faster/reacts when I press button of my remote,
Don’t understand where am I wrong.

could you post what the serial monitor say and what you are publishing?

this are the result which i get through serial monitor
connected RX-3 to transmitter and D3-0 to receiver on nodemcu v3 as provided in configRF.h

WiFi ok with manual config credentials
OpenMQTTGateway mac:
68:C6:3A:9F:9C:01
OpenMQTTGateway ip:
2047584448
1883
Connecting to MQTT by IP adress
192.168.11.33
IR_EMITTER_PIN
16
IR_RECEIVER_PIN
2
ZgatewayIR setup done
RF_EMITTER_PIN
3
RF_RECEIVER_PIN
0
ZgatewayRF setup done
ZgatewayBT HM1X setup done
MQTT connection…
Connected to broker
Subscription OK to the subjects
Uptime (s)
120
Remaining memory
40552
RSSI
-38
SSID
Jay Ambe 1
Activated modules
RFIRBT

nd while mqtt sub
mosquitto_sub -u () -P () -t +/# -v

/home/nodemcu/OpenMQTTGateway/LWT Online
/home/nodemcu/OpenMQTTGateway/version 0.8beta

dear why my opengateway ip shows a constant number and not ip?

1 Like

could you deactivate first the IR and BT gateway as you don’t need them for the moment.

Could you try to connect your receiver with D2 (and put 4 in config_RF.h for RF_RECEIVER_PIN)

connected and done as per your suggestion

results
form serial monitor

WiFi ok with manual config credentials
OpenMQTTGateway mac:
68:C6:3A:9F:9C:01
OpenMQTTGateway ip:
2047584448
1883
Connecting to MQTT by IP adress
192.168.11.33
RF_EMITTER_PIN
3
RF_RECEIVER_PIN
4
ZgatewayRF setup done
MQTT connection…
Connected to broker
Subscription OK to the subjects
Uptime (s)
120
Remaining memory
43648
RSSI
-41
SSID
Jay Ambe 1
Activated modules
RF

cant even get subscription address on serial monitor

not receiving any rf codes through mqtt or cant decode any remote codes.
i get codes from one terminal from which i publish
-t /home/nodemcu/MQTTto433/ -m 1315156
on another terminal which was subscribed to /home/nodemcu/#

I am uploading code with 115200 and watching serial monitor with 115200

could you check that your receiver and emitter are well powered with a multimeter?

yes i already checked it, it is was fluctuating when i was using with breaboard, but when i plugged in direct it suppplies constant power,

I would like to know,

  1. would i get mqtt messages on my nodecmu? I cant get any mqtt messages on my serial monitor,( which i am not getting when i pub message from terminal)
  2. do i need to enter my mqtt clientid?

Please guide

Dear, Please guide
i dont receive any mqtt messages on my nodemcu connected to serial monitor,
Please guide me
thanks in adv

my config
#define Gateway_Name “OpenMQTTGateway”
#define Base_Topic “/home/nodemcu/”
#define version_Topic Base_Topic Gateway_Name “/version”
#define will_Topic Base_Topic Gateway_Name “/LWT”
#define will_QoS 0
#define will_Retain true
#define will_Message “Offline”
#define Gateway_AnnouncementMsg “Online”

when i subscribe with this
mosquitto_sub -u () -P () -t +/# -v
i get
/home/nodemcu/OpenMQTTGateway/LWT Online
/home/nodemcu/OpenMQTTGateway/version 0.8beta
but i cant send any commands nor receive.

Please guide me thanks