433mhz, infrared IR to and from MQTT on ESP8266

It was V533. I have another BT module, How to modify the code to be able to support HM-11? I tried but wasn’t detecting the SKYBEACON. Only the HM-10 works. Now I’m trying to integrate to HA. Searching for yaml sample.

Did you try to upgrade HM-11 firmware also?

Yes, both the HM-10 & HM-11 are now at V550.

In thus case we will need to connect to it by serial and see what s going on by launching one by one the different AT command. Could you do that or do you need some help to do it ?

I think i find the glitch with my HM-11.

  1. I send "AT+DISI? - no response
  2. I send "AT+DISC? - got response
  3. I send "“AT+DISI?” - then it works.

Now its working, can you modify the Arduino code based on this case?

Still i couldn’t make it work with HA using the HASS.IO image. In the below yaml config example, what is the “device_id” parameter? And where the payload? Sorry just new to this.

Example configuration.yaml entry

sensor:
platform: mqtt_room
device_id: 123testid
name: ‘Cool device’
state_topic: ‘room_presence’
timeout: 5
away_timeout: 60

Try with this code after setting the HM-11 into user_config.h in line 177 (comment 176)

Could you point me the datasheet link you are refering please. One user tested this command without success.

Thanks, will try tonight.

Be carefull about maybe the wiring defined in user_config.h and the corresponding pins.

Quick noob question.

I have currently the NodeMCU and RF receiver, but my plan is to also include HM-10 for BT (when it arrives).

If I upload the gateway code now (while HM-10 is not physically connected), can I maintain the user config to already consider it to be a BT gateway, or should I just keep RF and then re-upload to also be BT, once I have the HM-10 connected?

Thanks in advance.

Hello, it should work but it s nevertheless better to comment ZgatewayBLE

1 Like

Hi,

Firmware v540 on a cheap Chinese clone of HM-10 (AT-09) also works using flashing method described below. I think most of the easily available HM-10 modules are, in fact, clones.

With its default firmware, AT-09 it’s not recognized by nodemcu (even, though, bluetooth devices can connect to it).

I’ve tried flashing newer firmware versions (v550/549) on it after upgrading to v540, however although the flashing is successful, the module doesn’t work (led is red stable as if associated) and does not respond to AT commands.

After flashing with v540, needs AT+START (although led blinks as if working) and then it can be removed from the computer and placed on the remote BT/RF/IR gateway.

Unfortunately, the bluetooth module causes the gateway to crash (randomly); nodemcu looses connectivity and then restarts.

Tracking works great with Tile as it does not require enabling/disabling bluetooth connection on the phone each time when at home (although it requires that Tile it’s not associated).

Clone:
https://www.aliexpress.com/item/AT-09-Android-IOS-BLE-4-0-Bluetooth-module-for-arduino-CC2540-CC2541-Serial-Wireless-Module/32822551059.html

Genuine??? (maybe, most of the time HM-10 is described as having a black PCB and this is significantly more expensive than the generic module):
https://www.aliexpress.com/item/HM-10-transparent-serial-bluetooth-4-0-bluetooth-serial-port-module-with-logic-level-transformation/32238168582.html

Flashing process:

good news,i have at-09,and i want to know can i flash the fireware throug the nodemcu not arduino uno?

Yes, it works (I flashed v540 again, this time using nodemcu)

Just remember to modify the sketch for CCLoader.ino in order to use nodemcu pins:

  • the sketch uses pins 4,5 and 6 on the Arduino however pin 6 is not connected on nodemcu;
  • modify section “// Debug control pins & the indicate LED” to the actual pins on the nodemcu (for convenience purposes :smiley: I added a D in front of each pin from Arduino):
    int DD = D6;
    int DC = D5;
    int RESET = D4;

Also, it’s no need to look for the v540 firmware on that malware infested site mentioned in the video (it is already included in ccloader repository)

great,thanks,i’ll try that

could you share an example of bt yaml file

try this to fix the led,and try v546 firmware
https://forum.arduino.cc/index.php?topic=393655.msg3137812#msg3137812

Actually the led is not the issue on >v540, it’s the board :smiley: there is no reply from it (semi-brick). I can re-flash it with v540 afterwards.

I’m not a software engineer so there might be easier (and better) ways to do it, but here it is.

The expire_after option sets the sensor value to unknown after a reasonable amount of time (you need to set yours based on the measurement of seconds between beacons). I’ve then added the binary sensor component as it can be used with “to: (on or off) for: minutes: x” (sensors cannot be used with “for”) in automations.

I guess further adjustments could be used (such as a binary sensor with a state “leaving home” if the sensor’s value drops below -80 or “coming home” if it’s above -75/-70 and increasing) however this method I think is not 100% accurate and it should be connected with other presence sensors.

I. Create a mqtt sensor:

  • platform: mqtt
    state_topic: “home/BTtoMQTT/BTADDRESS”
    name: btdevice1
    expire_after: 300

II. Create a binary sensor based on the previous mqtt sensor:

  • platform: template
    sensors:
    btpresence1:
    friendly_name: BT presence Phone
    value_template: >
    {% if is_state(‘sensor.btdevice1’, ‘unknown’) %}
    true
    {% else %}
    false
    {% endif %}
1 Like

Nice, I’ve been waiting for this all the time. How would you implement the Signal Strength of the Beacon in yaml file. I would like to try. The Skybeacon I have i can set the TX power to them.

Again, not an IT professional :smiley:

A) Sensors

- platform: mqtt
  state_topic: "home/BTtoMQTT/BTADDRESS"
  name: btdevice1test
  expire_after: 300
- platform: template
  sensors:
    testbt
      value_template: >
        {% if is_state('sensor.btdevice1test', 'unknown') %}
          -100
        {% else %}
          {{states.sensor.btdevice1test.state | float}}
        {% endif %}

I guess it could be done in just one step in order not to have 2 sensors for the same job, but I prefer to keep things separate to know where the bad smell came from (when the device is offline/away the RSSI value will be a small negative number, -100 or -120 for example). Also, having this second sensor would allow for easier calibration (add/subtract any number from the RSSI value determined in first instance).

- platform: statistics
  entity_id: sensor.btdevice1
  name: btdevice1stats
  sampling_size: 10 

B) Binary sensor:

- platform: template
  sensors:
      thresholdbtdevice1:
        friendly_name: thresholdbtdevice1
        value_template: '{{ states.sensor.btdevice1stats_mean.attributes["average_change"] | float > 0 }}'

When the average change is negative (the device moves away from the BT gateway, based on the sampling size of 10 beacons) the sensor is off; when the average is positive it means that the RSSI value is increasing and the sensor is on. As mentioned before, having a binary sensor would allow “to & for” in the automation.

C) Then throw all the mess under the carpet (keep in view only the threshold sensor):

  customize_glob:
    "sensor.btdevice1*":
      hidden: true
3 Likes

Yes, you are professional