Somfy Protexial Alarm

Hi,

I do have a Somfy Protexial Alarm System and it would be great if we could have support for that in Home Assistant as well.

Thanks,
Thomas

HI
Same question on my side. I have Tahoma and would like to access my Somfy protexial IO Alarm (visible in Tahoma) and also in Tahoma HA Integration Devices, but in HA, the status is “Unknown” however if I add it in a lovelace card, I have a button “Disarmed”. When I click on it my Alarm Beep, means it’s almost supported but im^ossible to read Alarm Status On/Off for example
Could you help ?

I also got it working up to the point you described. But no further luck that it works as expected. Would be great to get some support here.

Hi,

I also own a Somfy Protexial alarm since several years, but not the Tahoma box.

Since Somfy doesn’t provide any rest api, I wrote a software to interact with the alarm some times ago.

Basically, it wraps the web interface by doing web scrapping, and provide a rest api.

When discovering home assistant, I’ve wrote another program exposing alarm through mqtt, using this rest api (alarm state, elements states, alarm on/off) :slight_smile:

For now it run on Docker but not as a HA plugin (should not be so difficult to adapt)

I’ve never released it since I don’t know if web interface scrapping is allowed by Somfy, any idea about this ?

Would be super interested in this. But could only test it as a HA plugin as I am running HASSIO. But would be happy in helping testing etc.

Hi,

Ok, it’s great to share this work !

I’ll be back from holidays on 09/15 so we can make some tests in the following days.

I already converted another project to Hassio IO plug-in (TeleInfo2Mqtt) so I’ll apply same migration principles (mostly : define and use HA plug-in settings)

I hope that scrapping will also work with your model, it’s the key point to quickly have a working plug-in :wink:

You’ll also need a Mqtt broker to interact.

Have a good day,

Florian

I’m interested to to test also when you will be back from holidays. I already have MQTT Broker for my Zawve2MQTT and everything running through Docker

Hi Isaste,

Ok! I’ll get in touch with you too, when back home.

Have a good day,

Florian

Hi,

Some news about the “Somfy Protexial Alarm” add-on.

In fact, two add-ons will be needed :

  • A “Somfy Protexial IO Proxy” add-on, exposing alarm’s data via a REST API
  • A “Somfy Protexial IO Gateway” add-on, consuming “proxy” REST API data, and sending them to MQTT (commands can also be sent to add-on)

Why such design ?

  • The “proxy” monopolizes access to the alarm (web scrapping or POST requests)
  • “proxy” REST API can be used by gateway, but also other tools (like a Somfy protexial IO Emulator, allowing to use Xiomfy Android App)

For now, I’ve finished the first step => make the “proxy” compatible with HASS.io.

@Thomas_Gregg and @isaste, you can test the add-on by adding my repository ?

Once add-on is well configured and started, you should have the REST API available (default port => 8193)

Here are some links to check that all is working (no swagger available yet)

http://hostname:8193 => should return {“version”:“1.0.0”,“description”:""}
http://hostname:8193/api/status => return alarm’s global status as json
http://hostname:8193/api/elements => return alarm’s elements as json

If you have problems, you can send my logs with PM.

Best regards,

Hi Florian

Thnaks a lot for that sharing as promised
Hope you had great vacations
I’ll try your add-on this week end on my system and will keep you posted about the result

Regards

Hi @isaste,

Great vacations, thanks, but too short as always :sweat_smile:

It’s a pleasure to share my work.

I’ve upgraded “Somfy Protexial IO Proxy” add-on to 0.2 (small fix)

And I’ve just published “Somfy Protexial IO Gateway” 0.1 :slight_smile:

I advise you to check that Proxy is working well, as it provides all data for Gateway.

I hope it will work for you !

It it works for you, you’ll have a lot of additionnal sensors :

  • Global status will provide :
    • Alarm (activate/unactivate)
    • Alarm A (activate/unactivate)
    • Alarm B (activate/unactivate)
    • Alarm C (activate/unactivate)
    • open/close state (true = at least one door open)
    • alarm triggered (true = at least one element triggered alarm)
    • communication state (true = at least one element have communication issue)
    • box state (true = at least one element have box issue)
    • battery state (true = at least one element have battery issue)
    • GSM raw level (numeric)
    • GSM DBM level (numeric)
  • each door sensor (typedo, typedovitre) will be named “Somfy - {element name} - Opened” and provide :
    • open/close state (true/false)
    • alarm triggered state (true/false)
    • communication state (true/false)
    • box state (true/false)
    • battery state (true/false)

It globally works well for my, but I still have some stability issue with web scrapping (sometimes the alarme is not responding, I guess scrapping every 5 seconds is too fast, will try with 10 seconds => can be configured in the addon)

I will work on it in the next days.

:warning: Obviously I didn’t give any warranty about these add-ons => reliability, potential impact on the alarm web UI even if I didn’t noticed anything wrong :warning:

Also, It’s important to note that once the proxy add-on will work, it will be difficult to connect to the Alarm Web UI, since the proxy add-on do connect on the alarm, and try to reconnect if anything goes wrong (like a connection from alarm web UI, since only one user can be logged in at once)

I plan to release an “Emulator”, consuming “Gateway” REST API, and fixing this ennoying problem.

Hi @florian.drevet
I just installed the Proxy Add-on and I’m able to start/stop it, but didn"t find yet where to configure it.
Could you provide me some details on how to do this ?
Is the Somfy Integration neccesary ? (till now I only used the Tahoma Integration for my blinders)

Thanks

Regards

Waiting your answer about how to configure it, I installed also the gateway, but checking then the status of my dockers I discovered that when I start your add-on from HA, they are starting properly but after few seconds they stopped by themselves (same behaviour for the 2 dockers)
My docker system is running under Synology (all my other add-on docker like node-red for example are working properly)
Any idea ?

Hi @isaste,

My add-ons don’t rely on Somfy integration.

For the Proxy, you have to go to “Configuration” tab (same apply for Gateway)

Required informations are :

  • alarm hostname (or IP)
  • alarm TCP port (default is 80)
  • password of user “u” (same that you use when connecting to your alarm)
  • security table values (in order to automatically connect to the alarm)

User “u” can be changed (with “i” for example) but I suggest to not change it (I’ll probbaly remove this setting)

Here is how it look like :

My add-ons are .NET Core 3 portable programs (running in Docker images)

The add-ons should be installed by Home Assistant with the right base Docker image, depending on the processor architecture, but I guess that something is wrong => Can you send me logs with PM (tab after “Configuration”) ?

Personaly, I ran Home Assistant with Intel Xeon CPU, and I don’t tried yet to run the add-ons on other processor architecture (like ARM)

Do you know the processor used by your Synology ? I also own a Synology and could make some tests if needed.

Just trying to install everything and wondering what the correct order for the security table is. Is it A1… A5, B1…B5 etc or is it A1, B1, C1…?

Hi @Thomas_Gregg,

Good gestion !

Answer is : A1 B1 C1 D1 E1 F1 A2 B2 C2 D2 E2 F2 A3 B3 C3 D3 E3 F3 A4 B4 C4 D4 E4 F4 A5 B5 C5 D5 E5 F5

Next add-on update will indicates this.

Thanks

Thanks for that but it seems I have serious problems saving the configuration of the Proxy. I always get the following error message:

Failed to save addon configuration, not a valid value for dictionary value @ data[‘options’]. Got {‘Alarm’: {‘Hostname’:…

The logs tabs doesn’t show anything :frowning:. Any idea? I assume it has something to do with the way I try to store the security table. Could you please provide a more detailed example.

@Thomas_Gregg, have you the same problem when saving other add-ons ?

Here are my anonymized settings, can you try if they are successfully saved :

Alarm:
  Hostname: test.lab
  TcpPort: 80
  Username: u
  Password: '2222'
  SecurityTable: >-
    2222 2222 2222 2222 2222
    2222 2222 2222 2222 2222
    2222 2222 2222 2222 2222
    2222 2222 2222 2222 2222
    2222 2222 2222 2222 2222
    2222 2222 2222 2222 2222
Proxy:
  AlarmConnectionRefresh: 30
  AlarmStateRefresh: 5

You can send me your (anonymized) settings with PM message if you want.

On which plateform are you running th add-on ? (Raspberry ? Synology ? other ?)

Regards

Thanks. Could overcome this hurdle and now get stuck here:

info: SomfyProtexialIO.StateCache.Jobs.AlarmConnectionJob[0]
      Trying to connect as 'u'...
warn: SomfyProtexialIO.StateCache.Jobs.AlarmStateCacheUpdateJob[0]
      Disconnected, cannot update cache
info: SomfyProtexialIO.Implementations.API.SomfyProtexialClientWebScrapping[0]
      Contacting Somfy alarm...
fail: SomfyProtexialIO.StateCache.Jobs.AlarmConnectionJob[0]
      Exception in AlarmConnectionJob
fail: SomfyProtexialIO.StateCache.Jobs.AlarmConnectionJob[0]
      Authentification code not found