I noticed that since updating my Sonoff RF Bridge to late 9.x tasomta firmware versions, my covers miss a lot more times the codes transmitted. This happens when multiple covers are opened at once or quickly one after another.
I tried by sending repeats etc. but I only found improvement if I took out the rfraw 0 from the payload, including the backlogs.
Instead, I only send a single rfraw 0 after I assume cover operations stopped (in my case 40 seconds is enough. I modified the scripts by employing a separate transmitter script which takes care of queuing the transmission of the codes and keeping an appropriate delay between them, and a small automation to check when was that send last time. Documentation updated at:
The Documentation describes the set_known_action as following: āThis service mimics cover movement in Home Assistant without actually sending out commands to the cover.ā
If i activate the set known action automation the cover movement over the external switches is mimiced correctly.
But if i try to use the UI-Slider of HA to set a desired position, the cover only opens or closes completely. Any Idea how i can fix that? Iām almost 1 week investigating now Without the set known action service everything works.
Here is what i see in the log file after setting the position from 47 to 57. The cover stops at 100.
2021-03-30 23:37:14 DEBUG (MainThread) [custom_components.cover_rf_time_based.cover] My Room Cover: async_set_cover_position: 57
2021-03-30 23:37:14 DEBUG (MainThread) [custom_components.cover_rf_time_based.cover] My Room Cover: set_position
2021-03-30 23:37:14 DEBUG (MainThread) [custom_components.cover_rf_time_based.cover] My Room Cover: set_position :: current_position: 47, new_position: 57
2021-03-30 23:37:14 DEBUG (MainThread) [custom_components.cover_rf_time_based.cover] My Room Cover: start_auto_updater
2021-03-30 23:37:14 DEBUG (MainThread) [custom_components.cover_rf_time_based.cover] My Room Cover: init _unsubscribe_auto_updater
2021-03-30 23:37:14 DEBUG (MainThread) [custom_components.cover_rf_time_based.cover] My Room Cover: set_position :: command open_cover
2021-03-30 23:37:14 DEBUG (MainThread) [custom_components.cover_rf_time_based.cover] My Room Cover: _async_handle_command :: UP
2021-03-30 23:37:14 DEBUG (MainThread) [custom_components.cover_rf_time_based.cover] My Room Cover: auto_updater_hook
2021-03-30 23:37:14 INFO (MainThread) [homeassistant.components.automation.cover_set_open_action_from_ha_2] Open Action Test Cover: Running automation actions
2021-03-30 23:37:14 INFO (MainThread) [homeassistant.components.automation.cover_set_open_action_from_ha_2] Open Action Test Cover: Executing step call service
2021-03-30 23:37:14 DEBUG (MainThread) [custom_components.cover_rf_time_based.cover] My Room Cover: start_auto_updater
...
2021-03-30 23:37:25 DEBUG (MainThread) [custom_components.cover_rf_time_based.cover] My Room Cover: auto_updater_hook :: position_reached
2021-03-30 23:37:25 DEBUG (MainThread) [custom_components.cover_rf_time_based.cover] My Room Cover: stop_auto_updater
In Case someone has the same issue:
I fixed it by defining an input_boolean which listens to the set_position event. If that occurs the set_known_actionās are ignored.
#Toggles
- id: Test Toggle On
alias: toggleautomation_on
trigger:
- platform: event
event_type: call_service
event_data:
domain: cover
service: set_cover_position
service_data:
entity_id: cover.my_room_cover
action:
- service: input_boolean.turn_on
entity_id: input_boolean.testtoggle
- id: Test Toggle Off
alias: toggleautomation_off
trigger:
- platform: state
entity_id: switch.pause_8
to: 'on'
action:
- service: homeassistant.turn_off
entity_id: input_boolean.testtoggle
#Cover known action
- id: Cover stopped external
alias: Stop Action Test Cover
trigger:
- platform: state
entity_id: switch.pause_8
to: 'on'
action:
- service: cover_rf_time_based.set_known_action
data:
entity_id: cover.my_room_cover
action: stop
- id: Cover up
alias: testup
description: ''
trigger:
- platform: state
entity_id: switch.up_8
to: 'on'
condition:
- condition: state
entity_id: input_boolean.testtoggle
state: 'off'
action:
- service: cover_rf_time_based.set_known_action
data:
entity_id: cover.my_room_cover
action: open
- id: Cover Down
alias: testdown
description: ''
trigger:
- platform: state
entity_id: switch.down_8
to: 'on'
condition:
- condition: state
entity_id: input_boolean.testtoggle
state: 'off'
action:
- service: cover_rf_time_based.set_known_action
data:
entity_id: cover.my_room_cover
action: close
Would it be possible to call the open/close/stop scripts with arguments / variables ? It would be great because it will allow us to write only one script for all covers. When you have a lot of covers it is very tedious and adds a lot of noise in HA to add as many scripts as covers.
Problem is that various cover types need various parameter/argument numbers and types, itās near impossible to make one universal function to fit everybodyās needs.
This has been discussed many times, you have to do the hard work only once.
A little trickery with copy+paste and then replace can speed up the work in a text editor like Notepad++.
To eliminate noise, use split config and keep scripts in a separate file.
When using something like āBroadlink RM4 Proā as a RF bridge - is it still possible to calculate the position when activating blinds/shutters etc. using the original RF remote control.
Or should I steer clear of using the RF remote as it would mess up the position ?
I guess it would be nice to have a setup where you are still able to control your blinds with the RF remote even with home assistant down.
Using the RF remote would make home assistant unaware of the user activating it unless the RF bridge is able to pick this up then relay this info as events which in turn are picked up by this custom control which would make it possible to calculate a position based on this.
Then in a hidden folder in your config folder called .storage you should have a file with a similar name to this. This file and the content are auto created by the broadlink integration when you use the learn service: