Skip to content

Instantly share code, notes, and snippets.

@dnicolson
Last active December 31, 2020 12:03
Show Gist options
  • Save dnicolson/eb67b582a910821d6bdde41b47e82ffa to your computer and use it in GitHub Desktop.
Save dnicolson/eb67b582a910821d6bdde41b47e82ffa to your computer and use it in GitHub Desktop.
IFTTT solution to control an iHaper device from a Google Home Mini without the (false error) verbal confirmations
const shell = require('shelljs')
const express = require('express')
const app = express()
const port = 8000
app.get('/', (req, res) => {
shell.exec('bash /home/pi/ihaper.sh')
res.send('')
})
app.listen(port)
#!/usr/bin/env bash
STATUS=`python3 -m homekit.get_characteristic -f ~/.homekit_python/pairing.json -a iHaper -c 1.13`
if [[ "$STATUS" =~ "true" ]]; then
python3 -m homekit.put_characteristic -f ~/.homekit_python/pairing.json -a iHaper -c 1.13 false
else
python3 -m homekit.put_characteristic -f ~/.homekit_python/pairing.json -a iHaper -c 1.13 true
fi
su pi -c 'node /home/pi/ihaper.js < /dev/null &'
sudo docker run --name whr-relayd --net host --restart always -d webhookrelay/webhookrelayd-arm:latest --bucket gactions -k <key> -s <secret>
# Raspberry Pi
sudo pip3 install homekit
sudo pip3 install --force-reinstall zeroconf
# macOS
pip3 install homekit
brew install webhookrelay/tap/relay
relay login -k <key> -s <secret>
relay forward --bucket <bucket> http://localhost:8000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment