jheling / freeathome

Free@Home component for Home Assistant
103 stars 37 forks source link

Cant use wall-buttons to start automation #123

Open hnktnk opened 2 years ago

hnktnk commented 2 years ago

Hi!

I'm trying to use a wallswitch in my f@h setup to activate an automation. This button is a sceneactivator i f@h which I think works different than if its just a "button". I might be wrong but to eliminate this thought, I'm trying another switch in my house.

I have recorded the service in HA which gave me thix XML-line: <?xml version="1.0" encoding="UTF-8"?><project timeStamp="273367" sessionId="4b171115" type="update" mrhaVersion="2.6.4" mrhaBuild="8172"><privileges/><devices><device serialNumber="ABB700CE5B0F" domainAddress="5036" state="modified" commissioningState="ready" progress="100"><channels><channel state="modified" i="ch0002" cid="ABB70068"><inputs/><outputs><dataPoint state="modified" i="odp0000" full="false"><value>0</value></dataPoint></outputs><parameters/><scenes/></channel></channels><parameters/></device></devices></project>

From this I set my automation trigger event to:

  trigger:
  - platform: event
    event_type: freeathome_event
    event_data:
      unique_id: ABB700CE5B0F/ch0002
      command: pressed
      state: true

Then I added a simple action, to turn off a light in a room via HA. Now, saving this automation and pressing the wallswitch does nothing. Running the automation works fine, it turns the light off so something is off getting the switch-event? Complete automation code:

- id: '1642939951688'
  alias: Byebye
  description: ''
  trigger:
  - platform: event
    event_type: freeathome_event
    event_data:
      unique_id: ABB700CE5B0F/ch0002
      command: pressed
      state: true
  condition: []
  action:
  - service: media_player.turn_off
    target:
      device_id:
      - c7def65aeac448a8a6902e2dd753f8ca
      - 5b81054caa2073aa20c977564318e2ea
  - service: light.turn_off
    target:
      entity_id: light.takbel_kontor
  mode: single

I'll fix a dump a little bit later.

EnricoBilla commented 2 years ago

Hi, just to make sure it's a problem in the integration, can you please go in Developer Tools, start listening for freeathome_event and then press the button? See if anything appears and try other switches too if you can.

Maybe with the dump we can figure out something more

hnktnk commented 2 years ago

Yes, this is one of the lines that gets outputted when I press the switch I want to trigger the event: <?xml version="1.0" encoding="UTF-8"?><project timeStamp="273367" sessionId="4b171115" type="update" mrhaVersion="2.6.4" mrhaBuild="8172"><privileges/><devices><device serialNumber="ABB700CE5B0F" domainAddress="5036" state="modified" commissioningState="ready" progress="100"><channels><channel state="modified" i="ch0002" cid="ABB70068"><inputs/><outputs><dataPoint state="modified" i="odp0000" full="false"><value>0</value></dataPoint></outputs><parameters/><scenes/></channel></channels><parameters/></device></devices></project>

EnricoBilla commented 2 years ago

I understand that, I'm just wondering if that is a problem of the automation trigger or an issue in the integration itself. Please post a complete dump and try listening for the freeathome_event in Developer Tools > Events, so that we can have a clue of what's happening. Thanks

s14r commented 1 year ago

Hey @EnricoBilla,

I am also experiencing issues with getting freeathome_event events in an reliable way. Here are a few investigations with different sensors/actuators on SysAp v3.1.0.

Single Wall Switch Sensor

Configured as Rocker

Configured as individual Buttons

No events received...

Double Wall Switch Sensor

Rocker or Button configuration doesn't matter but just the left handed rocker works as expected. Same behavior as for the single switch, if a scene link comes into play, no events are triggered.

I did test with different Sensor/Actuator combinations as well as just Sensor wall switches. All devices updated to the latest firmware, SysAP running on 3.1.0.

Hope this helps to debug. By the way, I have a quite big system (100+ wireless / 12 wired devices / 3 Panels, almost all types of devices. So if you need someone to test something I'm happy to help.

Have a good one and keep up the great work.

hnktnk commented 1 year ago

Actually, my problem is solved. I haven't touched this since february and today I tried push the button i assigned in my home and the service fired my HA automation.

I need to check if a button assigned to a scene in f@h works aswell.

EnricoBilla commented 1 year ago

@s14r I'm in your exact situation. I have some devices that will trigger an event and others that won't. Sadly for my devices the event is not even triggered by the SysAp so there's no way to catch that...

I really don't know what the issue can be, you could try monitoring the messages sent by the SysAp while you press the button and see if something appears. Note that with such a big system will be difficult because you'll have a lot of messages coming in from different devices

churitos commented 8 months ago

Hello, Have you been able to solve the issue? I try to make an automation, but no luck so far.

Thank!

hnktnk commented 2 months ago

No, I have not had the time to test this further.