Author Topic: Use Siri to get info on your moteino  (Read 3941 times)

xavier

  • Jr. Member
  • **
  • Posts: 65
  • Country: us
Use Siri to get info on your moteino
« on: July 05, 2016, 11:25:52 AM »
Not sure if you've already seen this but just in case: there is an easy way to get siri and your moteino+pi gateway working: https://github.com/nfarina/homebridge

I have it installed on my bananapi that talks serial to my moteino which in turn talks to my weather station (with another moteino) and it's pretty neat - true this could interface with other things than moteino but if you're already using the Felix Pi's gateway you'll get a new level of interaction.

As an fyi I went the easy way and used the Lockitron sample code, registered a temperatureService and humidityService which call a REST entry point on one of my servers, I have socket.io on the banana so technically I could just open a socket directly to the PI but since the PI already requests data every minute from the weather station it seems fine...

I used the apple sample code HMCatalog to debug from my iPhone the commands to use for Siri but as explained on the github you can use other apps...

I thought this was very neat so just posting here as an fyi, enjoy!

X

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Use Siri to get info on your moteino
« Reply #1 on: July 05, 2016, 12:53:24 PM »
Very nice, thanks for the reference  :)
Post some photos!

xavier

  • Jr. Member
  • **
  • Posts: 65
  • Country: us
Re: Use Siri to get info on your moteino
« Reply #2 on: July 09, 2016, 05:37:35 PM »
here you go, quick movie - you'll notice that for the humidity, siri tells you it's coming back from the weather station (which is the name I defined in  the HomeKit accessory) - For the temperature I had to create a room called outdoor, if you just ask for the temperature siri gets you back the temp from yahoo weather...

It was pretty easy to add support for siri using home bridge, not sure how I could add support for wind speed & direction though since it's not defined as a service or characteristic... anyhow let me know if anyone tries this out and needs some help!

walti82w

  • NewMember
  • *
  • Posts: 10
  • Country: de
Re: Use Siri to get info on your moteino
« Reply #3 on: February 06, 2017, 01:14:10 PM »
Nice work. But do you run it with moteinos ? CanĀ“t find a proper sample for it. :o

xavier

  • Jr. Member
  • **
  • Posts: 65
  • Country: us
Re: Use Siri to get info on your moteino
« Reply #4 on: February 06, 2017, 01:22:57 PM »
the weather station has a moteino that sends the info to a Pi that has another moteino connected through serial - if you look at the PiGateway example in the RFM69 folder you'll see how the communication through serial works and how the gateway just transmits between moteino nodes and the Pi. If you want to just get temp+himidity you can use Feilx's weather example (and his boards:-)

On the Pi you run homebridge, that's the modules that bridges HomeKit, my smarthings hub and my Pi+moteinos - HtH!

walti82w

  • NewMember
  • *
  • Posts: 10
  • Country: de
Re: Use Siri to get info on your moteino
« Reply #5 on: February 06, 2017, 03:19:29 PM »
Thank you for that quick answer! Actually I got the Pi Gateway running and my custom made moteinos for a year now. Now Homebridge is running as well. I have no idea what theconfig.json must contain. A sample to play with would be great  8)

xavier

  • Jr. Member
  • **
  • Posts: 65
  • Country: us
Re: Use Siri to get info on your moteino
« Reply #6 on: February 06, 2017, 04:57:15 PM »
I did this a while back but after looking at the code here what I remember:

- use the lockitron sample code from homebridge - long story short idea is load a plugin at runtime
- main file is the definition of LockitronAccessory and its services - this is as well where I make a call to my server to get the latest dat and cache it since HomeKit calls you separately for each service
- I defined new types for the data I needed (like windspeed and wind direction that are not defined types in HomeKit)

the accessory you created will get called by home kit when it needs to access the data - does that make any sense? Have a look at their sample code and how to load a plugin...

xavier

  • Jr. Member
  • **
  • Posts: 65
  • Country: us
Re: Use Siri to get info on your moteino
« Reply #7 on: February 06, 2017, 04:59:54 PM »
I should mention I did this before Siri was available to developers and that my light automation is d0ne through smart things (not that smart btw) - but long story short there is probably an easier way to do this directly with Siri...I feel the need to try it out now :-)

xavier

  • Jr. Member
  • **
  • Posts: 65
  • Country: us
Re: Use Siri to get info on your moteino
« Reply #8 on: February 06, 2017, 05:55:23 PM »
ok, so forget SiriKit - you can only integrate if you fit in their intent domains and unless I missed something it seems it's quite limited right now

If you still want to try HomeKit, here is my config.json (make sure you have it in ~/.homebrdige folder btw) - to load it make sure you pass the path to the plugin so you don't have to publish it in npm

Code: [Select]
{
 "bridge": { //this is from https://github.com/nfarina/homebridge/blob/master/config-sample.json
        "name": "Homebridge",
        "username": "CC:22:3D:E3:CE:30",
        "port": 51826,
        "pin": "031-45-154"
    },
    "description": "X-WeatherStation + ST Accessories",
    "accessories": [
      {
            "accessory": "WeatherStation",
            "name": "My Weather Station",
            "url": "http://##XAV##/edomus/getLatestData.php?houseId=Y&sensorId=Z", //I don't think you need this anymore
            "http_method": "GET"
        }
    ],
    "platforms": [
        {
            "platform": "SmartThings",
            "name": "SmartThings",
            "app_url": "https://graph.api.smartthings.com:443/api/smartapps/installations/",
            "app_id": "XXXXX",
            "access_token": "XXXX"
        }
    ]
}


hth!

X

Lukapple

  • Full Member
  • ***
  • Posts: 202
Re: Use Siri to get info on your moteino
« Reply #9 on: December 15, 2017, 02:33:23 AM »
Nice! I'll try to use this homebridge to control my garagemote node that is connected to Lowpowerlab's gateway. Any experiences with this setup?

Lukapple

  • Full Member
  • ***
  • Posts: 202
Re: Use Siri to get info on your moteino
« Reply #10 on: October 04, 2018, 03:23:53 PM »
Just a little update on this.
I've successfully connected all my moteino nodes(garage mote, motion mote, bell mote, temperature mote) with HomeKit using HomeBridge.
Everything works perfect with siri ;D You can even trigger a doorbell ring using command like "Hey Siri, ring".


xavier

  • Jr. Member
  • **
  • Posts: 65
  • Country: us
Re: Use Siri to get info on your moteino
« Reply #11 on: October 04, 2018, 03:50:31 PM »
that's very cool! post your code on GitHub

Lukapple

  • Full Member
  • ***
  • Posts: 202
Re: Use Siri to get info on your moteino
« Reply #12 on: October 05, 2018, 11:36:48 AM »
It's not ready yet for publishing it to GitHub. Gotta do some code cleaning first.
However, I'm happy to help if anyone needs some help with moteino and HomeKit.  :)