Bentel Absoluta Alarm System integration

BIG news, I finished coding everything and it works! HASS creates an alarm panel for each partition and you can arm/disarm them independently, you get live sensor data and partition statuses.
I just need to pack all of this in an addon(right now it has to be run manually from a terminal on a PC running node.js, not exactly user friendly). I’ve never done an addon, I hope to do this in as little time as possible. I’ll keep you updated.


2 Likes

Can I try it?

Ciao @nicomedia,
we’re all with you!

The addon is finally done!
Please note that this is BETA software, it may not work properly and cause problems, even though it runs fine on my setup.
Also, since this emulates the app, you will not be able to connect with your Absoluta app as long as the addon is running. This is a known issue that can’t be resolved as the Absoluta server only allows one connection at a time to a panel.
Please let me know if it works and if you encounter any problems.
To install the plugin connect to hass with the Samba plugin(or get to the file system in some way), and copy the “absoluta” folder in the “addons” folder. Then go to the Add-on Store in the Supervisor panel and click “Reload” from the top right three dots menu, then refresh the webpage and you should see the plugin under the “Local Addons” section. Install it, configure it, and run it!
Here is the link, have fun!

EDIT: if the install explanation wasn’t very clear, this explains it a bit more clearly.

EDIT 2: THE LINK IN THIS POST IS OUTDATED! Please download v1.1 at post Bentel Absoluta Alarm System integration - #71 by nicomedia, this version solves the bug in which the addon randomly freezes.

3 Likes

Hi! Thank you for your work, very appreciated. I installed your addon and the mosquitto-broker addon, I configured both, but I don’t receive any message if I subscribe to # (which should be a wildcard, and it works if I publish a packet with whatever topic).

In absoluta I have this log:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.

In mosquitto broker I have this log:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] mosquitto.sh: executing... 
[00:53:09] INFO: Certificates found: SSL is available
[cont-init.d] mosquitto.sh: exited 0.
[cont-init.d] nginx.sh: executing... 
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[00:53:10] INFO: Starting NGINX for authentication handling...
[00:53:10] INFO: Starting mosquitto MQTT broker...
1635897190: mosquitto version 1.6.12 starting
1635897190: |-- *** auth-plug: startup
[00:53:10] INFO: Successfully send discovery information to Home Assistant.
[00:53:11] INFO: Successfully send service information to the Supervisor.
1635897190: Config loaded from /etc/mosquitto/mosquitto.conf.
1635897190: Loading plugin: /usr/share/mosquitto/auth-plug.so
1635897190:  ├── Username/password checking enabled.
1635897190:  ├── TLS-PSK checking enabled.
1635897190:  └── Extended authentication not enabled.
1635897190: Opening ipv4 listen socket on port 1883.
1635897190: Opening ipv6 listen socket on port 1883.
1635897190: Opening websockets listen socket on port 1884.
1635897190: Opening ipv4 listen socket on port 8883.
1635897190: Opening ipv6 listen socket on port 8883.
1635897190: Opening websockets listen socket on port 8884.
1635897190: Warning: Mosquitto should not be run as root/administrator.
1635897190: mosquitto version 1.6.12 running
1635897190: New connection from 127.0.0.1 on port 1883.
1635897190: Socket error on client <unknown>, disconnecting.
1635897191: New connection from 172.30.32.1 on port 1883.

(Mosquitto log doesn’t change if I restart absoluta addon.) {EDIT 2: if absoluta is turned off no log is made}

I just don’t know what I’m missing…
Thank you again

EDIT: I tried to login from the app and it works, so I think the addon couldn’t even connect to the server… Panel_id and pin were correct though

Edit 2: Yesterday I left everything running and this morning I found the mosquitto log with dozens of these entries (this is a time-isolated block, previous log (another socket error) was at 1635925209):

1635925329: New connection from 172.30.32.2 on port 1883.
1635925329: Socket error on client <unknown>, disconnecting.
1635925449: New connection from 172.30.32.2 on port 1883.
1635925449: Socket error on client <unknown>, disconnecting.
1635925569: New connection from 172.30.32.2 on port 1883.
1635925569: Socket error on client <unknown>, disconnecting.
1635925689: New connection from 172.30.32.2 on port 1883.
1635925689: Socket error on client <unknown>, disconnecting.

This problem is unrelated with my plugin, it’s actually Home Assistant’s Supervisor checking is Mosquitto is running, you can read more about it here.

The plugin doesn’t have logs on the console, but it publishes debug info on the topic: “/absoluta/out”.

It looks like you’re having a problem connecting to MQTT. Check that your ports are left as default and that you set a username and password and that you’re inputting them correctly into the Addon’s config, it will not work in anonymous mode. Also, the broker IP shouldn’t be 127.0.0.1 even if MQTT is running on HASS, it should be HASS’ local IP(192.168.1.28 in my case).

Nice to know that “socket error” is a good thing :joy:

I can’t find /absoluta/out in my configuration (I’m using HA supervised in docker)

root@raspberrypi:/usr/share/hassio/addons/data/local_absoluta# ls
options.json
root@raspberrypi:/usr/share/hassio/addons/local/absoluta# ls
Dockerfile  Release  config.json  run.sh

Ip and port are correct, I tried the same configuration with MQTTX on my laptop sending a message with the same credentials and it is received from HA (I see it in the configuration if I subscribe to # ).

Still, the addon is not connected to Bentel’s server, since I can connect with the app while the addon is running, so there must be a problem there too…

That’s what’s supposed to happen. The addon connects to the Bentel server only after a successful MQTT connection, so it’s not connecting to MQTT for some reason.

It publishes debug info on that topic, it’s not a directory, but since it doesn’t connect to MQTT you won’t be able to get those messages, and also, those messages are only related to the connection to Bentel’s server, not MQTT.

This might be the problem, are you exposing Mosquitto’s ports correctly?

I see, OK.

I suppose Mosquitto is correctly configured, since I can reach it even from a remote machine. Also, I installed it simply using the Addon store, it made everything by itself.

That’s weird. I’ll try and run my HASS on Docker and see if I run into some problems. I always used a RPi so I didn’t test on other platforms for now. I’ll let you know.

I’m using it on Rpi, but because I’m using also other programs I’m using it in docker. By the way, if you install it in docker you won’t have supervisor unless you make some magic ahah

I installed an external mqtt broker on my pc, then I configured it on an mqtt client on another pc and on the home assistant integration. I can see messages from both (So I’m sure both clients and the broker are correctly working). I configured it on absoluta addon and it does not bublish anything.

@nicomedia thank you for your hard work! It seems all is working perfectly on my system.

Please remember to put only IP of the MQTT server in the settings and to use uppercase Absoluta ID.

I’ve tried to have a look at the source code, but it’s obfuscated. Due to the fact that this AddOn touches a very important security component of our houses, I’d suggest to provide it as open source , even if paid.
I know it’s hard work and for this reason I’m available to pay, but I’d like to review the code.
Thank you.

THANK YOU! I’m a fool. I used ip:port and not even think about using only the ip… Now it works. Sorry @nicomedia

1 Like

May I ask you how you configured the mqtt alarm control in configuration.yaml? I’m not sure what’s the topic ti command the alarm, nor how to make bypasses.

I used the HASS documentation found here. Unfortunately bypass functionality is not implemented by HASS, so there’s no way for me to do it unless I make a custom integration.

1 Like

I found a bug: after a while the addon stops updating the sensor states. I’m investigating on this issue and will release a fix ASAP. Did I mention this was beta software yet?

1 Like

If you had the time and the will to make the custom integration, you’d be my hero ahah

By the way, so far, great work. I’ll wait for next releases and let you know if I find any bug

Perhaps there is a maximum time that the connection to the Bentel server can remain open? You should check with the app open on the sensor monitoring section if after a while the connection is lost …

That actually is a problem, but I programmed the addon so that it reconnects automatically after 10 seconds when the connection is lost, so that shouldn’t be a problem.

1 Like