Visonic Powermax and Powermaster Component

Snap, I’ve only got it turned on for the hallway, but seems to be reliable and showing up. Next it to link some automation and see how well that works…

Hi!

Testing all weekend long now. After your fixes in .12 my alarm doesn’t reach powerlink mode anymore.
Tried everything back and forth.

.14 does not connect to my ESP wifi/sserial at all. It’s a “No Go” on that version for me. :slight_smile:

.13 connected as it should, and still goes to standard mode, faster then i would like it to.
Edit: After installing ESP inside alarm and making the alarm powerless for 10 minutes, the system asked if i wanted to “remove powerlink device”, i answered “Ok”. Then started home assistant and im now in powerlink mode without issue.

Have tested one of my sensors with motion and it seems to return movement. Need to test this way more before i can say anything about it, for sure, just yet.

Hi Dave, been testing over the past few days.

I have tried changing the min and max time before triggers and it does seem to pick up more events.

I still have about a minute delay from moving in the room to motion actually detected in home assistant.

If I trigger a few sensors with a delay of a few seconds in between, home assistant will not detect all of them just the odd one.

If you need any logs let me know.

Many thanks.

Yes please, if you could try it with different time settings as well I’ll take a look through.

This is to do with the time b0_min_time_between_triggers I would think

Hello Dave.

I have noticed a minor issue, which of course does not affect the proper functionality, but I was wondering if there is something I can help with to make it work.
I am talking about the “GSM Install” attribute which has a value of “Not Installed” although I do have it installed.

I also have a question since I was not able to find anything.
Is there a way to get the list of troubles reported by the panel?
I can see the attribute “Panel Trouble: Yes”, but I don’t see a way to get the report.

Thanks again for the amazing work.

Do you have a PowerMax or PowerMaster? I ask as I took the EPROM data mapping from a PowerMax, a PowerMaster may be different and I don’t have anything to compare.

First of all you could look at the Tamper Status of the Sensors themselves, these will cause a Trouble Status in the Panel. Apart from that there’s nothing else currently.

To do it properly we would need to get the Event Log from the panel. I can do this manually using my code i.e. it is implemented and working (for me at least :slight_smile:) , but it is not currently incorporated in to HA. How could I incorporate this in to HA? Ideas would be welcome. There are 100s of log event entries, where each entry contains:

  • Partition Number (Integer)
  • Time and Date (Currently a string but I can do whatever is needed)
  • The Device associated with the event e.g. Zone, Switch, Fob, Panel, GSM (as a String)
  • Event (String)

It is not something for a sensor, switch, entity etc.
I could create HA events on the HA event bus with the data from each Panel Event Log but that seems pointless, what would the consumer do with such an event.

Like I said earlier, any ideas would be welcome and I’ll give it a try :smile:

When you last uploaded your log file I noticed that some things were a bit weird. Messages from the panel would be missing, whole messages and not just fragments so I’m not sure what’s going on with your panel. Do you have it working with the latest version? Can you re-start HA and does it reliably go to Powerlink every time? If not then please do another new log file and I’ll take a look :smile:

I am using a PowerMax Pro, so either the eeprom is not reporting it correctly, or the code is not recognizing it.

Regarding the log. Where is it implemented (part of code, line numbers) so that I can have a look?
Maybe a parser with filters to get the troubles only would be a good idea.
I am mostly interested in the panel errors (Tel Line Failure, Panel low batter, Siren low battery, communication failures, etc.). Usually for zones, it is the battery level, which can be handled from the zone attributes.
Of course I can see all these from the panel it self, but it is not easily accessible and you can not have a notification for them.

I’ve just updated the event log processing and uploaded version 0.3.4.15 to Github, please make sure you’re using this new version for the following explanation.

To trigger the retrieval of the event log, please call the service visonic.alarm_panel_eventlog with an optional code parameter that is only needed when in Standard Mode. This gets the panel log and passes it through one at a time to __init__.py line 189. This simply dumps it to the log file at the moment. I get a total of 250 log entries but your panel may be different.

In __init__.py line 189. visonic_devices is of type LogPanelEvent. LogPanelEvent is available at pyvisonic.py line 872 but essentially consists of the variables current, total, partition, time, date, zone and event.

I’m not keen to start adding parsers and filters as different users will want different things. If you want to filter it then, as I said before, I can easily create an HA event from the data and your automations, scripts etc can decide what to do. The only concern I have, and why I haven’t done it, is pushing through 250 events (for my panel) on to the HA event bus, would this be OK? I guess that I could give it a try :smile: and see what happens

I don’t have a GSM module so it’s difficult to test, I read it from the EPROM and the address value I use was obtained from another Component so I can’t verify that it is correct.

Is it a worthwhile idea to convert the strings to XML, and publish the text to a file for an RSS card to view ?

Well I gave it a go, it wasn’t that difficult to implement an event in HA, the code to add it is only a few lines. In __init__.py line 187, you should see what I mean.

        elif type(visonic_devices) == visonicApi.LogPanelEvent:
            # This is an event log
            _LOGGER.info("Panel Event Log {0}".format( visonic_devices ))
            # Fire event visonic_alarm_panel_event_log
            hass.bus.fire('visonic_alarm_panel_event_log', {
                'current': visonic_devices.current,
                'total': visonic_devices.total,
                'date': visonic_devices.date,
                'time': visonic_devices.time,
                'partition': visonic_devices.partition,
                'zone': visonic_devices.zone,
                'event': visonic_devices.event
            })
     

I have 2 web browser pages open, one on “developer tools, services” and the other on “developer tools, events”. I set it to listen for my new event visonic_alarm_panel_event_log and triggered the service. On the events page it took about 45 seconds for all 250 events to come through.

I can do, do you have a preference on xml file name, format and file location? There are 2 numbers in each event “current” and “total”. When current==1 I can create a file and then when current==total I can close it. I could then generate a single event in HA when the file is closed.

What about during the file writing, would that cause any problems as it takes tens of seconds?
Edit: Scratch that question, I can create the xml structure in memory and write it all out at the end. The RSS card would still need to reload the file though.

Hi Dave. Attached is a log with a few motion events. It is still about 30- 60 seconds from motion to actually showing in home assistant. I triggered about 10 sensors but only about 4 come through to home assistant.

At the moment the setting I have for B0 are…

b0_enable_motion_processing: ‘yes’
b0_min_time_between_triggers: 2
b0_max_time_for_trigger_event: 1

I get more motion events using the above setting. But I still get the 30- 60 sec delay no matter what I set it at.

Could not upload to pastebin as its too large so will add to dropbox

https://www.dropbox.com/s/8z5u4qw6c08pwa8/log2.txt?dl=0

Well, I have no immediate need; it was a suggestion for @barsamgr’s request.

For the format, I’d have to look at examples of the RSS files I’ve been using for an ecobee feed. I’ve been using two HA components: the Freedparser integration and the the List Card plugin.

https://community.home-assistant.io/t/lovelace-rss-feed-parser-plugin-list-card/64637/

In the meantime, here’s a link to a format template:

https://en.wikipedia.org/wiki/RSS#Example

I’m guessing the feed can be a local file. The location would be something like “/www/community/visonic/rss/file_name.xls” which would be referenced as “/local/community/visonic/rss/file_name.xls”.

Is the www directory exposed to the network via a non-routable local IP address (e.g. 172.x.x.x)? If so, a browser with an RSS add-on might be an easier and more elegant way to view the data. The Firefox add-on I use, Feedbro, keeps a running history of the feed, although I’ve been using the ATOM formatted content. I’m not sure RSS can do that by design, or if it’s a feature of the add-on.

I’m not sure what triggers a reload, but there is a mechanism for it. New content automatically replaces the last feed content, but the referenced URL for Feedparser and Feedbro is static.

Me neither, I’ve got it to the point now where I think I’ll just add some configuration.yaml parameters. I can generate HA events and/or generate an xml file.

We can make the filename (including the location path) a config parameter and therefore can be put wherever the user wants it. The current working directory seems to be the HA config directory. I just created an xml file like this open("visonic_event_log.xml", "wb") and that’s where it appeared.

This is the proposed xml file content (using my panel logs)

<?xml version='1.0' encoding='UTF-8'?>
<data>
  <log>
    <event partition="1" current="1" total="250" date="10/01/2020" time="13:00" zone="Fob  01">Disarm</event>
    <event partition="1" current="2" total="250" date="10/01/2020" time="07:43" zone="Fob  02">Arm Away</event>
    <event partition="1" current="3" total="250" date="09/01/2020" time="20:21" zone="User 01">Disarm</event>

.... 244 more i.e. current 4 to 247 inclusive. Sometimes partition="Panel"

    <event partition="1" current="248" total="250" date="12/10/2019" time="17:30" zone="Fob  01">Disarm</event>
    <event partition="1" current="249" total="250" date="12/10/2019" time="14:29" zone="Fob  01">Arm Away</event>
    <event partition="1" current="250" total="250" date="11/10/2019" time="12:52" zone="Fob  01">Disarm</event>
  </log>
</data>

The possible values in the body (“Disarm” etc) are contained in pyvisonic.py line 293 in pmLogEvent_t

The possible values in the zone (“Fob 01” etc) are contained:

  • for PowerMax in pyvisonic.py line 377 in pmLogPowerMaxUser_t
  • for PowerMaster in pyvisonic.py line 420 in pmLogPowerMasterUser_t

Me neither, but again I think I’ve gone as far as I can. I can update the format / structure of the xml file in future but that’s risky if someone is already using it. So, comments on the xml structure soon please :slight_smile:

Oh that’s cool, thank you @davesmeghead !
Would i ask too much saying that both CSV and XML would just be perfect. CSV can be easily been read by every one when there’s not much fields.
I haven’t read last 7 posts yet, it might have been already asked for or even already done.
Anyway thanks again for that.

The only way that I know of doing this with a PowerMaster is when then panel sends:

  • message 3/57 - I assume that this means that the panel has activated something
  • I then ask what that is
  • message 3/4 - contains the sensor data, including PIRs (or maybe only PIRs I’m not sure)

This takes more than a second back and forth. I then need 2 of these sequences to happen to look at the differences.
Also, with your panel we’re getting the response back but in more than 1 second and they’re not being paired together in the code.

Because of these 2 issues, in other words, it looks like b0_max_time_for_trigger_event needs to be set to at least 3 seconds. It was a good test to see how quickly the panels react, but they’re not that quick. So can you set this to 3 seconds please. I also in my code assume that b0_min_time_between_triggers is larger than b0_max_time_for_trigger_event so can you set b0_min_time_between_triggers to something like 5 seconds.

Again, can you please give it a try and upload another log file. It has taken me quite a while to go through this one but they are useful.

OK, I’ve just implemented a Comma Seperated Variable (CSV) file, like this

1, 250, 1, 10/01/2020, 13:00, Fob  01, Disarm
2, 250, 1, 10/01/2020, 07:43, Fob  02, Arm Away
3, 250, 1, 09/01/2020, 20:21, User 01, Disarm
.......
248, 250, 1, 12/10/2019, 17:30, Fob  01, Disarm
249, 250, 1, 12/10/2019, 14:29, Fob  01, Arm Away
250, 250, 1, 11/10/2019, 12:52, Fob  01, Disarm

Nothing uploaded to Github yet :slight_smile:
I need to add some config parameters to enable/disable them

Impressive,@davesmeghead you‘re just too good to us and so fast implementing every of our wishes ! would be even more perfect with field names on first header line :wink:

If anyone is still interested in a local RSS feed, I have some inputs on how to create the RSS version of XML. This would be useful for viewing log text in a card on the Overview page. Otherwise, what’s already implemented can work well enough.