RFLink send alloff command workin but no change of state

Hi

Does anyone know what iam missing here ?

If i press the remote button ALLOFF command Hassio recognize the command and power of my lights and set the state to OFF.

If i send the same command within Hassio the lights go off but the state stays ON ?

I might missing a command in service data that change te state of my lights at the moment I have no idea how to pass the event to intended lights.

Script

Log when pressed remote button

2019-06-08 16:13:32 DEBUG (MainThread) [rflink.protocol] got packet: 20;B3;NewKaku;ID=0173bb52;SWITCH=0;CMD=ALLOFF;
2019-06-08 16:13:32 DEBUG (MainThread) [rflink.protocol] decoded packet: {‘node’: ‘gateway’, ‘protocol’: ‘newkaku’, ‘id’: ‘0173bb52’, ‘switch’: ‘0’, ‘command’: ‘alloff’}
2019-06-08 16:13:32 DEBUG (MainThread) [rflink.protocol] got event: {‘id’: ‘newkaku_0173bb52_0’, ‘command’: ‘alloff’}
2019-06-08 16:13:32 DEBUG (MainThread) [homeassistant.components.rflink] event of type command: {‘id’: ‘newkaku_0173bb52_0’, ‘command’: ‘alloff’}
2019-06-08 16:13:32 DEBUG (MainThread) [homeassistant.components.rflink] entity_ids: [‘light.fontijn’, ‘light.bank’, ‘light.dressoir’, ‘light.keuken’, ‘light.tv’, ‘light.eet_tafel’, ‘light.tuin’, ‘light.cmd_on_off’]
2019-06-08 16:13:32 DEBUG (MainThread) [homeassistant.components.rflink] passing event to light.fontijn
2019-06-08 16:13:32 DEBUG (MainThread) [homeassistant.components.rflink] passing event to light.bank
2019-06-08 16:13:32 DEBUG (MainThread) [homeassistant.components.rflink] passing event to light.dressoir
2019-06-08 16:13:32 DEBUG (MainThread) [homeassistant.components.rflink] passing event to light.keuken
2019-06-08 16:13:32 DEBUG (MainThread) [homeassistant.components.rflink] passing event to light.tv
2019-06-08 16:13:32 DEBUG (MainThread) [homeassistant.components.rflink] passing event to light.eet_tafel
2019-06-08 16:13:32 DEBUG (MainThread) [homeassistant.components.rflink] passing event to light.tuin
2019-06-08 16:13:32 DEBUG (MainThread) [homeassistant.components.rflink] passing event to light.cmd_on_off

Log when send command true Hassio

2019-06-08 16:20:45 DEBUG (MainThread) [homeassistant.components.rflink] Rflink command for {‘command’: ‘ALLOFF’, ‘device_id’: ‘newkaku_0173bb52_0’}
2019-06-08 16:20:45 DEBUG (MainThread) [rflink.protocol] sending command: {‘protocol’: ‘newkaku’, ‘id’: ‘0173bb52’, ‘switch’: ‘0’, ‘command’: ‘ALLOFF’}
2019-06-08 16:20:45 DEBUG (MainThread) [rflink.protocol] writing data: ‘10;newkaku;0173bb52;0;ALLOFF;\r\n’
2019-06-08 16:20:45 DEBUG (MainThread) [rflink.protocol] waiting for acknowledgement
2019-06-08 16:20:46 DEBUG (MainThread) [rflink.protocol] received data: 20;C2;OK;
2019-06-08 16:20:46 DEBUG (MainThread) [rflink.protocol] got packet: 20;C2;OK;
2019-06-08 16:20:46 DEBUG (MainThread) [rflink.protocol] decoded packet: {‘node’: ‘gateway’, ‘protocol’: ‘unknown’, ‘ok’: True}
2019-06-08 16:20:46 DEBUG (MainThread) [rflink.protocol] command response: {‘node’: ‘gateway’, ‘protocol’: ‘unknown’, ‘ok’: True}
2019-06-08 16:20:46 DEBUG (MainThread) [rflink.protocol] packet acknowledged

When you say:

I suppose you mean to send the command with the service, is that correct?

I think (and this is just a guess) that the service does not alter the states. Why? Because it’s the state changes that trigger the services.

I believe that, if you add a button in HA you will see what you expect, but because when you change the button state service will be triggered.

Hi Javicalle,

Thanks for your reply really apprenticed that :innocent:

Indeed I request to send a RF-link “alloff” command using the service ,
I actually hoped there might be a way to change the state with the same service.

I’am not sure if you mean this :
The button that triggers my script already exist I use the script to shutdown my entire living room including all lights, television, thermostat and awning.
All i want is trying to shutdown all the lights at once instead one by one.
image

I tried to add the light as a device but this isn’t going to work because iam not able to add the “command”: “alloff”
image

Greetss Maurice

I see your point. I had misunderstood you.
You are right that it is not possible to send the an allon/alloff command with a light or switch entity.

Let’s see the full picture. Correct me if I’m wrong.

You have several RF devices, one remote and the Home Assistant :wink:.
And (this is important) all your RF devices are paired with the remote.

Now, we have 2 scenarios:

  1. if the remote alloff button is pressed, all devices power off AND Home Assistant detects the command. Because it is a group command (ALLOFF), HA sends the command to all the light devices. Even though the devices are already off, this command changes their status in HA.

  2. when you send the command with the rflink.send_command service, HA just send the command (no states changes). And all your devices switch off because you are using the same device ID they are paired with. In this case HA don’t know which devices will switch off

Ok, this is fine, but what can I do (you might be wondering). :thinking: I’m not sure :sweat:

You could try to make a switch with the group.all_lights group (nor related with the remote device ID). I think that this may work. But in this case HA will trigger the switch_off service for all the devices and I think that you will see the devices power off one behind the other (and not all at the same time)

Also you could try to create an alias (with the remote device ID) for all your devices. Maybe this also triggers the state change for all of them.

I’m sorry, I think there’s no clean solution for your problem.

Hi Javicalle,

If i use “group.all_lights” to shutdown all my entities, as you mention it will result like before they wil turn off one by one instead turn off all at once.

I have the alias configured already that is only working for my remote

If I send the command using the service the service doesn’t change te state of my entity
when send the command “alloff” the difference between my logs from my remote and service call there is no passing event when using service call.

I assume the problems could be

  • Missing crucial data in the section “service data” (example “pass_event”:“light.test” )
  • Otherwise it could be a flaw in Hassio

For now I have buyed some zigbee lights to satisfy my needs :stuck_out_tongue:
If I found a way about the alloff/allon command I will post it inhere.

for nerds :nerd_face: : Using RFlink from nodoshop update R48