A guide for dealing with Transperth’s Transit Guards and Revenue Protection Officers

So recently, I had the displesure of witnessing a less than impressive display of training and behaviour of two PTA Revenue Protection Officers (RPO) towards a First Australian mother whilst on a train to Perth just last Saturday.

That situation got me annoyed enough to not only make a formal complaint against the two RPO’s, but also started me thinking about how others could and should approach this kind of thing in similar situations.

So, here’s the story behind what happened, and how you can deal with this and similar situations in future.

What got me annoyed enough to write this?

The individual, a mother, had purchased her concession ticket, and the relevant child’s ticket for those of required age travelling with her. Sadly, as I found out when talkng to the mother later after the RPO’s had left that carriage of the train, whilst she still had the tickets purchased – her young daughter accidentally put the physical concession card in the bin just prior to boarding the train that day. (Edited the earlier sentence – because it seems there’s some dense people on Reddit who either don’t read, or can’t understand language complexity above that of a Golden story book, and need things spelt out to them like three year olds)

Sadly, the RPO’s didn’t use their training, and ask the mother if she had the concession card in an alternative accepted format (that’s the Digital Wallet version of the card, within Centrelink’s Express Plus Mobile application for iOS and Android devices). This is despite PTA and Transperth’s own materials for RPO’s and other Authorised Officers making clear statements about digitial versions of the concessions being available; and those same materials making clear that the digital versions are accepted as proof of concession entitlement.

The RPO dealing with this mother also wasn’t the nicest of people, and shall we say  language, tone of voice, and physical posture I observed lacked the professionalism and humanity I would have expected from the RPO.

I used the knowledge I had at the time to educate the mother on how to use Centrelink’s app to find the digital version of her concession card, and made sure she understood both how to appeal the fine, and extra grounds she could use for the appeal (being that the RPO’s didn’t follow their training or available materials to take reasonable steps to help her find accepted alternative versions of the concession entitlement).

Since that event, I’ve taken the time to read up on the relevant legislation, and been able to put together a robust guide on how to deal with RPO’s and Transit Officers who aren’t doing their best to balance the requirements of their role with the reasonable needs of passengers (to get to their destination safely, at the best available price, free of unnecessary obstruction or hinderence).

So, here’s how to challange a Revenue Protection Officer or Transit Officer when travelling on Transperth services

  1. Ask to see the physical copy of their certificate of designation
    Citation: Public Transport Authority Act 2003, Part 6, Division 3, Sect. 56 

    The Public Transport Authority Act 2003 (the act) requires that an “authorised person or security officer is to produce the certificate if required to do so by a person in respect of whom a power has been or is about to be exercised.”Or for the regular person on the street – IF:
    a) you’re approached by either a Revenue Protection Officer or Transit Officer, AND they either
    b) ask to see your ticket and your valid concession, or
    c) they give you a direction to do or not do something;THEN they must be able to show you their certificate of designation from the Chief Executive Officer of the Public Transport Authority (currently Richard Sellers).

    Another way of describing a certificate of designation would be like the Warrant Card issued to a Police Officer, that proves they are a lawfully appointed Police Officer.

    Asking for it is as simple as replying nicely and saying “Not a problem, can I see your certificate of designation please?”

    If they can’t show you their certificate of designation – walk away or just ignore them – as they are powerless under the Act. Without it, their uniform is best thought of as meaningless clothing worn by an actor.

  2. Note their details
    If you aren’t happy with something done by a Revenue Protection Officer or Transit Officer or wish to challenge their decision or behaviour with the PTA, take down as much detail as possible about them.Use the notes app on your phone to do it, or a pen and paper if you’re so inclined. It’s also reasonable to ask that the Revenue Protection Officer or Transit Officer remains in your presence while you note down this information to. If they refuse, note that fact down too, as it grounds for a complaint later.

    Details you should make a note of include:
    a) Their name;
    b) Any identification numbers displayed on their uniform;
    c) Any identification numbers displayed on their certificate of designation;
    d) What they look like (How tall, hair and length colour, skin colour, ethnicity, physical build, and any other identifying features such as tattoos and where they were on their body);
    e) Any other identification numbers, such as their PTA Employee ID, provided by or requested from them;
    f) All of the above information for every other person with them
    g) The date and time it happened
    h) Where it happened (i.e. if on a Train: what was the train carriage number, the line and direction of travel, and the stations where you got on board and got off the train; OR if on a bus: what was the bus number, the route number, the direction of travel, and details of the stops you boarded and left the bus).

    PS: In respect of (h), if you used a Smartrider for your journey – details of where you got on board and got off can be found online in your transaction history using the My Account service.

  3. Only provide the information you have to
    Citation: Public Transport Authority Act 2003, Part 6, Division 2, Sect. 57 (1-3) and Sect. 58 

    The Revenue Protection Officer or Transit Officer is very limited in the information they can ask you for.The act specifically states that they can only ask you for the following personal details:
    a) your full name;
    b) your date of birth;
    c) the address of where you are currently or normally livingAnd that’s it. No phone numbers, no proof of your identity, no details from bank cards. They cannot ask for anything more than that.

    And if they ask for anything more than what’s in that list, they are exceeding their lawful authority.

  4. If issued an infringement notice – ask for the infringement notice to be withdrawn
    Citation: Public Transport Authority Act 2003, Psrt 6, Division 2, Sect. 47

    Any one who issues you a ticket has the power to withdraw a ticket on the spot – and they’re should have the required document (a perscribed notice called Form 2) with them. It’s literally that simple for them to do then and there.And the act makes no express or implied stipulations about what a good reason for withdrawing a ticket is. So ifAnd if they won’t withdraw it – it’s easy to appeal the infringement online or by snail mail if you so choose. Just remember to provide as much information as possible to explain the circumstances behind the infringement, along with any grounds you feel that demonstrate that the Revenue Protection Officer or Transit Officer erred in their lawful duties, or other circumstances that show the fine (or modified penalty) is manifestly improper or unjust.

    I might write another post at some point on how to structure an infringement appeal letter, presuming I don’t find any good resources online for that.

  5. Make a formal complaint, and remember the Ombudsman
    And if you feel that any of the behaviour you experienced or witnessed wasn’t consistent with how they’re expected to do their jobs in law – make sure to lodge a formal complaint – seperate to appealing your infringement – following this advice on how to make and write your complaint.And if they don’t respond to your complaint, or you don’t agree with the outcome of the complaint, you can escalate your complaint to the State Ombudsman who has the authority to undertake further review and investegation of your concerns.

And that’s it – that’s everything useful I have to share on dealing with Revenue Protection Officers or Transit Officers.

Hopefully you don’t ever need to use this advice; but in the event you do – knowledge is power, and if anything makes sure that they’re doing their job properly (or maybe helps a few other people avoid their wrath as you slow them down by making sure they do their job right).

And in the interest of fair disclosure: My current employment involves working on behalf of an agency within the Australian Public Service (APS).

Keeping Uber honest – Using Excel to keep track of earnings, points and so on

So i’ve had a bit of a fustrating issue lately, where my account is caught by a bug causing my Momentum card not to have correct status or points.

As part of digging into this, I was looking into how to easily verify this. None of the 3rd party solutions I could find had any capacity for this kind of audit – so had to build my own, which I ended up doing in Excel.

This post will walk you through how to do it, and covers the small bits of setup and learning to get you started.

Once you’ve set this up once, it almost becomes set and forget. You just need to add your data each week, and Excel does the rest.

If you already have intermediate or greater level expereicnce using Microsoft Excel, this should take no more than 5-10 minutes to get going. Beginners should put aside an extra 10-20 minutes for some reading and concentration.

After that, you should be able to add new data and get your analysis after a payout with no more than 2min of effort (and that includes the time to login to the partner website, and download the file).

 

In this post:

  • What this does
  • What this does not do
  • What it looks like
  • Before you begin
  • Import the macro
  • Update the points grid
  • Clean up your single CSV file (and this is the start point each time you have new data to import after the initial setup steps)
  • Copy over the clean data
  • Refresh the pivot table, and see the magic
  • Questions? Comments? Expressions of gratitude?

 

What this does (use cases)

With this spreadsheet, you can:

  1. Keep track of all your partner data by:
    • Importing your statements into a single sheet within an Excel workbook, and
    • Using Macros, cleans up the data for consistent recording and data analysis
  2. Keep track of your Uber Pro/Momentum status by:
    • Updating the Points Grid to match your market, and
    • Using VLOOKUP and MATCH formulas, correctly calculate the points that should have been earned for this activity.
  3. Analyse and verify your Uber status and payments by:
    • Using PivotTables to quickly present and view your data, and
    • Perform mathmatical checks to cross-check payment amounts and other information.

 

What this does not do (things you’ll need to be aware of)

Because Uber Partner data differs all around the world, and even some programs can differ, this spreadsheet template and method covered in this article does not cover:

  • Removing currencies other than $A:
    If currencies in your exports are expressed in something other than $A, then modify the macro code accordingly for its find and replace functions.
  • Handling columns beyond a specific set:
    The spreadsheet template and macros have been designed to handle a specific column header set from the Uber exports (Specficially: Driver name, Phone number, Email, Date/Time, Trip ID, Type, Fare, Service Fee, Tip, Quest Promotion, and Total). Again, if some of your exports have different columns, learn more about Excel, Macros, and Pivot Tables for how to ensure a consistent set of clean data and reporting.
  • Automatically adding the program points grid for your market:
    Again, this isn’t something Uber publishes as a data table or via API to be easily accessed. As noted in the Before you begin section, you’ll need to locate the points grid on Uber’s website, and add this information into the right place on the workbook.
  • Handling quarterly qualifying periods:
    Where partner programs (such as Uber Pro Driver) use a quarterly period for qualification, you can learn more about Pivot Tables and Grouping to render the data that way.
  • Tracking and reporting cancellation rates:
    I’m not aware of any data export available to partners which allows you to get access to information on your cancellation rate. And as I’m only a delivery partner and not a driver partner, I don’t know how you currently get access to this information. You could build a column to track this yourself, and learn more about Pivot Tables to present this data.
  • Tracking and reporting feedback:
    Again, as there’s no way I know of to get your ride-by-ride feedback data, reporting and analysing this in the spreadsheet isn’t already baked in. Again, you could build a column to track this yourself, and learn more about Pivot Tables to present this data.

 

What it looks like

Here’s some examples of the data analysis performed by the Excel workbook:

Example of analysis of my earnings, just with parts of the data hidden because not all of the information is appropriate to share

Example of analysis of my earnings (parts of the data hidden because not all of the information is appropriate to share).

Screen Shot 2019-12-25 at 6.31.42 pm

Example of the Momentum points earned by Month.

 

Before you begin

  1. Have access to a desktop computer, with Microsoft Office installed.
  2. Get a copy of the points grid for your market and reward program (Momentum or Pro) to your computer: For my market – the Momentum points grid is at http://t.uber.com/AUSMomentumPoints; or the Uber Pro grid is here.
  3. Download your recent driver statements into a Single folder on your computer; then consolidate all the CSV’s into a single CSV file (Instructions for Windows, Mac).
    (Depending on how many files you have to download, this might take a while, unless you can cook up a script to download them all)
  4. Download my template file. (Download link)
  5. Enable the Developer tab in Excel (Windows, Mac).

Import the macro

One of the key steps in making this process seamless is the macro that cleans up your weekly CSV file for future data imports.

  1. In Excel, go to the Developer tab.
  2. Follow these steps to create a Personal Macro Workbook.
  3. Still on the Developer tab, press Visual Basic.
  4. In the Project window, expand VBAProject (PERSONAL.XLSB) > Modules.
  5. Right-click on Module1, and select View Code.
  6. Copy the text below, and Paste the following into the window that now appears:
    Sub FormatUberCSVFile()
    '
    ' FormatUberCSVFile Macro
    ' Clean up an Uber Driver Partner CSV export for import into a master file
    '
    ' Keyboard Shortcut: Ctrl+Shift+U
    '
        Columns("D:D").Select
        Selection.TextToColumns Destination:=Range("L1"), DataType:=xlDelimited, _
            TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=True, _
            Semicolon:=False, Comma:=True, Space:=True, Other:=False, FieldInfo:= _
            Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1)), _
            TrailingMinusNumbers:=True
        Columns("G:K").Select
    
    'Remove currency symbols - Update what's inbetween the quotation marks for What to adjust the currency code to be removed from the file
        Selection.Replace What:="-A$", Replacement:="", LookAt:=xlPart, _
            SearchOrder:=xlByRows, MatchCase:=False, FormulaVersion:= _
            xlReplaceFormula2
        Selection.Replace What:="A$", Replacement:="", LookAt:=xlPart, _
            SearchOrder:=xlByRows, MatchCase:=False, FormulaVersion:= _
            xlReplaceFormula2
        
    'Format as currency
        Selection.Style = "Currency"
        
    'Select and sort data
        Range("A:P").Select
        ActiveWorkbook.Worksheets("statement_f0a85ede-d1df-b7ed-cc").Sort.SortFields. _
            Clear
        ActiveWorkbook.Worksheets("statement_f0a85ede-d1df-b7ed-cc").Sort.SortFields. _
            Add2 Key:=Range("M:M"), SortOn:=xlSortOnValues, Order:=xlAscending, _
            DataOption:=xlSortNormal
        ActiveWorkbook.Worksheets("statement_f0a85ede-d1df-b7ed-cc").Sort.SortFields. _
            Add2 Key:=Range("P:P"), SortOn:=xlSortOnValues, Order:=xlAscending, _
            DataOption:=xlSortNormal
        With ActiveWorkbook.Worksheets("statement_f0a85ede-d1df-b7ed-cc").Sort
            .SetRange Range("A:P")
            .Header = xlGuess
            .MatchCase = False
            .Orientation = xlTopToBottom
            .SortMethod = xlPinYin
            .Apply
        End With
    End Sub
  7. If your currency is shown in a value other than A$ within the CSV exports, make sure you update the macro at the right places so it removes these values.
  8. Press the Save button.
  9. Close the Visual Basic window and return back to your Excel workbook.

 

Update the points grid

Now the macro is done, we need to add the points values by hour for your market. Otherwise, it can’t correctly calculate your Uber Pro/Momentum points earned for each activity in your market.

  1. With the existing Excel Tracking file (Tracking.xslb), change to the Points Grid tab.
  2. Using the

 

Clean up your single CSV file

Now, a reminder – each time you have new single data file to import, just open the file and start at Step 4.

  1. Still in Excel, open the single CSV file you created earlier (Step 3 in before you begin).
  2. Clean up the columns, so they go from this:
    Screenshot of a CSV file, shown in Excel, that shows the results of multiple CSV files merged into a single file

    Before cleaning up the data in the single file

    to this:

    Screenshot of a CSV file, shown in Excel, that shows the results of multiple CSV files merged into a single file

    After cleaning up the file

    Specifically

    1. Make sure that all the excessive header rows (Driver name, Phone number, etc) are removed from the file.
    2. Ensure that each data column has the correct data in it. Due to the way Uber creates its export CSV files, it just doesn’t ensure each column has the same data from file to file – so some files may have the Quest Promotion column if you had a quest that week, or the tip column will be removed if you received no tips that week.
  3. Save this file, but keep it open.
  4. Important: Run the macro to clean up the split up the Date column by pressing Control + Shift + U.

    Macro didn’t run?
    Using the ribbon, go to Developer, Press Macros, select the macro PERSONAL.XLSB!FormatUberCSVFile, then press the Run button.
  5. Save the file.

 

Copy over the clean data

Congratulations, you’ve cleaned up all your data.

Copy it from the CSV file, and paste it into the Tracking tab within your existing Excel Tracking file (Tracking.xslb).

Refresh the pivot table, and see the magic

And now that the data is copied over:

  1. Click on the Analysis – Earnings sheet at the bottom of the Excel workbook.
  2. Click within the Pivot Table on the worksheet.
  3. From the Ribbon, select Pivot Table Analyse > Refresh > Refresh All.

And that’s it, you have your data neatly presented and analyised, ready for you to do as you wish.

 

Questions? Comments? Expressions of gratitude?

Ask in the comments below. I’ll do my best to reply as and when I can.

And if this made things a little easier for you, don’t hesitate to send a couple of dollars my way as a token of appreciation.

A few words on Al Baker, gender equality, and the importance of business leaders speaking up on social change

So, Aviation is my passion – and there are some things that happen in the industry that have me shaking my head.

Today, it’s gender equality, and the importance of business leaders speaking up for social change.

Already this week at the IATA AGM in Sydney, CNN’s Richard Quest delivered a blistering line on the topic of gender equality in aviation:

Six men in suits will now discuss gender equality

Today, during a panel interview – Qatar Airways CEO & new IATA Chair Akbar Al Baker responds to a question about what IATA is doing on gender equality, especially given the Middle East has the lowest representation of women in airlines.

His response: (audio)

Well it is not at Qatar Airways” (sic), “of course it has (the position of CEO) to be lead by a man because it is a very challenging position & I’m sure that Alan (Joyce) will agree.

Joyce did not agree.

The reaction in the room was palpable, with ghasps, audible boos, and Alan Joyce immediately attempting to lighten the mood given Al Baker’s history for creating controversy, before delivering a sterling answer on the topic.

And that same reaction in the room extended online, with every industry journalist and commentator expressing bewilderment, shock, and calling out how awful, misguided, and tone deaf the remark was. I’d quote some of the tweets, but there’s too many to mention – and i’m writing this on a tablet device.

But what really got my undies in a bunch, was a specific comment from part the aviation peanut gallery – aka a frequent flyer forum.

In a thread about Al Baker’s comments, the one post from one user left me dumbfounded:

Shameful – it is not appropriate for business leaders to be weighing in on social and political issues.

And if you know me well enough, you’d also know my response to it, which i’ve included below.

CEO’s need to be activists. If anything in the current consumer climate, their balance sheets depend on advocacy as part of a well executed Corporate Social Responsibility strategy.

Look at what happened after the Parkland school shooting. Delta, who offered discounts for flights to NRA members was the subject of an effective consumer boycott, which caused them to drop their support of the NRA. The same went for car rental companies, airlines, trucking businesses, tech firms, insurers and a bank that issued an NRA-branded credit card. And the same happened to Fox News, whom advertisers walked away from in droves because of the behaviour of network starts involving issues that matter to their companies, their people, and customers alike.

The fact is – companies realise that consumers will vote with their wallets. Be it social issues, equal rights, or on environmental matters. Why do you think Woolworths and Coles this week basically went tit for tat this week on reducing plastic packaging.

They know that unless they take the lead on issues that are important to their customers – money will go somewhere else.

So, what did I say to this person I thought was ill informed – here it is. It shouldn’t need to be said, but sometimes – you just have to get it off your chest.

What do you think?

Firstly, a bit of context here.

Al Baker is known for being controversial, and for his intended humour not coming across as meant. It’s why Joyce jumped in with his line.

You also heard the reaction of the room, which was mirrored online by every Aviation/Aerospace journalist I know or follow.

Al Baker’s remark was at best tone deaf, and at worse stupid. It should have been patently obvious to him, especially after CNN’s Richard Quest blistering line earlier in the week calling the whole industry out for leadership gender inequality (“Six men in suits will now discuss gender equality”), that even a joke of this nature wouldn’t fly.

But, what strikes me as bizarre – is your comment that business leaders shouldn’t be weighing in on social and political issues.

Are you honestly suggesting that leaders of companies who employ lots of women, or have a substantial part of their workforce who identify LGBTIQ, shouldn’t be pushing for social change that gives equal rights and representation for these groups?

Are you honestly saying that Joyce, and the CEO’s of every major company that came out in support of marriage equality had no business doing so at all?

Should Andrew Forrest stop talking about indigenous equality and representation?

Should Tim Cook stay silent on issues involving data privacy?

Should Marc Benioff (Salesforce) zip his lip, just so he gets a better balance sheet because women in his company don’t have to get equal pay?

Should Donald Trump get away with decimating irreplaceable natural heritage and indigenous monuments because Rose Marcario (Patagonia) has chosen to stay in her lane?

CEO’s and corporate leaders are some of the more powerful voices shining light and bringing awareness to issues of local, national, and even international importance. Adding a voice that’s more likely to get top of the hour news coverage to the issues that should lead the news daily.

Regardless of what he said, I simply cannot find a charitable way at this time to describe just how dense your comments are on the inappropriateness of business leaders such as Al Baker weighing in on these issues.

First screen cap of Facebook comment, and my reply. Full text of the image is included earlier in the page. First screen cap of Facebook comment, and my reply. Full text of the image is included earlier in the page.

Revisiting HomeKit and non-HomeKit devices

Back in June 2017, I started to make good use of my existing macOS equipment, and leveraging the Homebridge platform to integrate my existing non-Homekit devices into Apple’s HomeKit. At the time, this included:

Six months on, the range of HomeKit supporting accessories remains limited. Despite Apple announcing that HomeKit accessories could move from hardware to software authentication during its’ WWDC 2017 event, very few manufacturers have updated their current suite of devices with HomeKit support.

Despite Belkin announcing they’ll be releasing a HomeKit Bridge for their Wemo platform in May 2017, it still hasn’t materialised and has missed their stated launch window. Netgear’s Arlo platform remains absent, despite their users requesting it, and a vague reference in German from a company employee on an official forum suggesting it will be on at least one Arlo product in 2018 (just not the one everyone wants).

So, here’s all the things I’ve learned along the way up until now, that makes my home setup work as well as I can possibly make it.

Where am I at now?

My HomeKit and Homebridge environment is still going strong, with new devices added as well, including:

And whilst Apple’s HomeKit environment lacks some of the switches and commands to do more complex things (i.e. change to a TV channel, increase the volume, or switch to a specific input), I’ve been able to work around this using scenes with complex actions created using Elgato’s Eve app for iOS, which i’ve documented below.

At the moment however, the Logitech Harmony system has been moved out of the Homebridge environment due to issues downloading the package after a reinstall of the server. I have managed to compensate for this by turning the TV on and off using a specific scene, and leaving the Logitech remote set to the TV activity at all times.

Current environment

Initially, I installed Homebridge onto a 13″ 2016 Macbook Pro. However, I’ve recently elected to move the installation onto a Mac Mini running with macOS Server.

Current Homekit equipment environment consists of:

  • Home hub
    • Apple TV 4th Generation
  •  Lighting
    • 4x LIFX Colour 1000 Lights
    • 4x Philips Hue White Lights
  • Power
    • 2x Belkin Wemo Insight Switches (great for power consumption monitoring)
    • 1x Belkin Wemo Switch
  • Security
    • Cameras supporting MJPEG or FFMPEG
      • 2x D-Link IR Day/Night cameras
      • 2x D-Link Day Cameras
    • 3x Philips Hue Motion Sensors
  • Environmental
    • Sensibo Sky Air Conditioning Controller
  • Audio visual
    • Sony 55″ X8500E 4K HDR Android TV with TRILUMINOS Display (KD-55X8500E)
    • Sonos
      • PLAYBAR,
      • 2x PLAY:1, and
      • SUB
    • Logitech Harmony Hub
  • Low Voltage sensors/controllers

How did I do it?

Pre-requsites

If you’re reading this article, let’s presume you’re the type of person who already has a good home internet connection and wifi network, so I’ll skip over that part.

To do this successfully, you will need the following:

  • A home computer or server that’s ‘always on’
    (i.e. Windows, macOS, Linux, RaspberryPI, or even some NAS boxes)
  • An iOS device with Elgato Eve installed (reason for this will become apparent later)
  • An Apple ID configured with both:
  • Home hub
    The features you want will determine your minimum hardware requirements for the device you use as a home hub:

    • If you want to control accessories remotely: Apple TV (3rd generation), or an Apple TV (4th generation) with tvOS 9.0 or later.
    • Automations and user permissions: You need an Apple TV (4th generation) with tvOS 10, or an iPad with iOS 10 or later.
  • Camera settings and URL’s
    When it comes to the Non-HomeKit cameras you’re planning to connect, you need to know the camera resolution; and the URL’s for both audio, video, and image streams. More information on that is below, including a reminder to test your URL’s.
  • Patience
    This will involve some trial, error, and some downloads. Don’t do this while tired, take your time, break it down into small pieces, and you’ll be amazed how well things work. This is especially true of when installing the Belkin Wemo Maker, as you’ll need to understand the device you’re connecting it to, what connections it offers, and have the manuals for it.

Camera settings

Next up, you need to get some information about your cameras.

First, find out the maximum image resolution for your camera. You should be able to get this from the settings page of its manual.

Second, you will need to get the URL for the video, audio, and image output of your camera. For D-Link cameras, and the others on this list, are well documented. Just find the name of your camera manufacturer, scroll down to the model number, and go from there.

Remember that if the URL shown in the database includes the camera’s username and password in the querystring, you put it there. For all others, you put the username and password in the URL, which is shown in my example config.json file below.

Finally, test your URL’s in your browser. You’ll save yourself a lot of time testing them first, just by copying the completed URL into your browser, to confirm they work. This ensures you don’t spend time doing complex debugging by reading log files or messing around with terminal commands, to figure out why they’re not working.

Homebridge Installation

  1. Follow this guide for installing Homebridge on macOS:
    https://github.com/nfarina/homebridge/wiki/Install-Homebridge-on-macOS
    (which has been heavily updated and revised after what i’ve learned)
  2. Install Homebrew (only needed if intending to view cameras with the homebridge-camera-ffmpeg package)
    https://brew.sh/

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  3. Install FFmpeg using Homebrew (Again, only needed if going to be using homebridge-camera-ffmpeg)
    $ brew install ffmpeg
  4. Install the relevant packages for my devices:
    $ sudo npm install homebridge-camera-ffmpeg
    $ sudo npm install homebridge-lifx-lan
    $ sudo npm install homebridge-platform-wemo
    $ sudo npm install homebridge-sensibo-sky
    $ sudo npm install homebridge-harmonyhub
    $ sudo npm install homebridge-bravia
    $ sudo npm install homebridge-zp 
    $ sudo npm install homebridge-openweathermap
  5. Complete your config.json configuration file (see more below).
  6. Run Homebridge OR
    IF you’re going to use the homebridge-bravia plugin, either read the Configuration section below to understand how to deal with this package, or spend a lot of time reading the readme file for this to get it properly running (https://github.com/normen/homebridge-bravia)
  7. Follow the Apple Support article Use the Home app on your iPhone, iPad, and iPod touch (HT204893) to get the Home app setup, create your rooms, connect to Homebridge, and assign accessories to rooms, setup favourites etc.
  8. Follow the Apple Support article Automate and remotely access your HomeKit accessories (HT207057) so you can create automations,  remotely control things away from home, and grant access to other people.
  9. Go and setup your scenes in Elgato Eve, so you can change TV channels, adjust volume, etc.

Configuration

The config.json file

When you go through the earlier installation steps, you’ll setup your config.json file.

If you’re new to JSON, I’d strongly suggest writing your config file in a text editor first, then testing it validates using JSONLint, before pasting it into your config file, saving, then starting up HomeKit.

I’ve obfuscated a few things in here obviously, the README file for Homebridge explains how to create your config.json file, and includes a sample file you can build on.

And remember – don’t use the default PIN in the sample config file. Leaving it as the default is going to make you look pretty silly when someone finds you’re running Homebridge, connects to your homes’ wifi network that you thought was properly locked down, and starts turning on and off all manner of switches (or turning on the TV audio at 3am in the morning with the last channel you had on – which will endear you to the neighbours).

{
 "bridge": {
 "name": "Homebridge",
 "username": "XX:XX:XX:XX:XX:XX",
 "port": XXXX,
 "pin": "XXX-XX-XXX"
 },

 "accessories": [
 {
 "accessory": "Weather",
 "apikey": "Your API Key",
 "locationById": "Your Location ID",
 "name": "OpenWeatherMap Temperature"
 }
 ],
 "platforms": [
 {
 "platform": "Server",
 "port": 8765,
 "name": "Homebridge Server",
 "log": "/Users/username/.homebridge/logfile.log",
 "restart": "launchctl unload ~/Library/LaunchAgents/com.homebridge.server.plist && launchctl load ~/Library/LaunchAgents/com.homebridge.server.plist"
 },
 {
 "platform": "LifxLan",
 "name": "LiFx"
 }, {
 "platform": "HarmonyHub",
 "name": "Harmony Hub"
 }, {
 "platform": "SensiboSky",
 "name": "Sensibo",
 "apiKey": "Your API Key"
 },
 {
 "platform": "BelkinWeMo",
 "name": "WeMo Platform",
 "noMotionTimer": 60,
 "ignoredDevices": []
 },
 {
 "platform": "BraviaPlatform",
 "tvs": [
 {
 "name": "TV",
 "ip": "XXX.XXX.XXX.XXX",
 "cookiepath": "/Users/username/.homebridge/sonycookie",
 "tvsource": "tv:dvbt",
 "soundoutput": "speaker",
 "maxchannels": 200,
 "listapplications": 0,
 "apps": [
 "com.sony.dtv.sonyselect-436bfc9b5bd4e592539a08096f1341bcc3ca9604",
 "com.sony.dtv.sonyselect-2e7fc758efc5f086a750ae20011633dbe25935cc",
 "com.sony.dtv.com.google.android.youtube.tv.com.google.android.apps.youtube.tv.cobalt.activity.ShellActivity",
 "com.sony.dtv.sonyselect-405f43aecbe92073ac3913eaa7500778e0cc8d3a",
 "com.sony.dtv.sonyselect-5a6a8ea601ee32ec482e251d176641048f96afbf",
 "com.sony.dtv.ceb-4834"
 ]
 }
 ]
 },
 {
 "platform": "ZP",
 "service": "speaker",
 "brightness": true,
 "speakers": true
 }, {
 "platform": "Camera-ffmpeg",
 "cameras": [{
 "name": "Cam 1",
 "videoConfig": {
 "source": "-re -f mjpeg -i http://username:password@10.0.0.1/mjpeg.cgi -i http://username:password@10.0.0.1/audio.cgi",
 "stillImageSource": "-f mjpeg -i http://username:password@10.0.0.1/mjpeg.cgi",
 "maxStreams": 2,
 "maxWidth": 640,
 "maxHeight": 480,
 "maxFPS": 30
 }
 }, {
 "name": "Cam 2",
 "videoConfig": {
 "source": "-re -f mjpeg -i http://username:password@10.0.0.2/mjpeg.cgi -i http://username:password@10.0.0.2/audio.cgi",
 "stillImageSource": "-f mjpeg -i http://username:password@10.0.0.2/mjpeg.cgi",
 "maxStreams": 2,
 "maxWidth": 640,
 "maxHeight": 480,
 "maxFPS": 30
 }
 }, {
 "name": "Cam 3",
 "videoConfig": {
 "source": "-re -f mjpeg -i http://username:password@10.0.0.3/mjpeg.cgi -i http://username:password@10.0.0.3/audio.cgi",
 "stillImageSource": "-f mjpeg -i http://username:password@10.0.0.3/mjpeg.cgi",
 "maxStreams": 2,
 "maxWidth": 640,
 "maxHeight": 480,
 "maxFPS": 30
 }
 }]
 }]

The horrors of homebridge-bravia

This package alone could use its own article, as it was a little frustrating. This was, due in part, to less than solid documentation on the part of its developer.

The short version, there’s a few extra steps to get this package working nicely:

    1. If your TV gets an IP address via DHCP, it’s time to give your TV a static IP address. If your router supports the ability to assign an IP address based on the Mac address of the device, that’ll be the best path to go down.
    2. Configure Remote Start on your TV
      On the TV, open Settings > Network, and enable Remote Start.
    3. Once the package is installed, go to your Terminal application and follow these steps to prep the needed sonycookie file
      cd ~/.homebridge
      touch sonycookie
      chown yourusername sonycookie
      chmod 777 sonycookie
    4. Make sure your TV is still powered on, and you can see it (as it will display a pairing key/PIN you’ll need to enter)
    5. From your Terminal app, run Homebridge
      sudo homebridge
    6. Key in the pairing key/PIN displayed on the TV once home bridge asks for this in terminal
    7. Quit Homebridge, then restart.
    8. If you need to get the list of applications installed on your TV, open your Homebridge log file and look for the information displayed. Lines with the app details will normally begin with:
      com.sony.dtv

And once you’ve done that, you’ll then need to have fun with some scenes to change channels.

Changing channels and volume

Now, HomeKit doesn’t understand voice commands for changing channels, or changing the volume.

These plugins will use a brightness switch, as a workaround for exposing a switch that will enable the action.

So, I mentioned the Elgato Eve app earlier – and this will come in handy.

Changing channels with scenes

The easiest way to change the channels is to create a custom scene for the specific channel.

Here’s a screen shot of the scenes i’ve created for this, and below is the instructions.

IMG_3765

Scenes for some of the channels on my TV

To create your scene, do the following:

  1. Open the Elgato Eve app
  2. Navigate to the Scenes tab
  3. In the top-right corner, press the Edit button
  4. Press the Add Scene button that is now displayed.
  5. Follow the workflow to select your room (Living Room in my case), then set the  switch for the relevant item (Living Room TV Channel in my case), and slide the slider until you get the channel number you want
    IMG_3770
  6. Press Add in the top-right corner of the window
  7. Press Next
  8. Give your scene a name (Change to Channel 31)
  9. Press Done
  10. Press Done again

From there, simply invoke the scene with Siri to change to the desired channel:

Change to Channel 31

It’s worth noting that I’ve found Siri often thinks “to” is “the” with my Australian accent, so I find I have to pause and add emphasis to the word “to” when calling this scene, to make it work consistently.

Setting custom Siri name for your TV speakers

First, make your life easier by setting some custom Siri names for your devices.

  1. Open the Elgato Eve app
  2. Navigate to the Rooms tab
  3. Select the room your Sonos speaker is in (Living Room in my case)
  4. Tap the Speaker instance for your Sonos speakers
  5. At the top of the speaker instance, tap on the disclosure triangle, then the configuration button
    IMG_3762.jpg
  6. Tap Siri Names
    IMG_3764
  7. Set a custom Siri name for your speakers
    IMG_3763.jpg

Changing the volume of your TV speakers

In my environment, the Sonos provides audio from my TV.

With the homebridge-zp plugin installed, and the custom Siri name set for the TV speakers as shown above – I can say the following to Siri to change the volume:

Change the TV speakers brightness to 50

And needless to say, the following would mute the volume:

Change the TV speakers brightness to 0

Create a scene for muting and unmuting the TV speakers

And for muting, and unmuting the TV audio – you can use the same method above for creating scenes – this time targeting the TV speakers brightness switch, which will handle this.

I’ve given these scenes simple names so they can be called quickly with Siri:

Mute the TV
Unmute the TV

Managing your Homebridge instance

If you want to remote into your server each time, to install, configure, and remove plugins – go right ahead.

However, if you’d like to make this is a little easier – there’s a couple of packages will make this a little easier using a web UI, depending on your individual needs.

These packages include:

Depending on the specific package, you can:

  • Quickly access the HomeKit PIN graphic
  • Search for, install or remove a plugin
  • Configure a plugin
  • View your log files
  • Restart the Homebridge instance

Diagnosing problems

The quickest way to find any issues is to keep an eye on Homebridge’s logfile, using this command before you start Homebridge:

tail -f ~/.homebridge/logfile.log

From there, you’ll see the output of the logfile, and spot whatever is going on.

Additional things I learned along the way

  • Read the readme files carefully
    Whilst most of the NPM packages developed have solid documentation, not all of them are the best – especially for new users. So sometimes you need to take extra time to read them.
    And if you need help, read the issue tracking pages for each plugin to see if there’s any useful information there. Worst case, you can ask for help in Reddit or via the project’s Slack channel.
  • Keeping your macOS unit always running
    From time to time, it would take forever and a day to control accessories using the iOS Home app. This is because the mac had ‘gone to sleep’, and no matter the change to the Energy Saver preferences in System Preferences – it wouldn’t play nice. This was pretty easy to address with a simply terminal command:

    sudo systemsetup -setcomputersleep Never

  • Cameras
    As long as your camera has a stream in a supported format, you should be able to integrate that camera. for the camera-ffmpeg package, there’s a growing list of known good configurations you can work from for various cameras. The good thing is that D-Link’s cameras have used the same URI’s for their features for as long as I can remember – so the posted known good configuration for the DCS-932 will work for pretty much any D-Link consumer camera in circulation.
  • Garage Door
    • Wires
      Any good speaker wire will do the job nicely. Just make sure to not leave too much of the wire exposed outside of the terminal block on the Wemo Maker. 6mm of exposed wire will be more than enough.
    • Getting the connection terminals right
      Luckily, the garage door at the place I live has various connection terminals on its controller board for wired control of both open/close, and sensors to indicate if the door was opened or closed. This meant no need to buy a magnetic reed switch and install it – saving extra time and work. A quick read of the manual, and looking at a good article from someone else who’d used the Wemo Maker for the same purpose, enabled me to figure out the wiring I needed to use, and got it done in one go (For the sensor, wiring COM on the door controller to – on the Wemo Maker, and NC to S).

Things I still can’t do

  • Cameras – Live view
    The cameras will get an updated FFmpeg still in the Home app every 10 seconds. Would still like to try and get it working to a stream, but that requires more reading and understanding on my part.
  • Cameras – Alerts
    There is at least one sensor package I’m yet to try, which uses the SMTP notification features of most cameras to provide alerts, or trigger actions when there are unexpected motions. I’m yet to sit down, understand which is the best package for my needs, and get going with it. Something to explore another time.
  • Power – Tracking usage stats
    With the Belkin Wemo Insight switches, they make available their usage data which can be viewed in the logs for Homebridge. I would like to be able to get at this data, to track power consumption dynamically in a graph, and not looking in the Wemo app or looking at the spreadsheets it sends.
  • Philips Hue Motion and Sensibo Sky – Tracking temperature, humidity and lux settings
    These devices output stats and information for various parameters, being temperature, humidity and lux. Again, like the Belkin Wemo, I’d like to be able to get this data out into some form of logging and live graphing for review purposes.
  • Harmony Elite
    I’d like to get the Harmony Elite package working again. I’d also like to see if the  package can only switch your configured activities on and off. It can’t change volume, pass other commands (stop, play, pause, input, show TV guides, etc). Not being a programming person, or having a deep understanding of the HomeKit platform, that’s something I’m not able to tackle. Maybe there’s a smarter cookie out there who just might be able to achieve it.
  • Xbox
    I’m yet to play with a plugin someone has developed to do basic on/off control for this unit (which is really all that’s needed, given the Kinect gives the user the ability to voice control the device).

Having fun with HomeKit and non-HomeKit devices


Update: A newer version of this article has been published, with updated information on the setup, configuration, and latest learnings on integrating non-HomeKit certified devices. For more, see:
https://allthingsempty.wordpress.com/2017/12/26/revisiting-homekit-and-non-homekit-devices/

If you want to understand more about my original journey with this, then feel free to read on.


Continue reading

The insult and injury tour living up to its name

So, it’s been a fun* start to the trip so far.
Disclaimer: Fun may be sarcasm, read on to find out how much *fun* it’s been so far.

We’re barely a day in, and we’ve survived an AA ticketing snafu where as part of reissuing both our tickets to apply upgrades – they issued them as paper tickets which prevented Qantas checking us in.

That took several phone calls and about 40min to resolve before they could issue the tickets, topped up by another 10min dealing with Most Significant Carrier (MSC) baggage allowances so Stuart Nolan could check in his six items of luggage (he’s moving to the US, so using 2/3 bags I’m allowed, plus the four he is, to move personal property over there).

With that issue almost resolved and dispensed (I need to check in with AA tomorrow, whilst Stuart has his boarding passes all the way through to Milwaukee) – we then move onto the next saga – which is why mentioning the moving vans worth of luggage Stuart is carrying is important.

So, we get a Wagon at the Taxi Rank, and load up half a moving vans worth of luggage – and the driver takes us from Domestic arrivals around to the Rydges on the international side.

Half way there, Stuart realises his hand luggage hasn’t made it into the car. I dump Stuart on the Rydges driveway to check in, and get the cab driver to race back over to Domestic Arrivals.

Mercifully, the bag was in the same place he left it – except with Qantas Security, Contract Security, and the Taxi rank supervisor pouring over it with a bomb/drug swab – all of whom were in a state of panic and I had to calm them down, explain what had happened, and successfully identified the owner so they’d back off and let me get on my way.

Talk about a fun start to the trip.

An awful, lingering thought

So this is going to be a confronting topic for some. I make no apologies for that.

But it’s something I need to get off my chest, to clear my mind and perform some long overdue processing of some thoughts.

Suicide – some amongst us have experienced this personally, having people close to us – family or friends – who’ve taken their lives this way.

Often, it happens with little understanding as to what drove them to it, or what was behind an awful act that some might glibly suggest showed cowardice on their part.

Some of us, myself included, might have been inconvenienced by an act of suicide, actual or attempted, and mused internally upon hearing what caused the delay mused internally, wishing they would have just got on with it so you could get to work, or school, or wherever it was you were headed at that point in time.

I find this very uncomfortable to say out loud or even share, but over the last couple of weeks and for reasons which I can neither explain nor comprehend, my mind has had frequent enough thoughts about wanting to end it all.

Mercifully these awful thoughts have not serious enough to even think about planning to do it, but scary enough to have increased my anxiousness to levels I’d never contemplated.

They however have been more than enough to put me off buying or hiring the garden mulcher I need to get my front yard fully sorted, and avoiding cooking dinner at home on account of feeling very uncomfortable around sharp knives.

Annoyingly, the anxiety arising is doing awful things to my body. I’ve spent the last four days with a raging case of indigestion. I didn’t know what it actually was at first, and after I’d figured it out – all the other causes that could explain why I was inexplicitly suffering it have been crossed off the list.

It’s seemingly adding a “deeper darkness to a night already devoid of stars“, if one is to borrow and re-purpose a quote by Martin Luther King, Jr. talking about violence.

The worst thing for me is not being able to put my finger on why I’ve been having these thoughts of late. Social isolation may be one part of it – lacking a strong network of friends, frequent conversation, working in a role where my home is my office – hence no colleagues to chat to during the day, trying to stay active, and the almost never-ending search for intimacy – all issues I’ve been struggling with for some time, and wrote about on more than one or two occasions.

This sadness also wasn’t helped by some news of an event that occurred between two people I consider good friends earlier this week, one which left me feeling genuinely sad for both of them. Two nice people, whom for their own private reasons, are going their own way for a time.

You want to reach out see what you can do to help them manage the pain, but that of course is a little limited when you yourself are feeling like an emotional cripple, and specifically want to avoid exacerbating what could already be a fragile situation.

But getting back to it – in some ways, this leaves me feeling annoyed.

At myself for not being able to figure out how, or struggling with even the smallest of steps to overcome the feelings and concerns that have built up to the current level of uncomfortable anxiousness.

At my close friends, for not recognising how I’m feeling and offering whatever help they can. There could be reasons for that of course, but by the same token I’m a little sick of being the emotional crutch – dropping tools to help anyone else out, but not receiving the same in return.

At my childhood experiences, for growing up with so few friends and being socially isolated in the school yard that it made it hard to learn skills that would help avoid this.

At people I went to school with, for being – as children and teens are prone to be – awful people who didn’t how others felt as a result of what they said, or did, or didn’t do, leaving me with scars – both physical, and the emotional which there are some I still haven’t recovered from.

At my teachers, for not realising or bothering to take action to correct the struggles of their students, and doing everything within their power to help someone reach their potential, and not feel discouraged by all that – at least within the school environment – that was holding them back.

At myself again, for not seeing things through. For reaching a point where after so much time battling and fighting, I felt mentally exhausted and gave up on trying. Not pushing myself to that next level. For pursuing university, or an MBA, or even a Diploma course that might give me some chance at being where I want to be, or have the potential to be, in my current field.

At my parents, for bringing me up in a religion which frankly I should have rebelled against and gone and lived the life and experiences a normal teenager/young adult would have.

To not be so uptight, taking the missed opportunity for a sneaky pash in the school yard with the hot girl, going out, partying, staying up late, all experiences I missed out on growing up.

Of course leaving out the drinking. Sorry, I still don’t see the value in that.

At my father, for being an emotional cripple, and dealing with his inadequacies through physical and psychological violence towards his eldest – who is to this day frankly smarter than his father could ever have been. Like the school yard, the emotional scars haven’t even come close to healing as well as they need to.

And at myself again, for lacking the confidence to address any of this to the point where I’ve been able to put it behind me.

It leaves me with this piece of dialogue floating around in my head:

I studied a lot in school. I studied hard in high school and at Harvard and in law school.
My IQ doesn’t break the bank, and I wanted to do this so I studied all the time. And I missed something or it’s like I skipped a year ’cause I never learned what you do after you think you like somebody– what you do next.
And every-everybody did learn. A lot of other people, anyway.

 

I was too focused on trying to be as good as I could be, that I missed learning how to have fun.

And right now, it honestly feels like I’ve missed that chance.

Some people have made welcome suggestions lately, but I don’t know if I have the willpower or the strength to give it a proper go.

Even going to the gym every couple of days feels uncomfortable. Not withstanding nobody to go with, but feeling out of my depth, especially with extremely fit people, and sometimes some very desirable women, around the place leaving me to feel like I don’t belong.

Which pivots back to where I started, and only just recognising and acknowledging – literally as I’ve started to write this very paragraph – why this awful thought isnt go away.

I feel like I don’t belong. In amongst everything going on around me, I feel like a square peg in a round hole.

I haven’t found where I fit in.

I don’t know how to find where I fit in.

And I’m not sure how to find it, or if anyone else knows the way.

The best I can hope for is an end to this spiral of unwelcome thoughts.

An end that is positive, and does not result in the sadness, and perceived cowardice, of early death.