433toMQTTto433 Bidirectional Arduino Gateway

Thanks. Looks more like a DIY approach. At that price, it’s better to go for Z-wave, isn’t it?

By the way, I notice you released v0.4 and also updated the wiki. Congrats. I notice in https://github.com/1technophile/OpenMQTTGateway/wiki/Module-Overview-ESP8266 , none of the possible combinations allow DHT + I2C. Is that correct?

I think you would have better battery life with moteinos but i need some input about zwave battery life before confirming that.
Regarding the 0.4 you can add a dht with i2c if you connect it to D5 you will have to change the pin definition into the program. It is not available by default due to the fact that with i2c you can plug temperature sensor or other sensors to the bus.

I have few z-wave sensors and I started to use them since May 2016. If remember I only changed the battery once.

Anyway, regarding the I2C modules, can I use both BME280 and BH1750 in the same gateway? I need to measure both light and temperature.

I just tested with both DHT22 and BH1750. Guess what? Both are working!

Hi,

Is there any wireless, independent (433 Mhz) LDR sensor?

For temperature and humidity there are weather station remotes on 433 Mhz, however for LDR I haven’t seen a similar solution.

I would be reluctant in placing a NodeMCU in environments with high temp, high moisture (such as in a bathroom). Even with DYI waterproofing I’m not comfortable with cables carrying more than 5V (there was also that guy who got electrocuted in the bathroom when using the iPhone charger).

Yes you can use several i2c sensors on the same wiring

1 Like

Hi,
i have problem with 433toMQTT with NodeMCU,
i have MQTT communication between HA and the Node, but for some reason there is no rf signal receive or transmit from the Node…

can anyone help with this one?

Please post to :slight_smile:433mhz, infrared IR to and from MQTT on ESP8266

The current post is dedicated to Arduino setup and no NodeMCU

Regarding your issue do you see on the serial monitor "MQTTtoRF " in the serial monitor

Did you checked the troubleshooting section?

HI,
i managed to solve this issue, now i can get the MQTT massage via mosquito :slight_smile: but i didn’t succeed with configuration it to trigger event in HA.
my goal is to make an rf wall switch to trigger rf relay and to show status of the relay in the UI,(i know all about the un reliable with rf status…)
i managed to control the relay via HA with MQTT. but this is where im stuck at…

@HA-PI:~ $ sudo mosquitto_sub -t home/# -v
home/OpenMQTTGateway/LWT Online
home/commands/MQTTto433/PLSL_247/433_1 8496001
home/433toMQTT/protocol 1
home/433toMQTT/bits 24
home/433toMQTT/length 473
home/433toMQTT 5595072

this is my input from MQTT when pressed on the RF switch.

Good I am new in all this world, you could share me the script (script.officemot) to be able to understand it. Thank you

Sure @EAN . Here is my office motion script.

script:
  officemot:
    alias: Office Motion
    sequence:
      # Cancel ev. old timers
      - service: script.turn_off
        data:
          entity_id: script.officetimeoff
      - delay:
          seconds: 5
      - service: homeassistant.turn_on
        data:
          entity_id: group.office
      # Set new timer
      - service: script.turn_on
        data:
          entity_id: script.officetimeoff

  officetimeoff:
    alias: "Turn off office after 10 minutes"
    sequence:
      - delay:
          minutes: 10
      - service: homeassistant.turn_off
        data:
          entity_id: group.office

I think I posted the spacing right but check to make sure. Good Luck.

@Partybug Thank!!!

I have been using this project for some time, fantastic bit of kit. I do have an issue however.

I have recently added 3 door sensors that send both open, and closed codes. That part works perfectly. The issue is when HA is restarted, if a door is open, it will revert back to closed on reboot. The open status does not seem to be retained.

This is the binary_sensor I have set up for one of the doors.

- platform: mqtt
  name: "Front Door"
  qos: 1 # I have tried 0 for this as well
  state_topic: "home/433toMQTT"
  payload_on: "12510986"
  payload_off: "12510990"
  device_class: door
  retain: true

I have even tried using an automation to publish the state on change to attempt to have it retained, no joy.

- alias: Set State of Front Door
  trigger:
    platform: state
    entity_id: binary_sensor.front_door
    to: 'on'
  action:
    service: mqtt.publish
    data:
      topic: 'home/433toMQTT'
      payload: '12510986'
      retain: true

Is there something obvious I am doing wrong?

Hi,

There is nothing wrong with your settings. OpenMQTT is set to publish without retain flag.

Your automation to publish the state is on the wright track, however you might want to use another topic for publishing in order not to get confused as the home/433toMQTT gets overwritten each time a new message is received (and it is not retained, thus when restarting HA it is blank). There are a few components that support restore state however binary sensor is not among them.

- alias: Set State of Front Door on
  trigger:
    platform: state
    entity_id: binary_sensor.front_door
    to: 'on'
  action:
    service: mqtt.publish
    data:
      topic: 'home/devices/frontdoor'
      payload: 'on'
      retain: true

- alias: Set State of Front Door off
  trigger:
    platform: state
    entity_id: binary_sensor.front_door
    to: 'off'
  action:
    service: mqtt.publish
    data:
      topic: 'home/devices/frontdoor'
      payload: 'off'
      retain: true

and then the binary sensor (the one that you have would become an intermediate sensor and you can hide it from HA):

- platform: mqtt
  name: "Front Door Modified"
  qos: 0 
  state_topic: 'home/devices/frontdoor'
  payload_on: "on"
  payload_off: "off"
  device_class: door

Actually, you can use a single automation in order to reduce number of entities managed by HA (as the trigger would look for changes in the binary sensor or not set an intermediate binary sensor after all, but in this case it needs the condition part to look for either payloads on or off - 12510986 or 12510990). Are you comfortable with that?

@Petrica Thanks for the reply. I had assumed that the retain flag wasn’t being sent. This is something that would be very beneficial to be added in, however.

I will adjust my automation and see how I go. Thanks again.

@Petrica I think I have it sorted, thanks for the suggestions. Here is my config, just using one door sensor as an example. I have a single automation covering all the open/close events for all 3 doors (I think) :slight_smile:

binary_sensor.yaml

- platform: mqtt
  name: "frontdoor"
  qos: 0
  state_topic: "home/433toMQTT"
  payload_on: "12510986"
  payload_off: "12510990"

- platform: mqtt
  name: "Front Door"
  qos: 0
  state_topic: 'home/door'
  payload_on: "12510986"
  payload_off: "12510990"
  device_class: door
  retain: true

automation.yaml

# DOOR STATE #
- alias: Door State
  initial_state: True
  trigger:
    platform: mqtt
    topic: home/433toMQTT
  action:
    service: mqtt.publish
    data_template:
      topic: "home/door"
      payload_template: '{{ trigger.payload }}'
      retain: true

Hi,

Yes, one automation to rule them all :slight_smile:

Except you would need to change the other two mqtt binary sensors to monitor “home/door” topic too. There is no need for any binary sensor to monitor “home/433toMQTT” topic anymore (you end up with one automation as the sole overhead).

Look to Mqtt.py log warning "No matching payload found for entity" for description of the log warnings that you will going to have :slight_smile:

Yes, I have all 3 doors using the /home/door topic, I think that is what you mean?

The problem now is I need to write an automation to have the home/433toMQTT binary sensor grab the state of the /home/door binary sensor as when I reboot twice, the state is lost again as the 433toMQTT binary sensor resets at boot. I hope that makes sense.

You only need to keep the automation from above.

The binary sensors will become as following:

- platform: mqtt
  name: "Front Door"
  qos: 0
  state_topic: 'home/door'
  payload_on: "12510986"
  payload_off: "12510990"
  device_class: door
  retain: true

- platform: mqtt
  name: "Other Door 1"
  qos: 0
  state_topic: 'home/door'
  payload_on: "11111"
  payload_off: "22222"
  device_class: door
  retain: true

- platform: mqtt
  name: "Other Door 2"
  qos: 0
  state_topic: 'home/door'
  payload_on: "33333"
  payload_off: "44444"
  device_class: door
  retain: true

But again, this is a quick and dirty fix (the downside is that if the doors are opening/closing while HA is restarting then the state will be in topic “home/433toMQTT”; because automation is not working until HA is up again the topic “home/door” is not being updated).

The best way would be to have OpenMQTT publishing with Retain flag (and thus to have binary sensors monitor “home/433toMQTT” again).

1 Like

@Partybug can we make this happen at all?