sensor.ssh icon indicating copy to clipboard operation
sensor.ssh copied to clipboard

error in new version

Open ppnacho opened this issue 4 years ago • 14 comments

Este error se originó a partir de una integración personalizada.

Logger: homeassistant.config Source: custom_components/ssh/sensor.py:18 Integration: ssh (documentation) First occurred: 11:25:16 (5 occurrences) Last logged: 11:25:16

Platform error: sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config.py", line 853, in async_process_component_config platform = p_integration.get_platform(domain) File "/usr/src/homeassistant/homeassistant/loader.py", line 498, in get_platform cache[full_name] = self._import_platform(platform_name) File "/usr/src/homeassistant/homeassistant/loader.py", line 503, in _import_platform return importlib.import_module(f"{self.pkg_path}.{platform_name}") File "/usr/local/lib/python3.8/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1014, in _gcd_import File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "", line 783, in exec_module File "", line 219, in _call_with_frames_removed File "/config/custom_components/ssh/sensor.py", line 18, in from homeassistant.const import ( ImportError: cannot import name 'CONF_SCAN' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py)

ppnacho avatar Jun 04 '21 09:06 ppnacho

CONF_SCAN don't defined in sensor.py. When I define this variable I have an error and if the variable don't defined there are another errors.

ppnacho avatar Jun 04 '21 09:06 ppnacho

I had to remove this component to fix HA, many sensors weren't available. There is certainly something wrong, most likely with CONF_SCAN.

janjbrand avatar Jun 04 '21 18:06 janjbrand

Same thing, had to remove the component to get ALL sensors on my HA to run again.

jaydenthorup avatar Jun 06 '21 04:06 jaydenthorup

Hi, same trouble. core-2021.6.2 I had to remove all sensors - platform: ssh from configuration to get HA working back.

klona avatar Jun 06 '21 09:06 klona

I have change to the previous version and the sensors work OK.

ppnacho avatar Jun 06 '21 10:06 ppnacho

Same issue here!!

edersong avatar Jun 06 '21 18:06 edersong

Hi, same trouble. core-2021.6.2 I had to remove all sensors - platform: ssh from configuration to get HA working back.

I did the same and HA is working. If I un-comment and check configuration, it will just sit and spin and never complete the configuration check.

jaydenthorup avatar Jun 07 '21 22:06 jaydenthorup

Same issue here, it completely breaks HA. How to go back to previous version? I don't see any other version than 1.14 neither in HACS nor here on Github :-(

johny-mnemonic avatar Jun 08 '21 00:06 johny-mnemonic

I fixed mine for now. Defined SCAN_INTERVAL just below "DOMAIN = 'sensor'", changed self.scan to line below and commented out the # shown below in "/config/custom_components/ssh/sensor.py" Might be a bit hacky, but it worked for me.

DOMAIN = 'sensor'

SCAN_INTERVAL = timedelta(seconds=30)

        self._scan = config.get(MIN_TIME_BETWEEN_UPDATES)


#    vol.Optional(CONF_SCAN, default=MIN_TIME_BETWEEN_UPDATES): cv.string,

#    @Throttle(self._scan)

I also had to define unit_of_measure as blank

  - platform: ssh
    host: myhostaddy
    name: 'my variable name'
    username: myuser
    password: mypassword
    command: "/home/user/whatsmyip.sh"
    value_template: >-
        {%- set line = value.split("\r\n") -%}
        {{ line[1] }}
    unit_of_measurement: ""

jaydenthorup avatar Jun 08 '21 02:06 jaydenthorup

@jchasey Would you be please able to tag commit df821269e0a158e2c9f430496f97f4f19608b9d5 as some older version (i.e. 1.13) so that people can easily downgrade till this issue gets fixed? Thanks a lot!

johny-mnemonic avatar Jun 08 '21 08:06 johny-mnemonic

Tagged version to 1.13

jchasey avatar Jun 09 '21 09:06 jchasey

@jchasey Thanks! Unfortunately it doesn't seems to be that simple:-( To make it working with the latest HA we need https://github.com/custom-components/sensor.ssh/pull/15, because without version in the manifest, the extension is ignored. But as the breaking change was merged before it in https://github.com/custom-components/sensor.ssh/pull/9, we need proper fix or revert of that breaking change...

johny-mnemonic avatar Jun 09 '21 12:06 johny-mnemonic

New release with reversion of the scan interval changes

jchasey avatar Jun 09 '21 13:06 jchasey

It works! Thanks a million!

johny-mnemonic avatar Jun 09 '21 13:06 johny-mnemonic