Visonic Powermax and Powermaster Component

Hello again,

Today I have tested a flooding situation but it seems that I am using the wrong trigger to get a notification because the condition is not met.

Here is what I am using:

automation:
  - alias: Alarm Triggered
    initial_state: 'on'
    trigger:
      - platform: state
        entity_id: alarm_control_panel.visonic_alarm
        to: triggered

Here is the associated log:
https://pastebin.com/LNSMhHMQ

I can see that the Panel Alarm Status is correctly reporting the “Flood” status, but the condition is not met to trigger the automation.
What should I use as a trigger then to report all type of alarms ?

Thanks a lot in advance,

It looks like from your log file that sensor Z18 is your flood sensor, is this correct?

If it is then

  - platform: state
    entity_id: binary_sensor.visonic_z18
    to: 'on'

Give it a try :slight_smile:

Thanks. This is the obvious workaround. But as the sensor is already reporting to the alarm panel, and as the alarm panel is already reporting “Flood”, I was wondering if there is not a simpler way.

Basically I would like a trigger which works for every kind of alarm (Intruder, Flood, Fire, Gas, Panic, Tamper, etc.).

Otherwise, I will have to test each scenario and design a customized trigger for each one.

Or perhaps I can directly query the Panel Alarm Status ? I am not sure about the best way to get that universal trigger.

Thanks

I’m not really sure what you mean.

You could create an HA sensor out of the “Panel Alarm Status” attribute and then check it for (Intruder, Flood, Fire, Gas, Panic, Tamper, etc.) when it changes from None. You can create HA sensors that don’t have to be shown in the frontend, sensors that you could just use in your automations.

Also “Panel Last Event” before the forward slash will get set to the detailed log event, in this case I think it will be “Flood Alert”.

Each time there will be a Visonic generated HA event on the HA event bus to trigger from and then you could look at the detail in the attribute as part of a conditional.

If you want a trigger for every type of alarm then trigger on your new HA sensor “Panel Alarm Status” being not “None”.

Does this help?

Hi Davesmeghead,

I’m trying to use the Custom Component with my Powermax Pro. I use the version including the changes of a few days ago. My Home Assitant comes to a halt quickly after startup. On pastebin you can find an example of the log from startup to coming to a halt. And a second one as well.

This is my YAML, I made the codes unreadable:

visonic:
  device:
    type: ethernet
    host: 192.168.1.103
    port: 23
  motion_off: 120
  language: 'EN'
  force_standard: 'no'
  sync_time: 'yes'
  allow_remote_arm: 'yes'
  allow_remote_disarm: 'yes'
  exclude_sensor: []
  exclude_x10: []
  panellog_logentry_event: 'yes'
  panellog_csv_add_title_row: 'yes'
  panellog_xml_filename: 'panel_log.xml'
  panellog_csv_filename: 'panel_log.csv'
  panellog_complete_event: 'yes'
  force_numeric_keypad: 'yes'
#  override_code: '****'
  download_code: '****'
  arm_without_usercode: 'no'

logger:
  default: critical
  logs:
    custom_components.visonic: debug
    custom_components.visonic.pyvisonic: debug
    custom_components.visonic.alarm_control_panel: debug
    custom_components.visonic.binary_sensor: debug
    custom_components.visonic.switch: debug
    custom_components.visonic.__init__: debug

I use a USSR ethernet to serial adapter: usr-tcp232-302.

Yesterday Home Assistant ran a bit longer (few minutes). I got a false alarm and then Home Assistant also came to a halt. I don’t have the log anymore, but last line was “runtime error: event loop is closed”

Could you give me some pointers on what I can do? Previously I was running a windows program for interacting with the alarm. That worked flawless, but I’m trying to migrate everythis to HASS from Homeseer. This program was not active when I ran you component.

Another funny thing (might not be related): some sensors show up as smoke detectors. I don’t use any Visonic Smoke Detectors.

I already looked at this post and I see that Mike has similar issues as I have.

I believe your USR adapter is using traditional RS-232 levels (± 12v) versus logic levels (0 and 3,3/5v). If so, logic levels are also inverted.

How are you connecting the adapter to the panel?

I looks like you’re sending and receiving data OK. Have you left the panel in installer state? As soon as we try to connect in powerlink the panel sends a reset and tells me that it is in Installer Mode.

Good question, it is there for almost 2,5 years. I’ll have opened the case and made some pictures.
I have used a dual rs-323 component I bought for this visonic when I used a Powerlink. I connected this with a straight serial cable, which is screwed into the ethernet-serial USR adapter. As reference please see the images. Appreciate your reply. I already saw your similar remarks above (but tbh I didnt fully understand them).

I havent left it in installer mode. I did the reset thing as mentioned on your github. But that was not when creating these logs.

It looks like my comment is overcome by events per Dave. The bits are flowing.

1 Like

I’ve just uploaded version 0.3.5.7 to Github, please give it a try. A Powermax+ panel refuses the enroll command to “auto enroll” and locks up and I’m wondering if your panel (Powermax Pro) does a similar thing. This new release just sends a “Panel Restore”.

As an added precaution, to keep things simple for me, can you please change to these config parameters:

  sync_time: 'no'
  exclude_x10: [0,1,2,3,4]
  panellog_logentry_event: 'no'
  force_numeric_keypad: 'no'

Give it a try and upload another log file please :smile:

Quick question, do you know if your panel can auto enroll a powerlink module or would you need to manually enroll it?

Ok I have used the following trigger and it seems to report everything:

automation:
  - alias: Alarm Triggered
    initial_state: 'on'
    trigger:
      - platform: state
        entity_id: sensor.visonic_panel_alarm_status
      - platform: state
        entity_id: sensor.visonic_panel_trouble_status
    condition:
      condition: template
      value_template: "{{ trigger.to_state.state != 'None' }}"

The only remaining thing for me would be to send a message with the zone friendly name which triggered the alarm.
I know that the zone number is included in ‘Panel Last Event’ but it appears like this “Flood Alert / Zone 09”.
Is there a simple way for me to have get the zone number (which triggered the alarm) as an integer and then access the friendly name of this zone ?
Otherwise I will have to use regexp to parse ‘Panel Last Event’ to get the zone number and then do some template hacking to get to the friendly name.

Thanks a lot in advance,

I will try tomorrow. Thanks! My panel needs a manual enroll for a powerlink to work. At least, that’s my assumption since I have a menu item for it. And when I installed a powerlink years ago I had to enroll it.

In your specific case this should give you the friendly name:
Just fix indent if needed.

automation:
  - alias: Alarm Triggered
    initial_state: 'on'
    trigger:
      - platform: state
        entity_id: sensor.visonic_panel_alarm_status
      - platform: state
        entity_id: sensor.visonic_panel_trouble_status
    condition:
      condition: template
     value_template: >
  {% if trigger.to_state.state != 'None' -%}
    {% set zone = "Z" + trigger.to_state.state.split(' / Zone ')[1]  -%}
    {% for state in states.binary_sensor -%}
      {% if state_attr(state.entity_id, 'device name') ==  zone -%}  
        {{ state_attr(state.entity_id, 'friendly_name') }}
      {%- endif %}
    {%- endfor %}
  {%- endif %}

Could you share your yaml code that get visonic_panel_trouble_status and sensor.visonic_panel_alarm_status sensors ?

I have just added the updated files from Github to the visonic folder. Here are the first log entries. I got a lot further than with previous attempts! I could now even arm and disarm the alarm without Home Assistant hanging. I’ll keep the new code running for a longer time and see if it stays stable. In the log I see a lot of Powerlink Counters and acknowledged messages like this:

2020-02-27 08:27:41 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [Controller] Powerlink Counter 612
2020-02-27 08:27:42 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [Controller] Powerlink Counter 613
2020-02-27 08:27:43 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [Controller] Powerlink Counter 614
2020-02-27 08:27:44 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [Controller] Powerlink Counter 615
2020-02-27 08:27:45 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [Controller] Powerlink Counter 616
2020-02-27 08:27:46 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [Controller] Powerlink Counter 617
2020-02-27 08:27:47 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [Controller] Powerlink Counter 618
2020-02-27 08:27:48 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [Controller] Powerlink Counter 619
2020-02-27 08:27:49 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [Controller] Powerlink Counter 620
2020-02-27 08:27:50 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [Controller] Powerlink Counter 621
2020-02-27 08:27:50 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [pmSendPdu] Resetting expected response counter, it got to 25   Response list length before 0  after 1
2020-02-27 08:27:50 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [pmSendPdu] Sending Command (I'm Alive Message To Panel)    raw data 0d ab 03 00 00 00 00 00 00 00 00 00 43 0e 0a    waiting for message response ['0X2']
2020-02-27 08:27:50 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [data receiver] msgType 0X2 got it so removed from list, list is now []
2020-02-27 08:27:50 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [data receiver] msgType 0X2 resetting expected response counter, it got up to 0
2020-02-27 08:27:50 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [handle_msgtype02] Ack Received  data = 43 
2020-02-27 08:27:50 INFO (MainThread) [custom_components.visonic.pyvisonic] [handle_msgtype02]    Received a powerlink acknowledge, I am in Standard Plus mode
2020-02-27 08:27:51 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [Controller] Powerlink Counter 622
2020-02-27 08:27:52 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [Controller] Powerlink Counter 623
2020-02-27 08:27:53 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [Controller] Powerlink Counter 624
2020-02-27 08:27:54 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [Controller] Powerlink Counter 625
2020-02-27 08:27:55 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [Controller] Powerlink Counter 626

I’ll keep my fingers crossed today and will let you know later if all stayed stable.
One question left: I see a lot of smoke detectors as sensors. Is this something I can setup in the powermax it self or is it just a case of wrong sensor detection and I have to live with this? I lost the manual so will have to do a google search, but browsing through the installers menu I could find a setting.

Thanks for the help so far!

update
Half an hour later and still working… Harry knocks on wood :wink:

They should be set in your panel so I would check that first. If you still have problems then see this post earlier in this very long thread. You can set the device_class which overrides the sensor type.
Also look here and here for more info

I assume that it’s in “Standard Plus” mode and not Powerlink, have you tried to manually enroll powerlink yet?

Also, did you put these settings back to how you had them originally

  sync_time: 'yes'
  exclude_x10: []
  panellog_logentry_event: 'yes'
  force_numeric_keypad: 'yes'

.

Hello everyone,

Is the latest version of this wonderful plugin working with the latest HA release ? because last time i updated HA to 103 i think, i had to revert to 102.3 because the communication between HA and alarm panel was unstable.

Thank you for this great work.

They should be set in your panel so I would check that first. If you still have problems then see this post earlier in this very long thread. You can set the device_class which overrides the sensor type.
Also look here and here for more info

I must have overlooked this post. Will dig deeper. tnx

I assume that it’s in “Standard Plus” mode and not Powerlink, have you tried to manually enroll powerlink yet?

I just did. this is the log.. No problems so far!

Also, did you put these settings back to how you had them originally

No, I haven’t. These are my current settings.

visonic:
  device:
    type: ethernet
    host: 192.168.1.103
    port: 23
  motion_off: 120
  language: 'EN'
  force_standard: 'no'
  sync_time: 'no'
  allow_remote_arm: 'yes'
  allow_remote_disarm: 'yes'
  exclude_sensor: []
  exclude_x10: [0,1,2,3,4]
  panellog_logentry_event: 'no'
#  panellog_csv_add_title_row: 'yes'
#  panellog_xml_filename: 'panel_log.xml'
#  panellog_csv_filename: 'panel_log.csv'
#  panellog_complete_event: 'yes'
  force_numeric_keypad: 'no'
#  override_code: '****'
  download_code: '****'
  arm_without_usercode: 'no'

logger:
  default: critical
  logs:
    custom_components.visonic: debug
    custom_components.visonic.pyvisonic: debug
    custom_components.visonic.alarm_control_panel: debug
    custom_components.visonic.binary_sensor: debug
    custom_components.visonic.switch: debug
    custom_components.visonic.__init__: debug

Would you like me to change or first wait a bit to see if anything happens due to the manual enroll?

All is well, after manually enrolling everthing looks stable. I just bit the bullit and changed the config. Here is the startup log.

Update 2 hours later: still going strong

That’s very kind of you to say so. I admit that I rarely install the “dot zero” HA when it is released and I wait for the subsequent fixes :slight_smile: