Roller Shutter 433mhz - Status Reflection

Hey Community,

I got a tubular motor and installed the hardware today to control my roller shutters (see pics below). The remote has three buttons (up, stop, down - see pic below) and all the RF codes can be learned through Broadlink RM Pro (which I have).

Is there a way to get the position status of my roller shutters?

I was thinking to get a RF receiver and connect to Raspberry Pi, where my HA is installed but I am not sure if I would be able to know the position of the roller shutters even then?

I would really appreciate your feedback.

If it’s RF you don’t get any feedback so it’s not possible to know what the position is except at either end. You could use time to semi-determine the position but it wouldn’t be very accurate. You could maybe fit a hall effect transistor and a magnet to get position data but it would probably be quite difficult. You really need a stepper motor to do precise positioning.

Hi , this is similar to your system but its for an older version of Home Assistant
https://rollertrol.com/raspberry-pi-smart-home-with-home-assistant-and-broadlink-part3
i have modified-t to pass config check but did not tested on actual rollers
it works as apackage
homeassistant:
customize:
switch.open_blackout_blinds:
friendly_name: Redony Nyit
icon: mdi:window-open
assumed_state: true
switch.close_blackout_blinds:
friendly_name: Redony Zar
icon: mdi:window-closed
assumed_state: true
switch.stop_blackout_blinds:
friendly_name: Redony Stop
icon: mdi:window-minimize
assumed_state: true

input_number:
theater_blackout_blinds:
name: ‘Theater Blackout Blinds’
icon: mdi:window-closed
min: 0
max: 100
step: 25
initial: 0

switch:

  • platform: broadlink
    host: 192.168.0.100
    mac: ‘B4:43:0D:38:87:B6’
    timeout: 15
    switches:
    open_blackout_blinds:
    friendly_name: “Open Blackout Blinds”
    command_off: ‘JgAoAAABJ5ISRxJIEkcSSBJHEkgSRxJIEkcSSBJHEkcTRxJHEkgSRxIADQU=’
    command_on: ‘JgAoAAABJ5ISRxJIEkcSSBJHEkgSRxJIEkcSSBJHEkcTRxJHEkgSRxIADQU=’
    close_blackout_blinds:
    friendly_name: “Close Blackout Blinds”
    command_off: ‘JgAoAAABJ5ISRxJIEkcSSBJHEkgSRxJIEkcSSBJHEkcTRxJHEkgSRxIADQU=’
    command_on: ‘JgAoAAABJ5ISRxJIEkcSSBJHEkgSRxJIEkcSSBJHEkcTRxJHEkgSRxIADQU=’
    stop_blackout_blinds:
    friendly_name: “Stop Blackout Blinds”
    command_off: ‘JgAoAAABJ5ISRxJIEkcSSBJHEkgSRxJIEkcSSBJHEkcTRxJHEkgSRxIADQU=’
    command_on: ‘JgAoAAABJ5ISRxJIEkcSSBJHEkgSRxJIEkcSSBJHEkcTRxJHEkgSRxIADQU=’

sensor:

  • platform: mqtt
    name: “Slider Started”
    state_topic: “setStart/#”

  • platform: mqtt
    name: “Slider Stopped”
    state_topic: “setStop/#”

  • platform: mqtt
    name: “Percent Travel”
    state_topic: “setPctTravel/#”

  • platform: mqtt
    name: “Direction Travel”
    state_topic: “setDirection/#”

  • platform: mqtt
    name: “Travel Timing”
    state_topic: “setTravelTime/#”

  • platform: mqtt
    name: “Control STATUS”
    state_topic: “setStatus/#”

END SENSOR READINGS

automation:

AUTOMATION TRIGGERED BY HASS RESTART

  • alias: ‘HASS Startup Automation’
    hide_entity: true
    trigger:
    platform: event
    event_type: homeassistant_start

    action:

    SET SENSOR TEXT TO PREVENT SLIDER EVENT

    FIRING AT STARTUP [see conditions]

    • service: mqtt.publish
      data:
      topic: “setStatus”
      retain: true
      payload: ‘Start’

    RESTORE SLIDER TO CURRENT POSITION AT STARTUP

    • service: input_number.set_value
      data_template:
      entity_id: input_number.theater_blackout_blinds
      value: ‘{{states(“sensor.slider_stopped”)|round(0)}}’

    SET SENSOR TEXT TO ALLOW SLIDER EVENT TRIGGER

    • service: mqtt.publish
      data:
      topic: “setStatus”
      retain: true
      payload: ‘DONE’

AUTOMATION TRIGGERED BY SLIDER CHANGE

  • alias: ‘Theater Blackout Blind Slider Automation’
    hide_entity: True
    trigger:
    platform: state
    entity_id: input_number.theater_blackout_blinds

    THESE CONDITIONS MUST ALL BE MET FOR TRIGGER TO WORK

    condition:
    condition: and
    conditions:
    - condition: state
    entity_id: ‘script.slider_moved_open’
    state: ‘off’
    - condition: state
    entity_id: ‘script.slider_moved_close’
    state: ‘off’
    - condition: template
    value_template: ‘{{ states(“sensor.control_status”) == “DONE” }}’

    action:
    service: script.turn_on

    data_template:

    #### SCRIPT DIRECTION DECISION re OPEN or CLOSE ####
    
    entity_id: >
      {% if (trigger.to_state.state | int - trigger.from_state.state | int < 0) %}
        script.slider_moved_close
      {% else %}
        script.slider_moved_open
      {% endif %}
    
    #### VARIABLE VALUES PASSED TO SCRIPTS ####
     
    variables:
      set_start: '{{ trigger.from_state.state | int }}'
      set_stop: '{{ trigger.to_state.state | int }}'
      full_excursion: '30' #seconds
    
      travel_pct: >
        {% if (trigger.to_state.state | int - trigger.from_state.state | int < 0) %}
          {{ trigger.from_state.state | int - trigger.to_state.state | int }}
        {% else %}
          {{ trigger.to_state.state | int - trigger.from_state.state | int }}
        {% endif %}
    
      direction_travel: >
        {% if (trigger.to_state.state | int - trigger.from_state.state | int < 0) %}
          CLOSE
        {% else %}
          OPEN
        {% endif %}
    
      travel_time: >
        {% if (trigger.to_state.state | int - trigger.from_state.state | int < 0) %}
          {{ (( trigger.from_state.state | int - trigger.to_state.state | int)/100*30) | round(0) }}
        {% else %}
          {{ ((trigger.to_state.state | int - trigger.from_state.state | int)/100*30) | round(0) }}
        {% endif %}
    

script:
slider_moved_open:
sequence:

  #### YOU CAN DYNAMICALLY CONTROL THE VISIBILITY OF GROUPS [not used here]

  #- service: group.set_visibility
    #data: 
      #entity_id: group.theater_blackout_blinds
      #visible: true

  #### UPDATE SENSOR DISPLAY

  - service: mqtt.publish
    data_template:
      topic: "setStatus"
      retain: true
      payload: 'Moving'

  - service: mqtt.publish
    data_template:
      topic: "setStart"
      retain: true
      payload: '{{ set_start }}'

  - service: mqtt.publish
    data_template:
      topic: "setStop"
      retain: true
      payload: '{{ set_stop }}'

  - service: mqtt.publish
    data_template:
      topic: "setPctTravel"
      retain: true
      payload: '{{ travel_pct }}'

  - service: mqtt.publish
    data_template:
      topic: "setDirection"
      retain: true
      payload: '{{ direction_travel }}'

  - service: mqtt.publish
    data_template:
      topic: "setTravelTime"
      retain: true
      payload: '{{ travel_time }}'

  - delay: 00:00:04

  - service: switch.turn_on
    entity_id: switch.open_blackout_blinds

  - delay: 00:00:0{{ travel_time }}

  #- delay: 00:00:04

  - service: switch.turn_off
    entity_id: switch.open_blackout_blinds

  - service: input_number.set_value
    data_template:
      entity_id: input_number.theater_blackout_blinds
      value: '{{ set_stop }}'

  - service: mqtt.publish
    data_template:
      topic: "setStatus"
      retain: true
      payload: 'DONE'

  - delay: 00:00:02

slider_moved_close:
sequence:

  - service: mqtt.publish
    data_template:
      topic: "setStatus"
      retain: true
      payload: 'Moving'

  - service: mqtt.publish
    data_template:
      topic: "setStart"
      retain: true
      payload: '{{ set_start }}'

  - service: mqtt.publish
    data_template:
      topic: "setStop"
      retain: true
      payload: '{{ set_stop }}'

  - service: mqtt.publish
    data_template:
      topic: "setPctTravel"
      retain: true
      payload: '{{ travel_pct }}'

  - service: mqtt.publish
    data_template:
      topic: "setDirection"
      retain: true
      payload: '{{ direction_travel }}'

  - service: mqtt.publish
    data_template:
      topic: "setTravelTime"
      retain: true
      payload: '{{ travel_time }}'

  - delay: 00:00:04
  
  #- delay: '00:00:0{{ ((trigger.to_state.state | int - trigger.from_state.state | int)/25) | round(0) }}'

  - service: switch.turn_on
    entity_id: switch.close_blackout_blinds

  - delay: 00:00:0{{ travel_time }}

  #- delay: 00:00:04

  - service: switch.turn_off
    entity_id: switch.close_blackout_blinds

  - service: input_number.set_value
    data_template:
      entity_id: input_number.theater_blackout_blinds
      value: '{{ set_stop }}'

  - service: mqtt.publish
    data_template:
      topic: "setStatus"
      retain: true
      payload: 'DONE'

  - delay: 00:00:02
1 Like