Sonoff RF Bridge door sensor events to icons. No Tasmota, No MQTT. AlexxIT's Sonoff Lan (In Progress, need help)

UPDATE: I couldn’t do it without MQTT, so I posted my solution here

I really love AlexxIt’s Sonoff Lan HACS Integration. Sonoff should put him on the payroll TBH.
I m trying to integrate my GS WDS07 door sensors to Hass in a meaningful way without Tasmotizing it. I m so close, yet so far… I guess this is our life story when we work on our smart homes. :smile:

I paired the contacts in eWelink app as alarms, restarted the server and this is the message I get under STATES in Sonoff Bridge.

manufacturer: SONOFF
model: RFBridge
sw_version: PSF-BRA-GL v3.4.1
local: online
command: 1
ts: 2020-05-29T09:26:26.000Z
name: Freezer 1 Door Closed
friendly_name: BasementBridge
supported_features: 1


manufacturer: SONOFF
model: RFBridge
sw_version: PSF-BRA-GL v3.4.1
local: online
command: 0
ts: 2020-05-29T09:26:26.000Z
name: Freezer 1 Door Open
friendly_name: BasementBridge
supported_features: 1

When listening to state_changed events I get this.

Event 43 fired 7:11 AM:

{
    "event_type": "state_changed",
    "data": {
        "entity_id": "remote.sonoff_1000ae9d28",
        "old_state": {
            "entity_id": "remote.sonoff_1000ae9d28",
            "state": "on",
            "attributes": {
                "manufacturer": "SONOFF",
                "model": "RFBridge",
                "sw_version": "PSF-BRA-GL v3.4.1",
                "local": "online",
                "command": 0,
                "ts": "2020-05-30T04:23:28.000Z",
                "name": "Freezer 1 Door Open",
                "friendly_name": "BasementBridge",
                "supported_features": 1
            },
            "last_changed": "2020-05-30T03:59:38.129868+00:00",
            "last_updated": "2020-05-30T04:23:27.921023+00:00",
            "context": {
                "id": "2fddd93eb858438fbc6ece5455502a6b",
                "parent_id": null,
                "user_id": null
            }
        },
        "new_state": {
            "entity_id": "remote.sonoff_1000ae9d28",
            "state": "on",
            "attributes": {
                "manufacturer": "SONOFF",
                "model": "RFBridge",
                "sw_version": "PSF-BRA-GL v3.4.1",
                "local": "online",
                "command": 1,
                "ts": "2020-05-30T04:23:33.000Z",
                "name": "Freezer 1 Door Closed",
                "friendly_name": "BasementBridge",
                "supported_features": 1
            },
            "last_changed": "2020-05-30T03:59:38.129868+00:00",
            "last_updated": "2020-05-30T04:23:32.317201+00:00",
            "context": {
                "id": "d2522b9baa6941e18d3e5dcae089f40c",
                "parent_id": null,
                "user_id": null
            }
        }
    },
    "origin": "LOCAL",
    "time_fired": "2020-05-30T04:23:32.317224+00:00",
    "context": {
        "id": "d2522b9baa6941e18d3e5dcae089f40c",
        "parent_id": null,
        "user_id": null
    }
}

The only unique thing to each event that I can see is the “command” portion which is the order I used when pairing in the app

0 was the first pairing (Door 1 closed)
1 was the second pairing (Door 1 open)
etc.

Could someone please shed some light as to how to “extract” this command portion and use it in order to build a door state card in lovelace?

If this works somehow, it may very well be the simplest data aquisition strategy for RF Signals.

Thanks in advance.

UPDATE:

I managed to trigger a notification based on the command value using an automation.

  alias: Door 1 Open
  description: ''
  trigger:
    platform: event
  - event_data:
    event_type: sonoff.remote
       command: 0
    condition: []
  action:
  - data:
    service: persistent_notification.create
     message: Freezer Door 1 is open
    

So it works. Which sensor did you use?

The GS WDS07 sensors which I ve heard good things about them, and they were really cheap.

The sketch works as a notification. I can’t figure out how to turn the messages into meaningful icons for a general overview of the door and windows state. (open/closed). I guess maybe an input.boolean??

Not sure about it,but maybe you should try as template

You only get an event ? And not for your

remote.sonoff_1000ae9d28

but for

sonoff.remote

?

For some reason francisp yes. I just copied Alexx’s instruction on the readme, and it just worked. :roll_eyes:

how many door sensors (or other devices connected to your rfbridge) do you have ?

10 sensors, 20 “commands”, from 0 to 19. They all work just fine within the eweelink app and I can see their notifications on Home Assistant just fine.

Just trying to help. In your example with the notification, you could create a notification for each by setting command from 0 to 19 ?

Thank you very much for that Francis. Yes, I can create an automation for each event, that is two per sensor, one for close and one for open, and I can see them on my notification window.
The challenge for me, is to manage to create a dashboard (glance card) of door states in order to monitor them.
Thanks for your help again

hi, did you find a solution for the dashboard in order to have visual if the doors are opened or closed?

Sonoff did not even give me a discount on devices. I bought them for tests at full cost. :smiley:

1 Like

Wish the knew how useful for them (and us off course) your job is