Read British Gas Hive Heating temperature

In this subforum you can show projects you have made, or you are busy with. Please create your own topic.
MikeF
Posts: 246
Joined: Sunday 19 April 2015 0:36
Target OS: Raspberry Pi
Domoticz version: V4.9700
Location: UK
Contact:

Re: Read British Gas Hive Heating temperature

Post by MikeF » Wednesday 17 October 2018 0:05

I've recently installed the Hive plugin, which has detected my heating and lights OK, and is regularly updating these (I've set multiplier to 6, so I get updates once a minute). However, I getting the following error several times a day:

Code: Select all

2018-10-16 17:22:08.206 Error: (Hive) 'onHeartbeat' failed 'HTTPError'.
2018-10-16 17:22:08.206 Error: (Hive) ----> Line 594 in /home/pi/domoticz/plugins/Hive/plugin.py, function onHeartbeat
2018-10-16 17:22:08.206 Error: (Hive) ----> Line 140 in /home/pi/domoticz/plugins/Hive/plugin.py, function onHeartbeat
2018-10-16 17:22:08.206 Error: (Hive) ----> Line 390 in /home/pi/domoticz/plugins/Hive/plugin.py, function GetDevices
2018-10-16 17:22:08.206 Error: (Hive) ----> Line 163 in /usr/lib/python3.5/urllib/request.py, function urlopen
2018-10-16 17:22:08.206 Error: (Hive) ----> Line 472 in /usr/lib/python3.5/urllib/request.py, function open
2018-10-16 17:22:08.206 Error: (Hive) ----> Line 582 in /usr/lib/python3.5/urllib/request.py, function http_response
2018-10-16 17:22:08.206 Error: (Hive) ----> Line 510 in /usr/lib/python3.5/urllib/request.py, function error
2018-10-16 17:22:08.207 Error: (Hive) ----> Line 444 in /usr/lib/python3.5/urllib/request.py, function _call_chain
2018-10-16 17:22:08.207 Error: (Hive) ----> Line 590 in /usr/lib/python3.5/urllib/request.py, function http_error_default
with the strange effect that it seems to be 'blocking' the Domoticz log. I have numerous RFXCOM devices, which would normally appear in the log at least once a minute, but I'm only seeing scheduled lua events:

Code: Select all

2018-10-16 17:25:00.405 Status: EventSystem: Script event triggered: /home/pi/domoticz/scripts/lua/script_time_SolarSensor1.lua
2018-10-16 17:30:01.447 Status: EventSystem: Script event triggered: /home/pi/domoticz/scripts/lua/script_time_SolarSensor1.lua
2018-10-16 17:35:00.584 Status: EventSystem: Script event triggered: /home/pi/domoticz/scripts/lua/script_time_SolarSensor1.lua
2018-10-16 17:40:00.104 Status: EventSystem: Script event triggered: /home/pi/domoticz/scripts/lua/script_time_SolarSensor1.lua
2018-10-16 17:45:00.170 Status: EventSystem: Script event triggered: /home/pi/domoticz/scripts/lua/script_time_SolarSensor1.lua 
This can continue for an hour or more (no regular pattern), before the RFXCOM devices appear again. Checking the log in the GUI for each device, however, shows that these devices are reporting regularly, with no gaps. The same also applies to the Hive devices - these show continuous history.

Any suggestions?

imcfarla
Posts: 56
Joined: Monday 04 December 2017 14:18
Target OS: Linux
Domoticz version:
Contact:

Re: Read British Gas Hive Heating temperature

Post by imcfarla » Saturday 24 November 2018 0:19

Hello all,

I recently got my hands on a colour changing bulb and I have implemented support for it in the plugin.

I did have to change the switch type to "dimmer" after I added the device.

Give it a shot if you have any of these and disco to your hearts' content!

https://github.com/imcfarla2003/domoticz-hive

Cheers,

Iain

gnunan
Posts: 4
Joined: Friday 30 November 2018 17:41
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Read British Gas Hive Heating temperature

Post by gnunan » Friday 30 November 2018 18:35

Hi,

First of all a big thank you for this plugin.

I am running Domoticz V4.9700 on a Raspberry Pi (Raspbian Jessie) and I have installed Python 3.4.2 (which also matches the version that Domoticz is reporting). I have other Python plugins running successfully, but unfortunately I cannot get the Hive plugin to run - Domoticz either becomes totally unresponsive or else an error appears in the logfile before it has done anything (debug is turned on):

Code: Select all

2018-11-29 22:56:52.464 Status: Domoticz V4.9700 (c)2012-2018 GizMoCuz
2018-11-29 22:56:52.465 Status: Build Hash: a3a45906, Date: 2018-06-23 15:24:51
2018-11-29 22:56:52.465 Status: System: Raspberry Pi
2018-11-29 22:56:52.465 Status: Startup Path: /home/pi/domoticz/
2018-11-29 22:56:52.550 Status: EventSystem: reset all events...
2018-11-29 22:56:52.709 Status: PluginSystem: Started, Python version '3.4.2'.
2018-11-29 22:56:52.727 Status: WebServer(HTTP) started on address: :: with port 8080
2018-11-29 22:56:52.743 Status: WebServer(SSL) started on address: :: with port 443
2018-11-29 22:56:52.747 Status: Proxymanager started.
2018-11-29 22:56:52.749 Status: TCPServer: shared server started...
2018-11-29 22:56:52.750 Status: RxQueue: queue worker started...
2018-11-29 22:56:54.750 Status: (MAC presence) Started.
2018-11-29 22:56:54.751 Status: (NUT UPS monitor) Started.
2018-11-29 22:56:54.751 Status: (Hive heating) Started.
2018-11-29 22:56:54.751 Status: EventSystem: reset all events...
2018-11-29 22:56:54.752 Status: EventSystem: reset all device statuses...
2018-11-29 22:56:54.918 Status: Python EventSystem: Initalizing event module.
2018-11-29 22:56:54.919 Status: EventSystem: Started
2018-11-29 22:56:54.919 Status: EventSystem: Queue thread started...
2018-11-29 22:56:55.653 (Controller) General/Thermostat Clock (Thermostat Clock)
2018-11-29 22:56:55.054 Status: PluginSystem: Entering work loop.
2018-11-29 22:56:55.251 Status: OpenZWave: using config in: /home/pi/domoticz/Config/
2018-11-29 22:56:55.255 Status: OpenZWave: Starting...
2018-11-29 22:56:55.255 Status: OpenZWave: Version: 1.4-2888-g54682370-dirty
2018-11-29 22:56:55.398 Status: (MAC presence) Entering work loop.
2018-11-29 22:56:55.399 Status: (MAC presence) Initialized version 2.0.0, author 'Xorfor'
2018-11-29 22:56:55.570 Status: OpenZWave: Driver Ready
2018-11-29 22:56:55.656 Status: (NUT UPS monitor) Entering work loop.
2018-11-29 22:56:55.656 Status: (NUT UPS monitor) Initialized version 0.2.1, author 'logread'
2018-11-29 22:58:00.932 Error: Hive heating hardware (5) thread seems to have ended unexpectedly
I have stripped out lots of code to try to find out what was wrong and have narrowed it down to the 3 imports from urllib:

Code: Select all

from urllib.request import Request, urlopen
from urllib.parse import urlencode
from urllib.error import HTTPError
If I comment all of these out then it works, if any of them are uncommented then it fails (N.B. there are no actual urllib calls left in the stripped code). urllib is reported as being urllib3 version 1.9.1 (as installed by apt-get with Python 3.4.2 which is the latest available with apt-get).

I have seen various discussions in this thread about Python 3.4 vs 3.5 but currently there seems to be no problems with either?

However, should I try manually installing Python 3.5.x (and if so which one) or updating urllib or can anyone offer any other suggestions of what may be wrong and what I can try?

Many thanks,

Greg

imcfarla
Posts: 56
Joined: Monday 04 December 2017 14:18
Target OS: Linux
Domoticz version:
Contact:

Re: Read British Gas Hive Heating temperature

Post by imcfarla » Saturday 01 December 2018 23:15

Hello,

I have python 3.5.3 installed but I also compile domoticz myself (to keep up with some of the changes in git)
It is quite easy to compile but you need a bit of space for it (roughly 400Mb)

Having said that you could try using plugin.new.py (rename it to plugin.py in lyour Hive folder). I coded this up using the internal domoticz url routines to see if it would work and it seems to but it was not as simple to code. It has not got the latest changes applied to it but I think it should work.

Regards,

Iain

gnunan
Posts: 4
Joined: Friday 30 November 2018 17:41
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Read British Gas Hive Heating temperature

Post by gnunan » Thursday 06 December 2018 18:26

Hi Iain,

Thanks for your reply and sorry it took so long to get back to you.

I decided that the best way to proceed was to update the Pi to latest Raspbian. Unfortunately that took me down a rabbit hole of upgrade woes. Even ethernet stopped working. By the time I got that going it was clear that most other things had been broken too, including OpenZWave, so I decided to do a clean install but still OpenZWave was broken. It's taken me days to find the problem. Despite all the install guides only saying that a Pi 3 needed it for RazBerries, and a Pi 2 not having bluetooth, it turns out that you need a "dtoverlay=pi3-disable-bt" in /boot/cmdline.txt :cry:

So, I now have the Hive plugin going (thanks) using Python 3.5.3 on the stock Domoticz V4.9700 but I have the following errors in the log on start-up:

Code: Select all

Error: (Hive heating) 'onStart' failed 'UnboundLocalError':'local variable 'foundOutsideDevice' referenced before assignment'.
Error: (Hive heating) ----> Line 655 in /home/pi/domoticz/plugins/Hive/plugin.py, function onStart
Error: (Hive heating) ----> Line 54 in /home/pi/domoticz/plugins/Hive/plugin.py, function onStart
Error: (Hive heating) ----> Line 167 in /home/pi/domoticz/plugins/Hive/plugin.py, function onHeartbeat
and on every heart beat :

Code: Select all

Error: (Hive heating) 'onHeartbeat' failed 'UnboundLocalError':'local variable 'foundOutsideDevice' referenced before assignment'.
Error: (Hive heating) ----> Line 676 in /home/pi/domoticz/plugins/Hive/plugin.py, function onHeartbeat
Error: (Hive heating) ----> Line 167 in /home/pi/domoticz/plugins/Hive/plugin.py, function onHeartbeat
and no Outside temperature device seems to be created.

Also I have a 3 zone Hive heating system but it is only showing me 1 zone and hot water. Is this an unimplemented feature?

Many thanks again,

Greg.

gnunan
Posts: 4
Joined: Friday 30 November 2018 17:41
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Read British Gas Hive Heating temperature

Post by gnunan » Thursday 06 December 2018 19:36

Hi,

For the record I spoke slightly too soon. The above "dtoverlay=pi3-disable-bt" in /boot/cmdline.txt fix worked for (earlier versions of) Jessie, but not for Stretch. For stretch you need to follow the instructions in Detailed installation instructions RazBerry2 and Pi3 even for a Pi 2.

Greg

imcfarla
Posts: 56
Joined: Monday 04 December 2017 14:18
Target OS: Linux
Domoticz version:
Contact:

Re: Read British Gas Hive Heating temperature

Post by imcfarla » Saturday 15 December 2018 1:25

Greg,

More than one thermostat is not currently supported - I think the code is ready to take it but I need to see the device layout.

Can you run the latest version of collect_json.py and post a link to somewhere I can get it? Or put it here:
https://github.com/imcfarla2003/domoticz-hive/issues/2

Can you also try the latest version of the plugin (0.7) which should fix the issue with the outside temperature.

Regards,
Iain

imcfarla
Posts: 56
Joined: Monday 04 December 2017 14:18
Target OS: Linux
Domoticz version:
Contact:

Re: Read British Gas Hive Heating temperature

Post by imcfarla » Saturday 15 December 2018 1:45

All - Version 0.7 of the plugin now supports cool to warm white lights

gnunan
Posts: 4
Joined: Friday 30 November 2018 17:41
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Read British Gas Hive Heating temperature

Post by gnunan » Saturday 15 December 2018 10:23

Hi Iain,

As requested I've left the output that I got from your latest (as at 14/12/18) collect_json.py in https://github.com/imcfarla2003/domoticz-hive/issues/2 for you.

I have 3 heating zones - "Gnd Floor", "Mid Floor" and "Top Floor". The hot water is associated with "Gnd Floor" if that is relevant/helpful.

Many thanks,

Greg.

imcfarla
Posts: 56
Joined: Monday 04 December 2017 14:18
Target OS: Linux
Domoticz version:
Contact:

Re: Read British Gas Hive Heating temperature

Post by imcfarla » Sunday 16 December 2018 2:12

Greg,

Can you try the latest commit please?

Iain

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests