Automation is triggered but is not switching

Hi everyone,
Recently I’ve moved from Domoticz (on Raspberry Pi) to Home Assistant on NUC and so I’m a beginner with HA.
I’m running HA 0.114.4 in a docker container on Ubuntu 20.04

I’ve got an issue with opening and closing my shutters through an automation.
The automation is triggered and the switch looks triggered, but the shutters aren’t moving.
I can’t figure out what’s wrong. Any ideas are welcome.
Configuration:

rflink:
  port: /dev/ttyACM1
  wait_for_ack: false
  ignore_devices:
    - renkforcee_*
light:
  - platform: rflink
    automatic_add: false
    devices:
      newkaku_01479400_2:
        name: Vijververlichting
      newkaku_01479400_3:
        name: Zwembadpomp
      kaku_000042_1:
        name: Huiskamer achter
      kaku_000042_2:
        name: Huiskamer TV kast
      kaku_000042_3:
        name: Huiskamer kast

switch:
  - platform: rflink
    automatic_add: false
    devices:
      brelmotor_f0e056_50:
        name: Rolluiken voor
      brelmotor_f0e056_51:
        name: Rolluik keuken links
      brelmotor_f0e056_52:
        name: Rolluik keuken rechts
      brelmotor_f0e056_53:
        name: Rolluik bijkeuken

Automation:

- id: '1595691347292'
  alias: Rolluiken dicht obv zon
  description: Sluit de rolluiken als de zon onder gaat
  initial_state: true
  trigger:
  - event: sunset
    offset: 00:10
    platform: sun
  condition: []
  action:
  - data: {}
    entity_id: switch.rolluiken_voor
    service: switch.turn_on
  mode: single
- id: '1595691653564'
  alias: Rolluiken open in het weekend
  description: Doe de rolluiken open op tijd in het weekend
  initial_state: true
  trigger:
  - at: 09:00
    platform: time
  condition:
    condition: time
    weekday:
    - sat
    - sun
  action:
  - data: {}
    entity_id: switch.rolluiken_voor
    service: switch.turn_off
  mode: single
- id: '1595691653565'
  alias: Rolluiken open door de week
  description: Doe de rolluiken open op tijd door de week
  trigger:
  - at: 07:40
    platform: time
  condition:
    condition: time
    weekday:
    - mon
    - tue
    - wed
    - thu
    - fri
  action:
  - data: {}
    entity_id: switch.rolluiken_voor
    service: switch.turn_off
  initial_state: true
  mode: single

And in the logging in LoveLace shows:
image

but the shutters aren’t being shut.
Shutting by manual switching does work.

So I’m a little surprised the automation doesn’t work. Any ideas??

Hi Toolman, I’m not very experienced but will give it a try.
What do you mean by ‘shutting by manual switching’?

If you do a test by adding a button like this:

type: button
tap_action:
  action: toggle
hold_action:
  action: more-info
show_icon: true
show_name: true
show_state: false
entity: switch.rolluiken_voor

does that work?

(btw: did you reload at least the automations?)

Hi Nick, Thanks for thinking with me.
With manual switching I mean manually triggering the switch.
image
The button you suggested does work.as well.
(and of course I reloaded the automations :slight_smile: )

I’ve enabled the rflink logging

logger:
  default: error
  logs:
    rflink: debug
    homeassistant.components.rflink: debug

and I see the following

When I use the original remote control for the shutter it gives me a logging of ‘up’ and ‘down’ (and not ‘off’ and ‘on’) like this:

2020-09-05 06:28:49 DEBUG (MainThread) [rflink.protocol] received data: 20;29;BrelMot
2020-09-05 06:28:49 DEBUG (MainThread) [rflink.protocol] received data: or;ID=f0e056;SWITCH=50;C
2020-09-05 06:28:49 DEBUG (MainThread) [rflink.protocol] received data: MD=UP;
2020-09-05 06:28:49 DEBUG (MainThread) [rflink.protocol] got packet: 20;29;BrelMotor;ID=f0e056;SWITCH=50;CMD=UP;
2020-09-05 06:28:49 DEBUG (MainThread) [rflink.protocol] decoded packet: {'node': 'gateway', 'protocol': 'brelmotor', 'id': 'f0e056', 'switch': '50', 'command': 'up'}
2020-09-05 06:28:49 DEBUG (MainThread) [rflink.protocol] got event: {'id': 'brelmotor_f0e056_50', 'command': 'up'}
2020-09-05 06:28:49 DEBUG (MainThread) [homeassistant.components.rflink] event of type command: {'id': 'brelmotor_f0e056_50', 'command': 'up'}
2020-09-05 06:28:49 DEBUG (MainThread) [homeassistant.components.rflink] entity_ids: ['switch.rolluiken_voor']
2020-09-05 06:28:49 DEBUG (MainThread) [homeassistant.components.rflink] passing event to switch.rolluiken_voor

When I use the switch in the front-end (see picture above) I see the following in the logging:

2020-09-05 07:42:31 DEBUG (MainThread) [homeassistant.components.rflink] Sending command: off to Rflink device: brelmotor_f0e056_50
2020-09-05 07:42:31 DEBUG (MainThread) [rflink.protocol] sending command: {'protocol': 'brelmotor', 'id': 'f0e056', 'switch': '50', 'command': 'off'}
2020-09-05 07:42:31 DEBUG (MainThread) [rflink.protocol] writing data: '10;brelmotor;f0e056;50;off;\r\n'
2020-09-05 07:42:32 DEBUG (MainThread) [rflink.protocol] received data: 20;
2020-09-05 07:42:32 DEBUG (MainThread) [rflink.protocol] received data: 6A;OK;
2020-09-05 07:42:32 DEBUG (MainThread) [rflink.protocol] got packet: 20;6A;OK;
2020-09-05 07:42:32 DEBUG (MainThread) [rflink.protocol] decoded packet: {'node': 'gateway', 'protocol': 'unknown', 'ok': True}
2020-09-05 07:42:32 DEBUG (MainThread) [rflink.protocol] command response: {'node': 'gateway', 'protocol': 'unknown', 'ok': True}

Both work OK.

The automation sends the following command:

2020-09-05 07:00:00 DEBUG (MainThread) [homeassistant.components.rflink] Sending command: off to Rflink device: brelmotor_f0e056_50
2020-09-05 07:00:00 DEBUG (MainThread) [rflink.protocol] sending command: {'protocol': 'brelmotor', 'id': 'f0e056', 'switch': '50', 'command': 'off'}
2020-09-05 07:00:00 DEBUG (MainThread) [rflink.protocol] writing data: '10;brelmotor;f0e056;50;off;\r\n'
2020-09-05 07:00:01 DEBUG (MainThread) [rflink.protocol] received data: 20;42;OK;
2020-09-05 07:00:01 DEBUG (MainThread) [rflink.protocol] got packet: 20;42;OK;
2020-09-05 07:00:01 DEBUG (MainThread) [rflink.protocol] decoded packet: {'node': 'gateway', 'protocol': 'unknown', 'ok': True}
2020-09-05 07:00:01 DEBUG (MainThread) [rflink.protocol] command response: {'node': 'gateway', 'protocol': 'unknown', 'ok': True}

and doesn’t work :frowning:

When I trigger the automation by hand


the shutters open and close as they should.

2020-09-05 08:44:31 DEBUG (MainThread) [homeassistant.components.rflink] Sending command: on to Rflink device: brelmotor_f0e056_50
2020-09-05 08:44:31 DEBUG (MainThread) [rflink.protocol] sending command: {'protocol': 'brelmotor', 'id': 'f0e056', 'switch': '50', 'command': 'on'}
2020-09-05 08:44:31 DEBUG (MainThread) [rflink.protocol] writing data: '10;brelmotor;f0e056;50;on;\r\n'
2020-09-05 08:44:32 DEBUG (MainThread) [rflink.protocol] received data: 20;A3;OK
2020-09-05 08:44:32 DEBUG (MainThread) [rflink.protocol] received data: ;
2020-09-05 08:44:32 DEBUG (MainThread) [rflink.protocol] got packet: 20;A3;OK;
2020-09-05 08:44:32 DEBUG (MainThread) [rflink.protocol] decoded packet: {'node': 'gateway', 'protocol': 'unknown', 'ok': True}
2020-09-05 08:44:32 DEBUG (MainThread) [rflink.protocol] command response: {'node': 'gateway', 'protocol': 'unknown', 'ok': True}
2020-09-05 08:45:02 DEBUG (MainThread) [homeassistant.components.rflink] Sending command: off to Rflink device: brelmotor_f0e056_50
2020-09-05 08:45:02 DEBUG (MainThread) [rflink.protocol] sending command: {'protocol': 'brelmotor', 'id': 'f0e056', 'switch': '50', 'command': 'off'}
2020-09-05 08:45:02 DEBUG (MainThread) [rflink.protocol] writing data: '10;brelmotor;f0e056;50;off;\r\n'
2020-09-05 08:45:03 DEBUG (MainThread) [rflink.protocol] received data: 20;A4;OK;
2020-09-05 08:45:03 DEBUG (MainThread) [rflink.protocol] got packet: 20;A4;OK;
2020-09-05 08:45:03 DEBUG (MainThread) [rflink.protocol] decoded packet: {'node': 'gateway', 'protocol': 'unknown', 'ok': True}
2020-09-05 08:45:03 DEBUG (MainThread) [rflink.protocol] command response: {'node': 'gateway', 'protocol': 'unknown', 'ok': True}

So I really don’t know why they aren’t opening/closing when they are triggered through the automation trigger.

Another weird thing I see is:
When I Reload the automations, the logging in Lovelace say the automations are turned off.
image
But when I look at the automation screen they are ‘on’
image

If there is a mismatch between the switch and the actual command needed, try to manually send the command.

- id: '1595691347292'
  alias: Rolluiken dicht obv zon
  description: Sluit de rolluiken als de zon onder gaat
  initial_state: true
  trigger:
  - event: sunset
    offset: 00:10
    platform: sun
  condition: []
  action:
  - data: 
      device_id: brelmotor_f0e056_50
      command: 'up'
    service: rflink.send_command
  mode: single


1 Like

@francisp Thanks for that Francis. I’ve done a small test with the trigger on time and it’s working!!
I will integrate it with the automation with the sunset trigger. I’ll keep you posted.
Many thanks.

The solution of @francisp works like a charm. The only downside is that the switches in the front-end aren’t updated. But I think I’ll trigger that with the

  service: switch.turn_on

command so everything will be in sync

Thanks for posting the solution! Out of interest, what Brel motor are you using? I’m looking for a stepper motor to retrofit in my venetian blinds.

I’m using the Brel MEV35-10