How do you execute this addon ? This addon must be run as an Hassio addon.
I only have HACS added to my Docker HA Core, I don’t have the Add-on Store, and I tried adding the Github repo to HACS, but it doesn’t work. So I simply used the manual installation guide : clone the repo, install requirements, and start the Python script manually.
But when closing the terminal running the script, the plugin is stopped. I need to create a service file to run the plugin as a service with systemd.
For now it can’t be done via alarm entity.
There is a switch entity called switch.<Site Label>_siren
. It trigger on ON and stop on OFF.
Need to have a look at the alarm entity to integrate this.
Ok I will look to provide a system daemon to run the script in background, and restart on failure. I need to test before.
This might be something like this:
# Create this file
sudo vi /etc/systemd/system/somfyprotect2mqtt.service
---
# File Content
[Unit]
Description=somfyprotect2mqtt
After=network.target
[Service]
ExecStart=python3 main.py
# Where you have clone the repo
WorkingDirectory=/opt/SomfyProtect2MQTT/somfyProtect2Mqtt/
StandardOutput=inherit
StandardError=inherit
Restart=always
User=pi
[Install]
WantedBy=multi-user.target
---
# Then Start Daemon
sudo systemctl start somfyprotect2mqtt.service
# Check Status
systemctl status somfyprotect2mqtt.service
# If All is OK, enable it for start on boot.
sudo systemctl enable somfyprotect2mqtt.service
Right, I made a service file for autostarting the plugin, ensuring it starts after Docker, as my MQTT broker runs in a docker container:
[Unit]
Description=Somfy2Mqtt
After=docker.service
BindsTo=docker.service
ReloadPropagatedFrom=docker.service
[Service]
Type=simple
User=root
WorkingDirectory=/home/homeassistant/SomfyProtect2MQTT/somfyProtect2Mqtt
ExecStart=/usr/bin/python3 /home/homeassistant/SomfyProtect2MQTT/somfyProtect2Mqtt/main.py
ExecReload=/usr/bin/python3 /home/homeassistant/SomfyProtect2MQTT/somfyProtect2Mqtt/main.py
Restart=always
[Install]
WantedBy=multi-user.target
It works perfectly.
Wow, I’ve searched quite a lot. And with the IFTTT solution never worked very well.
This is very nice!! Thanks a lot for the good work!
This is wonderful work. I was disappointed with Somfy and their support, this add-on is great! The only thing on my wishlisht is forthe camera streams to work and for the outdoor camera to be supported. Thank you so much!
About camera stream, I don’t think it will work a day except someone has some knowledge about WebRTC stream. It’s not my case. So for now only latest snapshot is available.
What is missing for Outdoor Camera ? Most of the things might work I think. If you can give me some input, I can check how to ass the missing features.
For the outdoor camera i am missing the latest snapshot. Only the indoor camera’s provide this feature. Is it possible to add this?
Ok, I think I know where the issue is. I will try to have a look this evening.
Works great! Thank you
I have a made a Pull Request to the official add-on with the new release of somfyProtect2MQTT.
Note that the new version allow to add a code in HA for the alarm entity.
That will be very useful for a wall mounted tablet! Otherwise an intruder is able to disarm the alarm.
@schumijo Did you get some time to review my PR, it seems working on my dev version. I let you check if it seems good to you Thx !
I am in holidays without access to my laptop. I have approved your commit without testing (je croise les doigts )
No Problem, maybe there is some bugs .
Next time, take your time for the review, I just wanted to be sure you saw it . Happy Holidays !
Just installed the update, the outdoor camera snapshot is missing.
I tried to set up the code but i can’t seem to get the code function working, this is my configuration:
homeassistant_config:
code: 1234
code_arm_required: false
code_disarm_required: true
In the supervisor log i saw the following that could be relevant:
WARNING (MainThread) [supervisor.addons.options] Option 'homeassistant_config' does not exist in the schema for SomfyProtect2MQTT
Forgot something on my master branch … this must fix the outdoor issue. About the add-on, it seems I need to deal with the schema, will probably make a temp PR to make to HA code work on master branch.
Dear
I am noob on all this but i installed somfy2MQTT.
Seems it is working and sending to mosquitto broker. it seems to work, i checked with MQTT explorer and some messages are received from my broker.
but nothing happens. My somfy deveices do not pop up anywhere.
Is there something to add to the config file ?
Thanks for your help
to add info,
please forgive me if i am using wrong wording or if my problem is stupid. I installed somfyprotect2MQTT add on as client to Mosquitto broker. It seems that the connection correct as mosquitto log says:
1621937114: New connection from 172.30.32.1 on port 1883. {“result”: “ok”, “data”: {}}1621937114: New client connected from 172.30.32.1 as somfy-protect (p2, c1, k60, u’mqttuser’).
but what i do not know is how the somfy devices are going to be declared in HA. Do i need to install specific clients ?
i understood that the devices are going to be automatically discovered but nothing happens