433mhz, infrared IR to and from MQTT on ESP8266

Fxxx Fxxx
Sorry @1technophile Yes now I remember, that I have one MQTT Gateway for testings and works with UltraSonic to measure the amount of granule in the container - and I thought I should change home to something else that I would understand clearly which module send / get information … and the modification remained half-finished :confused:

I fixed that and now it’s seems to be work now.

Thanks one more time @1technophile.

Glad to heard that it works !

With Python 3.4 being deprecated and not supported in 2018 I decided over Christmas to install the latest version of Hassbian onto a spare card.

Issue I have is that my old MQTT broker Mosquitto is not fully supported in Stretch so I have had to resort to the embedded broker HBMQTT. Everything works apart from sending IR TV channel commands via shell in HA - have changed mosquitto_sub to hbmqtt_sub but it doesn’t work. Here is a sample code

hbmqtt_pub -u homeassistant -P MY-API-PW -t home/commands/IR_NEC/IRBITS_32/RPT_4 -m "573503"

Any idea ho I can resolve this, apart from getting Mosquitto installed fully ?

I’m not sure why you say Mosquitto isn’t supported by stretch.

I updated my Hassbian install to stretch, python 3.6 and HA V0.59.2 all at once and my MQTT (based on Mosquitto) works perfectly fine.

Did you do a rolling update of Python on your current version of Hassbian or did you download the latest Hassbian and install Mosquitto from there ?

I did the latter and am currently running Python 3.5.3 from memory.

If you did the former did you follow a guide that I could use ?

Finally got Mosquitto installed using this built in Hassbian script

and using this URL workaround

sudo curl -o /opt/hassbian/suites/install_mosquitto.sh https://gist.githubusercontent.com/ludeeus/7325db650da394401741c1db64491beb/raw/49aa38d66fe9ce2d2002af950046b36e4b2bfeb4/install_mosquitto.sh && sudo hassbian-config install mosquitto

from https://github.com/home-assistant/hassbian-scripts/issues/76

Needed to remove all traces of old Mosquitto code first before it would install correctly.

HI all
on uploading the sketch, it appears to hang at 100% and no further response from the board. Any ideas?
Cheers

lower the baud rate of the serial monitor and restart your device - you should see a load of random characters then it will try and connect to wifi then mqtt

BTW are you using an old NodeMCU or the newer ones ? I use NodeMCU 1.0 under tools.

Hi @BertrumUK thanks for the advice. I’ve set the baud to 19200 and see characters, but they stop and I have a red led ON. I bought this board, not sure which version this would be, is there some way to check?
Cheers

Looks like a v2 version so you should use "NodeMCU 1.0 esp-12. What happens if you reset it with the baud speed set back to 115200 ?

Per the Amazon product description at the bottom of the page

  1. Set up your chip as:
    Tools -> Board -> NodeMCU 1.0 (ESP-12E Module)
    Tools -> Flash Size -> 4M (3M SPIFFS)
    Tools -> CPU Frequency -> 80 Mhz
    Tools -> Upload Speed -> 921600
    Tools–>Port–> (whatever it is)

Yes its working now, thanks for your help!

1 Like

What needed changing ?

Board -> NodeMCU 1.0 and serial baud 115200.
Btw what topic are RF published on? Cheers

My code is here as well

https://github.com/BertrumUK/home-assistant/blob/master/packages/switch/switch.yaml

1 Like

Thanks mate!

1 Like

Hi, I successfully upload the code and its working fine. I have a RF motion and door sensor.

I want to make automation that if motion detect show “Motion Detected” if no motion show “Stand By” and if door is close show “Door Close” if open show “Door Open”.

Can somebody help me to make automation?
I receive code from motion sensor “9069033” and receive two code form door sensor close code “9242062” and open code “9242058”.

Thanks in advance,

Hi,

Your request is unclear. Do you want an action performed when any of the events (motion detected, door closed, door open) is fired? Or do you want a sensor that will display the messages that you mentioned? Also, what’s happening if there is motion detected and the door is open?

Could you post the binary sensors for open door and motion sensors? Do you have an automation to reset PIR sensor (as PIR sensors do not send an “off” code, each time a motion is detected the same code is received thus HA won’t be able to consider it as a trigger)?

Does the sonoff bridge support both 433 and 315mhz?

If not is there a good solution for getting both working?

On sonoff RF bridge I don’t think so. On ESP8266 or ESP32 you can have both working, more info on this request:
https://github.com/1technophile/OpenMQTTGateway/issues/140

OpenMQTTGateway compatible with ESP32, I have opened a specific thread for this chip:

1 Like