Myfox Alarm

Same story. It’s for legacy MyFox devices whose API is under https://api.myfox.me/ .

Im actually gonna leave myfox cause since it became Somfy i just been haveing truble.
It false alarm from time to time, devices looses connection and so on.

So im gonna try to build an alarm with HA insted.
Only problem is the privacy thing that i like about myfox

Hello,

WhistleMaster I would like to do the same as you, can you help me with the configuration?

What or how did you configure IFTTT?
What setup do I need there?

Hi Whistle,

Thanks for the guidance, everything works perfectly. However it only gives me the alarm status. Have you figured out how to include arming and disarming commands? The IFTTT Alarm Panel only allows me to disarm it.

Cheers.

New setup:

Go to Configuration->Integration->IFTTT and click on Configure to set up a new webhook. (to receive the alarm status)

In your automation file, use the following:

</s> <s>- alias: Webhook received</s> <s> initial_state: 'on'</s> <s> trigger:</s> <s> - platform: event</s> <s> event_type: ifttt_webhook_received</s> <s> event_data:</s> <s> action: call_service</s> <s> action:</s> <s> service_template: '{{ trigger.event.data.service }}'</s> <s> data_template:</s> <s> entity_id: '{{ trigger.event.data.entity_id }}'</s> <s> state: '{{ trigger.event.data.state}}'</s> <s>

Setup the IFTTT Control Panel:

</s> <s>alarm_control_panel:</s> <s> - platform: ifttt</s> <s> name: Somfy</s> <s>

On IFTTT web site, you have to configure the Somfy Protect and Webhooks services.

Setup the Webhooks (to send the alarm status):

</s> <s>ifttt:</s> <s> key: <YOUR KEY></s> <s>

On IFTTT web site, create 6 applets, 3 for each service.

For the orange applets, use the URL you got from the Integration and use POST method and application/json for the content type and the following for the body:

Armed away
{"action": "call_service", "service": "ifttt.push_alarm_state", "entity_id": "alarm_control_panel.somfy", "state":"armed_away"}

Disarmed
{"action": "call_service", "service": "ifttt.push_alarm_state", "entity_id": "alarm_control_panel.somfy", "state":"disarmed"}

Armed Night
{"action": "call_service", "service": "ifttt.push_alarm_state", "entity_id": "alarm_control_panel.somfy", "state":"armed_night"}

For the blue applets, use the following event names:
</s> <s>alarm_disarm</s> <s>alarm_arm_away</s> <s>alarm_arm_night</s> <s>

Use: GitHub - Minims/SomfyProtect2MQTT: Somfy Protect to MQTT

4 Likes

Thanks for the very thorough reply! The maintainer of the IFTTT alarm should update their page with your updated code.
Now I “only” need to understand why the alarm state is set on unknown. If I force its state to disarmed everything is fine and the 3 buttons appear but after a few minutes it revert to unknown. If you have any idea, I wouldn’t mind hearing them.

Thanks again.

It’s kinda normal, as when you start or reboot HA, it doesn’t know the alarm status. I’m using an automation to set the status at HA start, based on my devices locations:

- alias: Alarm Startup
  initial_state: 'on'
  trigger:
    - platform: homeassistant
      event: start
  action:
    - service: ifttt.push_alarm_state
      entity_id: alarm_control_panel.somfy
      data_template:
        state: >-
          {% if is_state('group.devices', 'home') %}
             disarmed
          {% elif is_state('group.devices', 'not_home') %}
             armed_away
          {% endif %}

Thanks. I think the issue lies with IFTTT, I can change the state via the alarm panel but the state change doesn’t trigger the webhook.

Wow, thanks for the great description. The status is now correctly working for me.

I have one question left… How to configure the card in Hass? I can’t get the selection/trigger correctly to work.

It looks like all is working now but very slow… When I change the status of the alarm it changes quickly in HASS. But when I command it from HASS it executes a couple of hours later. Three or four hours later the alarms gets activated when you don’t expect it…

Any idea where this delay from HASS -> IFTTT -> Somfy comes from?

I have it the other way around. Commands sent from hass to Somfyr Protect via IFTTT are instantaneous but IFTTT isn’t sending the status via webhook.

Thanks for the tutorial.
It works good to update the status of the alarm in HA when controlling the alarm with the Somfy app or badge. I can also disarm the alarm through HA panel, but I can’t arm the alarm.

I would prefer being able to arm the alarm or make it ring only, and not being able to disarm it (so that if someone hacks HA, they won’t be able to stop my security system), but is it possible ?

I can arm ( alarm_arm_away & alarm_arm_night), maybe you have something wrong with the Maker Event on IFTTT ?

To answer your question, you can remove the blue applets that you don’t need, such as disarm, so that even if HA sends an event to IFTTT, nothing will happens on the Somfy alarm.

Maybe I need to modify something in the alarm panel options, I can see there are some states ‘arm_home’ and ‘arm_away’, but names does not match the event name in IFTTT (alarm_arm_night & alarm_arm_away).

Do you use directly the panels buttons or did you create some dedicated buttons ?

I’m using the default alarm card:

I retried today after coming back from work, and now it works…
I tried to create an “alarm_trigger” event also, so that it trigger the alarm if someone forces my garage door while I’m away, but this doesn’t seem to work.

I tried again… Removed Somfy Protect completely from IFTTT and registered again. Then all the 6 applets are automatically removed. Added them again but unfortunately I have the same result; when I change states via the Somfy app the status matches quick in HA, but using the buttons in HA is very slow… After a couple of hours the system changes the state.
Any suggestions?

Hello community :slight_smile:

I’m trying to integrate Somfy Protect alarm using this cool guide !

Everything seems working, except the status change of Alarm Control Panel in Lovelace.
When I change alarm status from iOS app, webhook is correctly received, but I have following error message :

Webhook received: Error executing script. Invalid data for call_service at pos 1: Service does not match format <domain>.<name>

Here is details of my automations.yaml file :

  trigger:
  - event_data:
      action: call_service
    event_type: ifttt_webhook_received
    platform: event
  condition: []
  action:
  - data_template:
      entity_id: '{{ trigger.event.data.entity_id }}'
      state: '{{ trigger.event.data.state}}'
    service_template: '{{ trigger.event.data.service }}'

Here is an output of how is configured in IFTTT :

Can you help me to diagnose why the service is not recognized correctly ?

Thank you :slight_smile:

It seems that your automation is not well formatted, you should have another indentation after action:.

Try to copy-paste my automation from here.