good to hear you got it working, and yes, good point regarding having an error output
in fact, checking the code, it should add an error to the log if it fails to setup the component: _LOGGER.error("Hive API initialization failed")
This is added to the log if the returned device list is none, but maybe we made some coding changes since that error condition was added which means still no devices but also the device list is not none
Yup, just the username and password at the moment - I tried with the devices: but received the error described earlier. So I shouldn’t be using the sensor.py file? But then, how I enable the additional sensors?
Prior to the upgrade I had just the username and password and the hive.py in the custom components folder which worked.
even with the custom sensor component for hive nothing else is needed in the configuration.yaml
adding the sensor.py file will override the built in hive sensors file and add the additional sensors not included in the built in file.
If it is picking up the hive sensor custom component then on restart you should see something like the following early on in your log file:
2019-03-01 14:17:50 WARNING (MainThread) [homeassistant.loader] You are using a custom component for sensor.hive which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
If this is the case then all the extra sensors from the custom component will automatically get loaded at start up. (maybe they will appear in Unused entities and you will need to add them to a tab)
If this is not working after a change of directory structure and file name then I can only think that the follow might help:
Check for the additional hive sensors in Unused entities
Delete all old folder structures from legacy structure design, and restart
Just a note on this and might be something worth checking.
I was having the same issue as this and it turned out to be that the custom component I downloaded was converted to an html file with totally different text even though it was sensors.py, so make sure to get the RAW file and check it
I have been using the hive custom component for ages with no issues. Have just upgraded from HA .87 to .89, downloaded latest hive/sensor.py file and removed all traces of old sensor/hive.py.
When I start HA I see the following error in the HA log:
Error during setup of component hive
Traceback (most recent call last):
File "/usr/src/app/homeassistant/setup.py", line 154, in _async_setup_component
component.setup, hass, processed_config) # type: ignore
AttributeError: module 'custom_components.hive' has no attribute 'setup'
I have just upgraded to HA 89 and it seems all the entities relating to this custom component have disappeared again. Is there a new version coming that will deal with the latest changes in HA.
With the release of 0.89.0 the way Custom Components are handled is very different. AS far as I understand it, no longer are we able to create a custom component for just one aspect of an integration, we have to replace the entire integration.
What this means for the Hive Component / Platform and Custom Component is that the way we have all be using the Custom Component in the passed, including the new directory structure from the 0.88.0 release will no longer work. We cant just override the sensor integration with a custom sensor.py file, we have to override everything, heating, hotwater, lights, switches and the main hive hub code too.
If you do this though, what will happen is that when you upgrade HA to the latest version, if there is any change in Hive code then you will not pick this up automatically, you will need to re-copy the latest files for all Hive files again, then re-copy the custom component.
As far as the code in the Hive custom component goes, I don’t think any change is needed, and I don’t think any code has changed (I will check) in the main Hive code files.
To get this working now, I think you have to copy all the files below, except sensor.py to your custom components directory:
Then copy the custom component sensor.py file from below to your custom components directory:
This hopefully should then work again. but you will need to re-copy the none sensor.py files again each time there is a change to Hive code
I have not had time to test, hopefully Monday I will get some time to do this.
What this does is make all of Hive a custom component, but for all components except sensor will redirect to the built-in Hive code and for the sensor component use the custom component code.
In the future if there are any Home Assistant releases that have updated Hive code, then this will automatically be picked up in the usual way of upgrading Home Assistant.
If there is an update to the custom component code, then the latest code will still need to be downloaded from the above location.
It pretty much the same as before, except we need to copy more files for the initial setup, and for each component there will be a warning in the log to say it is a custom component, which except for sensor, it really isn’t.
2019-03-08 22:42:07 WARNING (MainThread) [homeassistant.loader] You are using a custom component for hive which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-03-08 22:42:09 WARNING (MainThread) [homeassistant.loader] You are using a custom component for hive.sensor which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-03-08 22:42:09 WARNING (MainThread) [homeassistant.loader] You are using a custom component for hive.climate which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-03-08 22:42:09 WARNING (MainThread) [homeassistant.loader] You are using a custom component for hive.light which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
You will get one warning entry for each Hive component you use. I don’t have any switches or hive sensors, so my setup does not try and load those components, so I don’t get those warnings.
please let me know if this does not work for you, and I will take another look.
Regarding point one this not possible yet but we are trying to create a custom boost service for hive to allows this.
With regards to the automation set operation doesn’t support setting temperature. If you use the set temperature service you should be able to achieve what you need see docs
I have managed to build a boost button of sorts by using an input boolean and an automation. I then just added the switch to lovelace. See the code below: