Myfox Alarm

Hi

I would love if someone could intergrate Myfox alarm and Camera to HA

Myfox device’s data and services are exposed to developers as REST APIs, so it should be possible to do it.

Relevant documentation: https://api.myfox.me/ . However, MyFox has been bought by Somfy, which is less permissive on their own products. I’m not sure this API will stay exposed in that way for long…

The above APIs are for legacy MyFox alarm systems. If you are referring to MyFox (now Somfy) Home Alarm and Camera, there is no API available. All we have right now is a very limited interface via IFTTT.

:frowning:

G

What about this git ? https://github.com/Laurent-Sarrazin/myfox-swagger/tree/master/generated-code/python3

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:

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

Setup the IFTTT Control Panel:

alarm_control_panel:
  - platform: ifttt
    name: Somfy

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

Setup the Webhooks (to send the alarm status):

ifttt:
  key: <YOUR KEY>

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:

alarm_disarm
alarm_arm_away
alarm_arm_night
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: