1technophile / OpenMQTTGateway

MQTT gateway for ESP8266 or ESP32 with bidirectional 433mhz/315mhz/868mhz, Infrared communications, BLE, Bluetooth, beacons detection, mi flora, mi jia, LYWSD02, LYWSD03MMC, Mi Scale, TPMS, BBQ thermometer compatibility & LoRa.
https://docs.openmqttgateway.com
GNU General Public License v3.0
3.6k stars 792 forks source link

Sonoff RF Bridge weird behavior #431

Closed myiotcenter closed 5 years ago

myiotcenter commented 5 years ago

Hi, All of my wall switches are using 433mhz and I’ve been using OMG v0.7 for a year with custom pcb + wemos mini and RF modules and everything works great.

I recently purchased Sonoff RF Bridge to replace my old Gateway since it’s more compact in size. I managed to flash the Bridge using OMG v 0.9.2Beta and able to control the switches from HomeAssistant just like my old Gateway.

I then realized that something different when I want to control the switches in group / batch.

In HA, I setup group of lights that would be switched off 15 minutes before sunrise. Using the old OMG all lights in that group can be switched off normally, means all lights within that particular group are sequentially turned off, but using Sonoff RF Bridge I got random results, means from 5 lamps within the group, there are times where randomly 1 or 2 lamps are failed to turn off.

I triggered the condition to switch off the lamps using Sonoff RF Bridge while listening the mqtt messages and could see all mqtt messages are correctly sent by HA.

To investigate the issue, I created another group consists of 2 lights and whenever switched off I can see following MQTT messages :

Client mosqsub/18816-hassbian received PUBLISH (d0, q0, r0, m0, ‘home/OMG/OMG2ndFl/commands/MQTTtoSRFB’, … (7 bytes)) 1202030 Client mosqsub/18816-hassbian received PUBLISH (d0, q0, r0, m0, ‘home/OMG/OMG2ndFl/commands/MQTTtoSRFB’, … (7 bytes)) 1202040

Only 1 light will be switched off and random. Using the old GW I don’t get this behavior, all MQTT messages are triggered and all lamps are switched off.

But if I switched off each light individually from HA or using mqtt pub all work normally.

This is the setup in my HA using old GW :

platform: mqtt name: ‘2nd Fl Livingroom 1’ command_topic: ‘home/OpenMQTTGW2ndFl/commands/MQTTto433/433_1/PLSL_390/RFBITS_24’ payload_on: ‘1202031’ payload_off: ‘1202030’ optimistic: true platform: mqtt name: ‘2nd Fl Livingroom 2’ command_topic: ‘home/OpenMQTTGW2ndFl/commands/MQTTto433/433_1/PLSL_390/RFBITS_24’ payload_on: ‘1202041’ payload_off: ‘1202040’ optimistic: true

and this is the setup when using Sonoff RF Bridge :

platform: mqtt name: ‘2nd Fl Livingroom 1’ command_topic: ‘home/OMG/OMG2ndFl/commands/MQTTtoSRFB’ payload_on: ‘1202031’ payload_off: ‘1202030’ optimistic: true platform: mqtt name: ‘2nd Fl Livingroom 2’ command_topic: ‘home/OMG/OMG2ndFl/commands/MQTTtoSRFB’ payload_on: ‘1202041’ payload_off: ‘1202040’ optimistic: true

Is this something to do with Pulse Length & RF Bits ?

I triggered the command using old OMG and listen the mqtt message using Sonoff and this is the message :

Client mosqsub/24156-hassbian received PUBLISH (d0, q0, r0, m0, ‘home/OMG/OMG2ndFl/SRFBtoMQTT’, … (89 bytes)) {“raw”:“2F44049201AE12576F”,“delay”:1210,“val_Tlow”:1170,“val_Thigh”:430,“value”:1202031} Client mosqsub/24156-hassbian received PUBLISH (d0, q0, r0, m0, ‘home/OMG/OMG2ndFl/SRFBtoMQTT’, … (89 bytes)) {“raw”:“2F44019A049C12576E”,“delay”:1210,“val_Tlow”:410,“val_Thigh”:1180,“value”:1202030}

Not sure why the Tlow and Thigh for on and off messages are in opposite range.

Any idea how can I solve this issue? Thank you.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.