Do the custom_components directories reside in the correct place under /CONFIG ?
Setup failed for python_script: Integration failed to initialize.
21:57:43 – (ERROR) setup.py
Folder python_scripts not found in configuration folder
21:57:43 – (WARNING) python_script
I get also this error message, but do not understand where the error cause could be. I use this component for the custom calculations i make in multiply.py
"Platform error sensor.custom_calculations - Integration 'custom_calculations' not found."
Init.py:
from . import custom_component
from . import sensor
file custom_component:
import homeassistant.components.sensor
import homeassistant.helpers.config_validation as cv
import multiply
class MyCalculationsSensor(homeassistant.components.sensor.Sensor)
def __init__(self, hass, name):
self._name = name
self._state = None
self.update()
def update(self):
self._state = multiply.calculate_result()
@property
def name(self):
return self._name
@property
def state(self):
return self._state
def register(hass):
hass.components.sensor.async_register_entity_service(
'custom_calculations', 'custom_calculations', 'update')
return True
file sensor.py:
import custom_component
class MyCalculationsSensor(custom_component.MyCalculationsSensor):
def __init__(self, hass, name):
self._name = name
self._state = None
self.update()
def update(self):
self._state = multiply.calculate_result()
@property
def name(self):
return self._name
@property
def state(self):
return self._state
and in configuration.yaml the following sensor:
sensor:
- platform: custom_calculations
name: calculated_result