I have moved over to a Honeywell evohome solution (mainly because it gives me greater control over heating in each room with its up to 12 zones, and also because of its zone by zone ‘learning’ of heat-up/cool-down times). And yes, this is fully managed through openHAB.
It is actually a web front-end I put together to the evohome api, to help me edit evohome schedules more easily. This web page is then shown on an openHAB sitemap using webview in the usual way.
hoping someone can help.
i’m trying to follow this guide:
stuck on trying to execute the script. If i try running just hiveToOpenHAB.sh i get -bash: hiveToOpenHAB.sh: command not found.
running bash hiveToOpenHAB.sh get hiveToOpenHAB.sh: line 7: syntax error near unexpected token newline'_ _hiveToOpenHAB.sh: line 7:’
google hasnt been much help, only thing i’ve found is it dosnt like !DOCTYPE.html but not found a way to resolve this.
any ideas?
Ok next problem. I cannot control Hive from openhab. If i put the temp up and hit boost nothing happens. reading data from hive works fine; so if i boost from hive and update OH it shows heating it boosted and target temp. Am i missing something simple here?
Sorry, I don’t think I can help you much on this one as it has been a very long time since I last looked at these scripts (I no longer have a Hive).
From memory, I can only suggest that you make sure your openHAB calls the correct script file for boosting or setting the temperature (setpoint). These are separate scripts which as I noted in my first post of the thread, worked when I first put them together but were not something I used much, and so could be broken. Also note that from a quick look now, I didn’t see those scripts in @robkenny’s github repo. If you were to use them from my repo, you may have to do a bit more work in terms of getting your hive config file set up (or it may all just work! ).
i noticed those scripts werent there but assumed they had been intigrated into the 1 script by @robkenny
I’ll throw in your scripts and see what happens. Thanks
Sorry, I don’t use Hive anymore and so cannot really help. Error message says that your authorisation failed. That normally means userid/password issue. Failing this, British Gas may have updated something at their end, which would mean the scripts may be out of date.
I’ve created some software that uses the Hive API to give much more control over it. It was aimed at landlords but it also logs all of the temperature data to Excel for analysis so may be of some use to all sorts of people https://quantum-key.net/AppPages/204-British-Gas-Hive-Landlord-Control.htm
Hi, not sure how active this thread is, but I’ve been playing with the beekeeper API to communicate with my Hive setup. Google hasn’t thrown up any other examples of beekeeper over here, so I’m hoping this will be of use to the community.
The attached script is what I’ve got so far.
#!/bin/bash
if [ "$1" == "" ]
then
LOGINRESP=$(curl -s -X POST \
https://beekeeper.hivehome.com/1.0/global/login \
-H 'Content-Type: application/json' \
-d '{
"username": "<username>",
"password": "<password>",
"products": true
}')
echo $(jq -r '.token' <<< "${LOGINRESP}") > /etc/openhab2/scripts/hive.token
else
TOKEN=$(</etc/openhab2/scripts/hive.token)
if [ "$2" == "" ]
then
PRODRESP=$(curl -s https://beekeeper-uk.hivehome.com/1.0/products \
-H "Authorization: ${TOKEN}" \
)
case "$1" in
"temperature")
echo $(jq -r '.[0].props.temperature' <<< "${PRODRESP}");;
"target")
echo $(jq -r '.[0].state.target' <<< "${PRODRESP}");;
"working")
if [ $(jq -r '.[0].props.working' <<< "${PRODRESP}") == true ]
then
echo "ON"
else
echo "OFF"
fi ;;
"mode")
echo $(jq -r '.[0].state.mode' <<< "${PRODRESP}");;
esac
else
curl -s -X POST \
https://beekeeper-uk.hivehome.com/1.0/nodes/heating/<thermostatID> \
-H 'Content-Type: application/json' \
-H "Authorization: ${TOKEN}" \
-d "{
""$1"": ""$2""
}" >> /dev/null
fi
fi
Replace the <username>,<password>,<thermostatID> placeholders with the values for your system - these will match the values from the other API I believe
save to /etc/openhab2/scripts or somewhere sensible (but be aware there is a hardcoded reference to this directory to save the access token)
Profit
Usage:
Run on it’s own to get an auth token
Specify one of four variables temperature/target/working/mode to read that value from the cloud
Specify one of the above four variables and a vlue to set that value in the cloud (so “./script.sh mode BOOST” activates boost)
I’ve not wired it into openhab itself yet, but I’m designing it to work with the 1.x EXEC binding (which I prefer to 2.x due to being able to use types other than string). The general idea being:
On startup run it without arguments to log in to hive
Bind it to Items to get/set hive values
Unknown at this point, but possibly add a rule to periodically log into hive and get a new token. This may be needed if the token times out even if being used regularly.
Ultimately I’d love to write a proper Binding using what I’m learning here, but I’m not massively familiar with Java dev’t so that may be a while, so I’m quite happy if this inspires someone else to do so!
Also, I don’t have a hot water controller or any lights to develop against, so I’m hoping someone can pick this up and start running with it for you guys who do have those things!
I initially had this issue however I then realised that I had not wrapped the username and password in quotation("") marks. As soon as I did this it worked.
As it happens I’ve been working on an actual binding for hive. It only supports the thermostat at the moment but i’ll be actively developing it. More info here: First try at a binding for Hive from British Gas