Broadlink S1C Kit sensors in HA using python and MQTT

thanks. I just want to know how I can show the previous state of the sensor; either door locked or door unlocked.

in history or logbook but that template sensor. will will display

If I say it, in other words, the sensor should only be required to respond to above two codes and hold the previous state for other codes.

I’m not sure whether retain: true can be use or not.

I fond the way to do it. I just followed NightRanger’s post

Here is what I did,

Automation.yaml

- alias: 'Front Door Sensor Opened Retain'
  initial_state: 'on'
  trigger:
    platform: mqtt
    topic: sensors/rf/receiver
    payload: 13527306
  action:
    service: mqtt.publish
    data:
      topic: 'home/entrance/door'
      payload: '13527306'
      retain: 'true'


- alias: 'Front Door Sensor Closed Retain'
  initial_state: 'on'
  trigger:
    platform: mqtt
    topic: sensors/rf/receiver
    payload: 13527310
  action:
    service: mqtt.publish
    data:
      topic: 'home/entrance/door'
      payload: '13527310'
      retain: 'true'

Binary_Sensor.yaml

  - platform: mqtt
    name: "Front door sensor"
    state_topic: "home/entrance/door"
    payload_on: "13527306"
    payload_off: "13527310"
    qos: 0
    device_class: opening
2 Likes

I’ve created a Custom Component as a Sensor platform based on @NightRanger script.
No need for mqtt with it and it requires a simple yaml configuration.

2 Likes

thanks for the guide.
I would like to ask if someone has tried the same guide using the Broadlink S2 hub?

I tried to send these packets to arm my S2C with a RM 3 mini but It doesn’t active the alarm.
Can you help me to do this using switch on HA? Thanks

Did you mean the keyfob to activate arm_home, arm_away and sos?
If for the SOS alone this is the link, also the packet might be different for each keyfob. You have to learn the packet of your keybob.

Also now there is custom_component for broadlink s1c here. Have have tested with S2C as well.

Yes. I mean the key fob to activate arm_home, arm_away and sos.
I read that post and I tried also those packets that as you said are different for each keyfob, so it didn’t work.
However, how I can a learn the packets? Since with my RM Mini 3, it is not able to capture the packets.

Yes I use the custom_component and it properly works, thanks.

If your rm mini 3 cannot learn packet. There is people from broadlink s1c alarm kit custom senser component which he use s2c. If you can ask him or try with his code. As he also cannot use my code but he has generate by his keyfob from S2C

Ok thanks,
otherwise you know which hardware to use to capture the packets?

broadlink rm pro which support both rf and ir frequency. also support learn and send packet from ha

rm mini only support ir frequency right? I’m not sure if you add rm mini to your ha already. You can go check from hamburger icon(top left of your ha) look for developer tools>then service(remote icon).

On right hand panel> domain> switch.broadlink_command_learn_packet.your-rm-mini-ip <== if there is something like this show mean that your rm mini can learn the command. however the packet has to be ir frequency not rf.

Ok understood.

With my RM min I’m able to capture packets for instance for the remote TV controller, and similar… maybe this are only IR.

On right hand panel> domain> switch.broadlink_command_learn_packet.your-rm-mini-ip <== if there is something like this show mean that your rm mini can learn the command. however the packet has to be ir frequency not rf.

I do this to learn packets but with the S2C key fob doesn’t work. So, you suggest to buy eventually a rm pro right?

or you can test from e-control app/ let the rm mini learn packet from keyfob. This to be test from your e-control app first. If rm mini can capture your keyfob then you can import the packet to your ha and you don’t need to buy new rm pro.

But if cannot learn from e-control app. then you need to buy rm pro.

Yes, already tried and it failed. :frowning:

I this point I think that I’ll go for the Pro.

Thanks

Check from the switch broadlink component how to import packet to your ha from e-control app.

Or you can use switch.broadlink to learn packet from HA.

You mean once I’ve the RM Pro, right?

Yes ^^ once you have rm pro

Sure, already tested that procedure learning with the RM mini :slight_smile:

Cheers