433toMQTTto433 Bidirectional Arduino Gateway

Hi

I have a similar set up to yours and thanks to you for sorting the MQTT part. I was wondering if I can add a brightness_scale to my MQTT and if it can be configured using IR codes?

I am controlling a dimmer light switch which is controlled by an IR LED with codes for the levels of brightness.

I have the IR codes for various brightness levels and was wondering if I could use the brightness_scale to turn on and off the lights and adjust their brightness all in one?

Hi @bachoo786,

I haven’t made my IR sensor gateway yet. (I’m slightly confused on which IR part to order) It was created and mentioned earlier by the talented 1technophile later in the thread.

As for making this an all in one dial for the multiple IR codes… Sounds like what your asking is for a light switch component to be made. I know we can send the individual codes as individual switches (for example: an on/off switch, a “25% switch” a 50% and 75% switch etc, but to make it a sliding scale on the webpage would require this. Have you looked at the components that dim yet to see if they are similar enough to use?

Could you send me the model or more info on your ir controlled light?

1 Like

I just received this and I can confirm it is NOT SUPPORTED by this gateway :disappointed:

@masterkenobi now, whats your solution? you will make a project with a dht22? its cheap and 1technopile has one project on your site.

it seems that library are available on the net to support weather stations with arduino, never tested them.
If you want to do some test the library name is remotesensor and available below
https://bitbucket.org/fuzzillogic/433mhzforarduino/wiki/Home

If tests are satisfying (the library is able to read data coming from your station) I could try to add the library to the gateway.

The temperature sensors like @masterkenobi,has in the picture typically use manchester encoding - a more complicated method which allows error checking of the received signal.

Hopefully the additional library mentioned would work for you, if not I would suggest building an RFLink. However you will need an arduino mega to use that software as provided by the RFLink people.

To link it to HASS via MQTT, you could add an ESP8266 like mentioned in this project

There is also work on a RFLink specific component for HASS which uses the RFLink arduino plugged directly in to your HASS server via USB

Inserted in this forum for cross reference of other threads in the forums!

Phil

Thanks. I have downloaded the stable code and put the RemoteSensor folder in C:\Users\abc\Documents\Arduino\libraries. Then I added these 2 lines into the sketch…

#include <SensorReceiver.h>
#include <SensorTransmitter.h>

Then I upload it to the NodeMCU.

Is there anything else I am missing because it doesn’t seem to work.

I think you need to take some of their examples from the remotesensors examples folder and load them to the esp8266,open the serial monitor and see if it receive something.

OK. I used this example; ThermoHygroReceiver.ino

Before I upload it to my NodeMCU, I changed the Serial.begin from 115200 to 9600 and the SensorReceiver pin from 0 to 5…

void setup() {
  Serial.begin(9600);

  // Init the receiver on interrupt pin 0 (digital pin 2).
  // Set the callback to function "showTempHumi", which is called
  // whenever valid sensor data has been received.
  SensorReceiver::init(5, showTempHumi);
}

Once it is done uploading, I opened up the serial monitor and all I can see is weird characters…

Does that mean my sensor is not supported?

@masterkenobi,

Weird characters on the serial monitor often means you have the serial monitor at the wrong baud rate.

What rate is in the Serial.begin statement in the sketch - set your monitor to that if it is different to what you have now & you should start to see normal characters.

@phileep

As you can see from the above code, I have changed it to 9600 and the serial monitor is also using 9600 (as selected in the bottom right corner).

I did the same test with my nodemcu and an arduino mega I saw also the strange characters. It doesn’t seem to work

that’s too bad. do you have any idea which 433mhz weather station is supported by RCSwitch library?

@masterkenobi why do you not build a 433mhz dht22 sensor? its easy and more cheap and good results i think.
other question that i have for you, do you have your automation,yaml on github? i would like check that for some ideas.

I can consider that. Do you have any guide I can follow? The only thing I worry about DIY my own sensor based on my experience in MySensor, is the battery life. Normally, this kind of task requires an arduino or a nodemcu. When you add up the cost of each components, effort and time, it is really not worth it. Not to mention the poor battery life. I wasted 6 months trying to make Mysensor works. I dumped it due to poor battery life.

No, I don’t. Still trying to clean up and optimize each automation.

@masterkenobi follow this guide, https://1technophile.blogspot.pt/2016/12/low-cost-low-power-room-sensor-with.html
the owner that is technopile, but he has openhab, but i think with your skills, you can convert that to homeassistant.
check this, and say me what do you think about that.

if you want to go, with mqtt without 433mhz, you have this:
http://morphx.net/doku.php?id=dht22-sensor

well thanks. @1technophile’s guide sure made it sounds so easy.

Before I pull my solder box out again, may I know from @1technophile these questions…

  1. how long is the battery life? Have you changed the battery?
  2. Instead of every hour, can I make every 5 minutes by changing the TimeToSleep value?
  3. Some of your photos are broken. But I don’t see any arduino’s board anywhere in the guide. I only see the atmega328p chip. Is this the one? https://www.aliexpress.com/item/2pcs-Free-Shipping-ATMEGA328P-ATMEGA328P-PU-DIP-28-New-parts-best-price-and-short-lead-time/1758575480.html
  4. The resistors and LED are not in the BOM. May I know what resistor are you using?
  5. For DIP socket adaptor for the ATmega, is this the one? https://www.aliexpress.com/item/10PCS-28-Pin-DIP-SIP-IC-Sockets-Adaptor-Solder-Type-Narrow/32505374462.html
  6. How do I upload the program to this? I know for Arduino, I just need to plug it to my PC via USB cable and then load it using the IDE. But for this, I don’t see any USB port.

Sorry for all the silly questions. My background is not from electronics.

Hello,

Before going into this let me give you some warning, the most complex part of this tutorial is the bootloader and program loading into the standalone atmega328p it can take you a lot of hours (it was my case)…
Secondly I don’t know if HA is compatible with this, the question is HA able to handle mapping of value:
value 34567 received as RF = 4,567V
value 34463 received as RF = 4.463V

Finaly for your info I’m thinking about adding new libraries to the gateway to make it compatible with weather station but I need some time to test and check the feasability.

Here are the answers of your questions
1 Not changed the battery yet, here is the change in term of voltage (mv) which can help to deduct the battery life

2 You can make it every 5 minutes but it will reduce the battery life …

3 yes it is this one, you need an arduino uno to program it

4 resistor and led are not compulsory indeed, a 1000ohm one should be ok

5 yes it is

6 you need to program it either with an arduino uno either with an ftdi adapter, with an arduino follow the steps of “steps to follow” chapter of this tutorial

You mean the sensor will send signal to the gateway and then the gateway will publish payload=34463 to this MQTT topic: home/433toMQTT? What if I have multiple sensors? How do HA knows the payload is from which sensor?

You just change the offset on the sensor, instead of emitting 34463 an other sensor can emit 64463 or 134463. That’s why a mapping is needed for each sensor to say where the value goes