433mhz, infrared IR to and from MQTT on ESP8266

If it works, then it can be modified quite a lot with conditions (“and”/“or” style) in regard of sun or other HA components

ok i’ll try later

@jxjhheric, what kind of automation you are trying to do? If you got the mqttroom working with the config I sent, you should have a sensor called sensor.. You may now create automations using this sensor. The state should be the name of the room or “away”. Something like:

alias: Sent a test message 
trigger:
  platform: state
  entity_id: sensor.lyra
  from: 'away'
  to: 'casa'

action:
    - service: notify.Lyra
      data_template:
          message: "Lyra arrived!"

Yes, I just wanted to check out another way
mqttroom working with the config you sent, and I modified something like distance, it’s good.
But there is about 5s relay from kitchen to living room, and sometimes get wrong status. I have two Hm-10 module in each room . When I am in living room with the ibeacon, the distance is 1m , and distance from kitchen is 2.5m, but in HA, it’s showing me livingroom 3s , then, kitchen 2s,alternately.
that is why I hope to get another way.
The modules you bought have arrived? Share the processing

@clyra I am trying to make the Android phone to be ibeacon, I use an app to do that, that is working, but the mac address changes when turn on the app everytime, you know, that’s not friendly to the opengateway with dynamic macaddr in mqttroom . would you suggest something?

Hi,

Any clues on what protocol these weather stations 433 mhz sensors use?

There is nothing being published in the 433toMQTT topic.

there are some cheap bluetooth beacons that i want to try. They didnt arrived yet. About the delay, i dont think there’s much you can do because it depends on the hm10 scan time. If you run a mosquito_sub and subscribe to your mqtt server you will see that the openmqtt gateway update the topic every 8-10s.

did you try to go down the time between HM10 scanning into ZgatewayBT.ino?

#define TimeBtw_Read 10000

If you’re trying to turn on the lights using BLE beacons and MQTT room just kiss it goodbye because it ain’t gonna happen. You would need a response time less than half of a second from the beacon in order to reach a total acceptable delay of one second otherwise you would spend 10 to 20 seconds in a dark room expecting for the lights to turn on.
There are better, faster and cheaper ways of turning lights on and off (if wall switches are not an option then look for PIR or microwave sensors, either independent such as 433 Mhz, Z-wave, Zigbee or connected to an Arduino/ESP module).
For using automation that performs specific tasks when leaving/coming home (such as turning AC on/off, turning off TV or open hallway lights in order not to find yourself in the dark when arriving home) then BLE is ok. However for instantly turning the lights (with a delay that is imperceptible) then you could either use a wall switch, a motion sensor or even a RFID sensor (and scan a card or token before entering/exiting the room).

Hello,

Currently this is not supported by either rcswitch or newremoteswitch (libraries integrated into openmqttgateway).
If you want to do some experimentations you could try remote sensor library from fuzzylogic:
https://bitbucket.org/fuzzillogic/433mhzforarduino/wiki/Home

Also a sensor for last room that recorded a motion can be implemented (below for PIR sensors):

- platform: template
  sensors:
    current_room:
      friendly_name: "Current room"
      value_template: >
                  {%- set pirs = [states.binary_sensor.room1pir, states.binary_sensor.room2pir, #etc - needs all PIR sensors#] %}
                  {% for pir in pirs %}
                    {% if as_timestamp(pir.last_changed) == as_timestamp(pirs | map(attribute='last_changed') | max) %}
                      {{ pir.name }}
                    {% endif %}
                  {% endfor %}

I think I better not do this as the remote sensor for the weather station currently (almost) fully blocks the regular 433 Mhz sensors in the room from reaching gateway :smiley:

It seems I find a 433 mhz jammer for cheap :wink:

indeed, no need to add RF pollution to our environments. You can now build a jammer detector as you have a generator :slight_smile:

Damn, with all this wireless energy from Z-wave, 433 Mhz, Bluetooth, undocumented 2.4 Ghz and Wifi it seems that I still can’t boil an egg in the morning…

lol, do you want to add a feature request?

A request for a Napalm/Greek fire flamethrower that can finally boil the egg which modern technology RF is yet incapable off? :slight_smile:

I think that the jamming occurs right at the weather sensor (although it should update only once per 30 seconds in accordance with Italian language manual) as the gateway doesn’t receive any code from the devices that were previously successfully sending codes and there isn’t any serial monitor trace in the gateway either. So I don’t know if a software update for gateway can resolve this by splitting the traffic from PIR and from weather station into 2 separate topics.

Though it might be that the device is defective or simply unapproved for use (the date on the board it is 2011 and there was also a thick layer of dust on these retail boxes in the shop).

@Petrica @clyra @1technophile thanks for your help, folks

i think I picked the wrong direction

How to make pir sensor (such as hc-sr501) working with openmqttgateway?

As @Petrica said, if you want to turn on the lights as you enter a room, then BLE wont be your best bet. Currently I have a xiaomi motion sensor on my hallway and it works as expected. Something with 433mhz should be cheaper, but now seen Petrica jammer, I will stay with the zigbee ones :-).

Yes, xiaomi’s products are valuable, I am in China, many friends around me are Optimistic about them.but I bought several nodemcu, and also got the hc-sr501.if the openmqttgateway can be compatible with them, I will be happy
@1technophile

After some additional testing I think I’ve found the culprit. The weather station base might be defective (or not) as it gets a loud humming inside. It is supposed to synchronize with with weather forecast signal received from Frankfurt emitter :smiley:. And obviously there isn’t any forecast received although it’s still trying.
It only has a jamming radius of about 1.3-1.5 m so it doesn’t affect any of the devices outside the room.

I agree that Zigbee might be the current best option as they have encryption and they cost just a little more than 433 Mhz counterparts (well, actually double :slight_smile: ).

Z-wave devices are simply too expensive (and sometimes quite cumbersome to setup).

Although 433 Mhz devices have no encryption, being dirt cheap and easy to setup, they remain a viable alternative to Zigbee if used only for lights and not with a full alarm system (as the armed and disarmed codes can be easily sniffed and an attacker could disable the alarm). With 433 Mhz controlled lights there is the risk than an attacker will turn on and off the lights during sleep so that it would annoy the owner and make him go Zigbee instead :slight_smile:. In theory, if a protocol deficiency for Z-wave or Zigbee is found then the attacker could also gain access to gateway, then to LAN, then bad things would happen. However, with a wired 433 Mhz gateway (on an Arduino Mega/Uno), there won’t be any unwanted access as the device cannot be knocked out of the wifi network or controlled remotely (except for cases when 433 Mhz codes can be interpreted directly by gateway and translated into ssh commands). There might be some risks with wireless gateways on NodeMCUs however any vulnerability is likely due to the wifi network.

@jxjhheric

Look for Bruh multisensor for setup with NodeMCU and PIR sensors.

However, I had some issues with PIR on Bruh setup: I had to use separate USB chargers for each NodeMCU and not use USB hubs, set the WLAN on guest mode in order for NodeMCU not to “speak” among them, otherwise the PIR sensor would fire at random thus I decided it wasn’t worth it. I’ve then ordered (from China, obviously :slight_smile: ) wall switches, P819 PIR and D026 Open Door sensors which are all 433 Mhz units. Since starting using PIR sensors I hardly ever press the wall switch.