Myfox Alarm

Hi everybody !
I’m new to home assistant, and I follow this topic since many days…
Today… I try to be less noob with HA ! :slight_smile:
I started to install Mosquitto Broker, then SomfyProtect2MQTT.
Everything seams to be good.
I use configuration file.
If I see the log, we can see :
2021-07-26 16:58:34,970 [INFO] Starting SomfyProtect2Mqtt
2021-07-26 16:58:34,971 [INFO] Reading config file config/config.yaml
2021-07-26 16:58:34,990 [INFO] Init SomfyProtect2Mqtt
2021-07-26 16:58:36,473 [INFO] Found 1 Site(s)
2021-07-26 16:58:36,474 [INFO] Look for Sites
2021-07-26 16:58:36,475 [INFO] Look for Devices
2021-07-26 16:58:36,476 [INFO] Update Sites Status
2021-07-26 16:58:36,477 [INFO] Update Camera Snapshot
2021-07-26 16:58:36,478 [INFO] Update Devices Status
2021-07-26 16:58:46,482 [INFO] Update Sites Status

OK ? But After… ? I feel lost… I dont see entity or card to see this plugin…

Can you help me plz ?
Thanks a lot !

Hi @Jerome33400

Have you enable MQTT integration in HA ?
All sensor should be discovered automatically

Well… I’m confuse… but it’s better after editing configuration.yaml entry…
After rebooting, I can this :

I think it’s better, thanks, but need to push more a little help pls :slight_smile:

Hi Again !

I finaly fix the bug, Alarm is OK, and this script is so powerfull ! Thanks a lot ! You make better than Somfy… for my dear Home Assistant… :slight_smile:

If you have a problem, I suggest to turn on Debug mode… like in my case… I had to delete/build a new apps in Somfy dev app.

Hi there,

Is it possible to update the camera snapshot via a script or automation? I want to show the snapshot at my hub when motion is detected but because of the update delay the snapshot isn’t always showing what triggered the motion detector.

1 Like

Same question here !
With the outdoor camera… :slight_smile:

Possible, but need an update of somfyProtect2MQTT, to add an option for activate or not camera auto refresh. Will look a it in the next weeks.

Hello,
New dev version available on : https://github.com/Minims/homeassistant-addons

Will be merge in schumijo repo once it’s validated.
If you already have my repo :
Rebuild the SomfyProtect2MQTT-dev add-on in home assistant supervisor to test.

What’s New :

  • Manage Snapshot on old MyFox Security Camera
  • Manage Extender
  • Manage Fume Sensor
  • Add a param in config : manual_snapshot: true to avoid snapshot auto refresh. A switch is available to trigger a snapshot in all cas now. @Jerome33400 @About2Break
1 Like

Thanks! I am going to check it out!

I updated to the latest dev version, and I get a recurring warning in log :


Logger: homeassistant.helpers.template
Source: helpers/template.py:1612
First occurred: 11:21:49 (7 occurrences)
Last logged: 11:27:59

Template variable warning: 'dict object' has no attribute 'snapshot' when rendering '{{ value_json.snapshot }}'

Also, I’m using the add-on as a standalone python script ran as a service by the systemd on my Rpi at boot. The service is configured to wait for docker to be ready as I’m using MQTT in a docker container. I did it this way as I’m running HA core in docker.
It works very well, but whenever the MQTT docker container is restarted while the systemd service is already running (i.e. to update MQTT), the SomfyProtect2MQTT service loose connection to MQTT and never recover.
That’s annoying as HA then stops receiving updates from the alarm, locking my automations.

for value_json.snapshot I think it is a misconfiguration of the new switch allowing to manually trigger a snapshot. I will look a it. it might only have an issue for checking switch status which is here unused.

I will check the reconnect function on MQTT too so.

Hello,

Addon updated

MQTT reconnect implemented.
Error on switch fixed.

Can you rebuild dev version and tell me If it’s ok ?

Works good for me without any errors. Maybe a stupid question but is it possible to make the ‘snapshot camera’ support the stream service? Without this service it is not possible to cast the camera to a hub or chromecast?

Hi,

I get this error from the mqtt log:

[08:52:42] INFO: Image build
[08:52:42] INFO: starting original stuff...
2021-12-10 08:52:43,104 [INFO] Starting SomfyProtect2Mqtt
2021-12-10 08:52:43,107 [INFO] Reading config file config/config.yaml
2021-12-10 08:52:43,123 [INFO] Init SomfyProtect2Mqtt
Traceback (most recent call last):
  File "/usr/src/SomfyProtect2MQTT/somfyProtect2Mqtt/main.py", line 29, in <module>
    SOMFY_PROTECT = SomfyProtect2Mqtt(CONFIG)
  File "/usr/src/SomfyProtect2MQTT/somfyProtect2Mqtt/somfy_protect_2_mqtt.py", line 56, in __init__
    self.somfy_protect_api = init_somfy_protect(username=username, password=password)
  File "/usr/src/SomfyProtect2MQTT/somfyProtect2Mqtt/somfy_protect.py", line 39, in init_somfy_protect
    set_token(api.request_token())
  File "/usr/lib/python3.8/site-packages/somfy_protect_api/api/somfy_protect_api.py", line 304, in request_token
    return self._oauth.fetch_token(
  File "/usr/lib/python3.8/site-packages/requests_oauthlib/oauth2_session.py", line 360, in fetch_token
    self._client.parse_request_body_response(r.text, scope=self.scope)
  File "/usr/lib/python3.8/site-packages/oauthlib/oauth2/rfc6749/clients/base.py", line 429, in parse_request_body_response
    self.token = parse_token_response(body, scope=scope)
  File "/usr/lib/python3.8/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 425, in parse_token_response
    validate_token_parameters(params)
  File "/usr/lib/python3.8/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 435, in validate_token_parameters
    raise MissingTokenError(description="Missing access token parameter.")
oauthlib.oauth2.rfc6749.errors.MissingTokenError: (missing_token) Missing access token parameter.
[cmd] /run.sh exited 1
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

can someone help me?.. :joy:

Did you create a developer account on the Somfy site and created your token for the API access ?
https://developer.somfy.com/

I know, something might have changed on Somfy side.
I still can connect via a curl command, but I can’t make it work via the oauth Legacy.

The current call currently return en HTTP 500 error from Somfy.

The problem is between

and

If someone has an idea

I have the same issue. Yesterday all worked fine…

Found ! will release this evening. At least for the dev version. I hope I can make it for prod too.

ah using the def actually works, no complaints on missing access tokens