0.118: removal of iAlarm integration

I’m interested, so please post here any info.
Thanks

All you have to do is download the whole repository linked to above as a zip file. Extract the pyialarm folder and put it (and it’s contents) in config/custom_components. After a restart it should operate exactly as id did when it was a core component.

Just for a exercises in style I create REST calls to set alarm and get the status, if needed (quite challenging the sensor):
REST COMMANDS:

ialarm_disarm:
  url: http://192.168.x.xx/RemoteCtr.htm
  method: POST
  username: !secret username_ialarm
  password: !secret password_ialarm
  payload: 'Ctrl=3 BypassNum=00 BypassOpt=0'
ialarm_arm:
  url: http://192.168.x.xx/RemoteCtr.htm
  method: POST
  username: !secret username_ialarm
  password: !secret password_ialarm
  payload: 'Ctrl=1 BypassNum=00 BypassOpt=0'
ialarm_home:
  url: http://192.168.x.xx/RemoteCtr.htm
  method: POST
  username: !secret username_ialarm
  password: !secret password_ialarm
  payload: 'Ctrl=2 BypassNum=00 BypassOpt=0'

STATUS REST SENSOR:

- platform: rest
  resource: http://192.168.x.xx/RemoteCtr.htm
  name: ialarm_status
  authentication: basic
  username: !secret username_ialarm
  password: !secret password_ialarm
  scan_interval: 30
  value_template: '{{ value.split(''selected="selected">'')[1].split(''<'')[0]}}'

I did the following:

  1. copied the folder pyialarm under \HOMEASSISTANT\config\custom_components
  2. added in configuration.yaml (same as in 117.6):
alarm_control_panel:
  - platform: ialarm
    host: 192.168.xx.xx
    username: !secret user365
    password: !secret pw365

But upon restart I get the following error:
Platform error alarm_control_panel.ialarm - No module named 'custom_components.pyialarm.alarm_control_panel
Any hint?

@Salvatore_Virtuoso I’m new to home assistant and python but as far as I understand what you found in Github is a library for integrating ialarm and not a HA component. looking at the code you have a Ialarm class with method to get and set status, that could be at the basis of a alarm panel component. and in facts in 0.117 you can find a pyialarm library under 3rd party lib and also an ialarm alarm component that uses pyialarm. probably the best way is to merge pyialarm and ialarm component from 0.117 in a single custom component… I have no enough skill, maybe it is worth take a look to a similar custom component delivered through hacs

according to what I wrote before and some investigations, maybe you can put in the custom component folder only the files you can find in https://github.com/home-assistant/core/tree/0.117.6/homeassistant/components/ialarm.
Reference to pyialarm is in the manifest, to me is not clear if HA can manage this dependency by itself or you need to do something…

Hi, some time ago I developed a nodejs module (available also on docker) which is inspired by the python library used (and now removed) by home assistant.
The module expose both alarm and sensors via Mqtt and supports discovery:

Anyways this kind of alarms can be controlled directly via proprietary TCP protocol and that could be used for adjusting the now removed home Assistant component.

:roll_eyes: I didn’t look at the link. You are correct. The correct link is in the next post by @gforment

An enhanced STATUS REST SENSOR that exposes the same status of the former iAlarm, probably you need to change some lables according to iAlarm interface language (my is Italian):

- platform: rest
  resource: http://192.168.x.xx/RemoteCtr.htm
  name: ialarm_status
  authentication: basic
  username: !secret username_ialarm
  password: !secret password_ialarm
  scan_interval: 30
  value_template: >-
    {% set status = value.split('selected="selected">')[1].split('<')[0]%}
    {% if status == "Disarma" %}
      disarmed
    {% elif status == "Arma programma notte" %}
      armed_home
    {% elif status == "Arma totale" %}
      armed_away
    {% else %}
      {{ status}}
    {% endif %}

@Salvatore_Virtuoso, at the end of the day restore “iAlarm” component is very easy:

1 Like

Thanks a lot. I’ll give a try.
Meanwhile I was exploring the NodeRed solution as proposed by @maxill1 that seems to have a few more options (specifically, it returns also the reason for the alarm). As I already use NodeRed, it would be easy. If I can make something useful, I’ll post here.

I confirm that the procedure indicated by gforment and tom_l works like a charm.
Thank you both.

2 Likes

Thank you but I’m new to HA so NodeRed is something I have planned in the future. By now, plain vanilla HA is enough to play with alexa, alarm, cams and few other devices such as Shelly Duo…

Sorry, but in HA “HASSIO version” the system of copying the files into the “custom components” folder doesn’t work. The iAlarm entity is not available. thanks for your help

Yeah. It does.

sorry for my bad English.
I followed the procedure to save the 3 files in the config / custom_components folder (as you can see from the image).
I restarted HA.
And here I stop because I cannot find the entity, nor the device nor the state that refers to “ialarm”.
If you can tell me what next steps I need to take I would be grateful.
Thanks for your help!
p.s. I forgot, I also tried to put the files in the packages folder but the result is the same.


This is inside the configuration.yaml file
alarm_control_panel:

  • platform: ialarm
    host: 192.168.x.xx
    username:! secret user_ialarm
    password:! secret pw_ialarm
    name: Alarm

Start from the simplest configuration: use clear-text username e password. If it works, then it’s not a component problem, so you can move credential to secrets file. In any case I see an error (or a copy & paste problem) because you write “username:! secret” insetad of “username: !secret”. Can be that the error?

Thank you for your answer.
No unfortunately it’s just a copy and paste problem. I also tried with directly written values.
In both ways the “alarm_control_panel” is not available in the entities.
Now I was trying with the “rest_command” command as indicated by you, but in the HA LOGs it gives me a 401 error (authorization). Again I don’t understand where I’m wrong, here is the code I put in configuration.yaml
rest_command:
ialarm_disarm:
url: http: //192.168.x.xx/RemoteCtr.htm
method: POST
username: xxxx
password: xxxx
payload: ‘Ctrl = 3 BypassNum = 00 BypassOpt = 0’
ialarm_arm:
url: http: //192.168.x.xx/RemoteCtr.htm
method: POST
username: xxx
password: xxx
payload: ‘Ctrl = 1 BypassNum = 00 BypassOpt = 0’
ialarm_home:
url: http: //192.168.x.xx/RemoteCtr.htm
method: POST
username: xxxx
password: xxxx
payload: ‘Ctrl = 2 BypassNum = 00 BypassOpt = 0’

The services are created, but when I call them nothing happens and in the LOGs I see error 401 (user and pw however are correct).
Thanks again for your availability

Try username and password directly in the browser, it seems the credential you are using have some problem. try http://192.168.x.xx/ in your browser…

Thanks but it’s weird.
I have checked them many times. In fact, by typing the address on the browser, the page opens correctly and I write the user and password that I have in the yaml code, I access correctly.
I cannot understand where the error is.
Here is the HA log after calling the service