433toMQTTto433 Bidirectional Arduino Gateway

Do we have to change the topics also in user_config.h. I am getting output for serial monitor like -

.
WiFi connected
client mqtt not connected, trying to connect
Attempting MQTT connection…
connected to MQTT broker
subscription OK to the subjects defined

not like - arduino “connected” & “subscription OK to home/MQTTto433/” and nothing coming up more on serial monitor

No need to change the topic in user_config.h.

What are you testing, IR, RF or BLE?

i am testing RF only

ok did you try to publish to home/MQTTto433 topic

mosquitto_pub -t home/commands/MQTTto433 -m 1315156

as stated on the guide:

This is the output i am getting. Maybe problem is with RF transmitter and receiver but i was using same on RPi with command line in HA. I have double checked the connection with nodemcu. Using pin d1 and d2. Now LWT is also showing offline

You have to remove the / after MQTTto433 as the example
mosquitto_pub -t home/commands/MQTTto433 -m 1315156

so as to have more details subscribe also to :
sudo mosquitto_sub -t home/# -v

You will see the topics on which you are publishing.

Please note that you are on the thread of the arduino gateway, as you are using a nodemcu I advise to post your questions on the dedicated thread.

Oh i didn’t noticed. I will check and report on the other post :slight_smile: Thanks

@Partybug this config you have here, is this for a switch or binary sensor or ? I can’t seem to get this to trigger when the pir sends it’s payload so i went to use a trigger in the automation but i rather have this defines separately.

Hope to hear from you,

thanks
/donnib

Had to re-read the forum. I posted several configs. All of them are for etekcity switches except for the doorbell. I do have a pir sensor in my office now and I use it to turn on one etekcity switch and a philips hue light in the ceiling. The pir sensor is a compatible one listed in this forum so it sends a 433mhz code to the gateway for MQTT.

Here’s my trigger section of my config for the pir. You will have to set up your automation scripts which are covered in another forum. Hope this helps. :slight_smile:

  - alias: OfficePres
    trigger:
      platform: mqtt
      topic: home/433toMQTT
      payload: '30###07'
    action:
      - service: script.turn_on
        entity_id: script.officemot
      - service: automation.turn_off
        entity_id: automation.officepres
      - delay: 
          minutes: 2
      - service: automation.turn_on
        entity_id: automation.officepres   

The pir sensor sends multiple instances of the same code in rapid succession. So I turn this script above (script.officepres) off for 2 minutes before I want to see the next motion. The script.officemot will turn off the light automatically after 10 minutes passes. If there is motion every 2 minutes - the timer is reset. Occasionally the lights turn off if I’m reading a long forum post and forget to move. :slight_smile: You can’t perfect everything. :slight_smile:

Good Luck - Partybug

that is great, good job @partybug, i am very interested turn on tekcity when i seat on my chair.
did you use any occupancy sensor ? chair or bed? i would like use that, but i dont find any configuration to use a esp and mqtt. i find one solution, but use mysensors,and i dont want do build other gateway.

I never even heard of an occupancy sensor. What a great idea… Do they exist?

they exist, but if i understood correctly they are expensive unless you create them yourselve.

here is a video how to create bed occupancy sensor

@ReneTode i already saw that vídeo, but that uses mysensors, i would like only use one ESP8266 with mqtt under my bed. because i dont want to build other gateway to use mysensors.

i think if i use this code:

it Works, what do you think.
Sorry off topic. i will open a new post on PROJECTS

with mysensors you dont need an extra gateway if you use an esp8266.
an esp with mysensors protocol can talk directly over wifi to HA.

its even faster and more reliable because you dont have a mqtt server between your sensor and HA.

1 Like

So if I build a mysensor on a esp8266 I don’t need a mysensor gateway to link it to Hass?

Something like this…

2 Likes

indeed. a mysensors on an ESP8266 can be a wifi gateway itselve and at the same time be a sensor.
so every ESP can be its own gateway, but every second ESP or arduino can also connect to a gateway.

1 Like

Thank you for the clarification! That’s actually very interesting. In that case does the sensor still need a nf24 radio?

it does.

it cant function as a mysensors without a radio. (allthough that a gateway with sensors actually could function without a radio, but then you need to alter the base library from mysensors)
the radio is 1 of the baseparts from mysensors.
but they are cheap, and unless you want to connect a lot of sensors, mostly the radio is not an annoying part.

1 Like

@ReneTode So, i can build any sensor/actuator exemple: door sensor, gas detector, etc etc, only with esp8266/nodemcu without RADIO?