Particle devices on Apple HOMEKIT via homebridge: Did anyone successfully install the new version?

Since 2016, I have been successfully using Homebridge v.0.4.38 on a Raspberry Pi 4 to control my 10 Home Automation Photons with my voice commands (Apple Siri).

It has been working like a charm! But recently I start to get more issues with it.
So, I tried to migrate to the new Homebridge version 1.4.0.

BUT, I am getting nowhere after spending a complete Sunday to make something work… :frowning:

I wonder if some of you have it working already?


What did I do?

I used a new SD card to install a fresh Raspbian system, then I installed Homebridge, following these instructions: LINK

  1. Install latest Node.js
  2. Install new Homebridge and Homebridge UI versions
  3. Install and configure the new Particle plugin “homebridge-particle-io” by @nthomas:
    LINK2
{
    "bridge": {
        "name": "Homebridge",
        "username": "CC:22:3D:39",
        "port": 51826,
        "pin": "031-45-15x"
    },
    "description": "This is an example configuration file with one Particle platform and 3 accessories, two lights and a temperature sensor.",
    "platforms": [
        {
            "platform": "ParticleIO",
            "name": "Particle Devices",
            "access_token": "d12f64d44etc…",
            "cloud_url": "https://api.particle.io/v1/devices/",
            "devices": [
                {
                    "name": "Light1",
                    "type": "lightbulb",
                    "device_id": "d12f64d44etc…",
                    "function_name": "onoff",
                    "args": "0={STATE}"
                },
                {
                    "name": "Light2",
                    "type": "lightbulb",
                    "device_id": "d12f64d44etc…",
                    "function_name": "onoff",
                    "args": "1={STATE}"
                },
                {
                    "name": "Temperature1",
                    "type": "temperaturesensor",
                    "device_id": "d12f64d44etc…..",
                    "event_name": "tvalue",
                    "split_character": ":"
                }
            ]
        },
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        }
    ],
    "accessories": []
}

This configuration file creates 2 light switches and one temperature sensor. I can see them appear in the Homebridge Graphic UI in my browser.

But when I toggle the switches, the state changes only very briefly from OFF to ON and then OFF again. In the temperature button, no temperature is indicated, although I can see in the logs that the Particle message with “temperature:20” is received. In the Particle console I can see that the commands “1” and “0” are received and the respective commands (Publish “Light ON or OFF” are working.

FYI: This is the sketch running on a test Photon:

// Testing a Photon (Internet button) on NEW Homebridge v1.4.0

void setup()
{
  Particle.function("onoff", onoff);
}


void loop()
{
  Particle.publish("tvalue", "temperature:20");
  delay(60000);
}


int onoff(String command)
{

  if(command == "1")
  {
    Particle.publish("Homebridge", "Light ON");
    return 1;
  }


  if(command == "0")
  {
    Particle.publish("Homebridge", "Light OFF");
    return 0;
  }

  Particle.publish("Homebridge", command);
  return -1;// If none above
}

I have 2 questions:

  1. What is wrong with this setup that no temperature is shown?
  2. Is it not possible anymore to add an argument to the command like it was in the older plugin (by @krvarma)? It allowed me to control a virtually unlimited number of devices with one photon…

On top of these issues, I could not add the Homebridge buttons to the Apple HOME app. I get an error message after scanning the QR code…

Thanks for your time!
Filip