core: Eq3 Smart bluetooth thermostats not working after upgrade from 0.95.4 to 0.96.2

Home Assistant release with the issue: 0.96.2

Last working Home Assistant release (if known): 0.95.4

Operating environment (Hass.io/Docker/Windows/etc.): Hass.io

Component/platform: climate/eq3btsmart

Description of problem: After upgrading from 0.95.4 to 0.96.2 my Eq3 Bluetooth Thermostats gets ‘Unavailable’ and not showing up in Lovelace GUI.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

- platform: eq3btsmart
  devices:
    Termostat Køkken:
      mac: '00:1A:22:06:8B:88'
    Termostat Stue mod vej:
      mac: '00:1A:22:06:8B:D3'
    Termostat Stue mod mark:
      mac: '00:1A:22:06:7D:55' 

Traceback (if applicable):

2019-07-20 09:26:57 ERROR (MainThread) [homeassistant.components.generic_thermostat.climate] Unable to update from sensor: could not convert string to float: 'unavailable'

Additional information:

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 36 (12 by maintainers)

Commits related to this issue

Most upvoted comments

Actually this has something to do with BLE module itself. If eq3 doesn’t update or respond, other BLE devices wont respond either. I experienced this with eq3 and a couple other BLE temp / flower sensors. After reboot they will work fine for an hour to a few days…

I wrote an automation to automatically reboot hass-io when theres no updated values from either BLE sensor after an hour.

Thanks a bunch for debugging @reaper7 & @matthiasfaeth! After digging a bit into the code with the help of your comments, I think I located the problem and created #25905 to fix it, it’d be great if you could test it out 😃.

The mode that is used by available is actually the one coming from the backend library, see https://github.com/rytilahti/python-eq3bt/blob/master/eq3bt/eq3btsmart.py#L138 – the correct solution is to make the comparison to be return self._thermostat.mode >= 0 (as zero stands for closed as seen in here https://github.com/rytilahti/python-eq3bt/blob/master/eq3bt/eq3btsmart.py#L49).

@reaper7, @rytilahti : I can confirm that reading and updating modes and temperatures seems to work well after changing the definition of the available property in climate.py.

Rather than unconditionally returning True I check for _thermostat.mode is not None:

    @property
    def available(self) -> bool:
        """Return if thermostat is available."""
        return (self._thermostat.mode is not None)

I guess the check for _thermostat.mode > 0 no longer makes sense since _thermostat.mode 0 seems to be a valid mode, thus mode 0 shouldn’t mean not available in the new climate version. @rytilahti: please check whether this is a suitable modification.

Btw. I use the current dev branch version of climate.py (commit 4de97abc3aa83188666336ce0a015a5bab75bc8f) together with eq3bt v0.1.11.

@rytilahti - there can be 3 reasons for me:

  1. https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/eq3btsmart/climate.py#L91 does not interpret correctly value from btle: _thermostat.mode which, as I understand @jan-hendrikscholz debug log, returns values:
DEBUG:eq3bt.eq3btsmart:Mode:             manual off dst
  1. _thermostat.mode value initialization during start problem, this value can be changed in two places: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/eq3btsmart/climate.py#L144 https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/eq3btsmart/climate.py#L189

  2. the reason may be a new PRESET_NONE https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/eq3btsmart/climate.py#L16

Generally, as I mentioned in my previous comment: https://github.com/home-assistant/home-assistant/issues/25333#issuecomment-516045127, if available return hardcoded true then everything works correctly for me (change of operating mode, temperature change)

I checked reaction on python-eq3bt 0.1.9 and 0.1.11 and there is no change, the only change as it causes correct operation or not is HASS version, below 0.96 works, equal or above not

@rytilahti, thanks for looking into the issue. Please let me give you the debug logs you were asking for, the first with the default eq3bt v0.1.9, the second with v0.1.11.

With home-assistant:0.97.2 (from docker hub) I get the following debug log output for the default eq3bt v0.1.9:

2019-08-12 16:58:57 DEBUG (SyncWorker_4) [eq3bt.eq3btsmart] Received notification from the device..
2019-08-12 16:58:57 DEBUG (SyncWorker_4) [eq3bt.eq3btsmart] Got status: b'020101000409000000001409281e07'
2019-08-12 16:58:57 DEBUG (SyncWorker_4) [eq3bt.eq3btsmart] Parsed status: Container: 
    cmd = 2
    mode = Container: 
        AUTO = True
        MANUAL = True
    valve = 0
    target_temp = 4.5
    away = b'\x00\x00\x00\x00\x14\t(\x1e\x07' (total 9)
2019-08-12 16:58:57 DEBUG (SyncWorker_4) [eq3bt.eq3btsmart] Valve state: 0
2019-08-12 16:58:57 DEBUG (SyncWorker_4) [eq3bt.eq3btsmart] Mode:        manual off
2019-08-12 16:58:57 DEBUG (SyncWorker_4) [eq3bt.eq3btsmart] Target temp: 4.5
2019-08-12 16:58:57 DEBUG (SyncWorker_4) [eq3bt.eq3btsmart] Away end:    None

With the same docker image except for a modified manifest.json mouted into the container in order to load eq3bt v0.1.11 I get the following debug log output:

2019-08-12 16:48:36 DEBUG (SyncWorker_15) [eq3bt.connection] Connected to 00:1A:22:xx:xx:xx
2019-08-12 16:48:36 DEBUG (SyncWorker_15) [eq3bt.connection] Writing b'0313080c103021' to 1041 with with_response=True
2019-08-12 16:48:36 DEBUG (SyncWorker_15) [eq3bt.connection] Waiting for notifications for 1
2019-08-12 16:48:36 DEBUG (SyncWorker_15) [eq3bt.connection] Got notification from 1057: b'020101000409000000001409281e07'
2019-08-12 16:48:36 DEBUG (SyncWorker_15) [eq3bt.eq3btsmart] Received notification from the device..
2019-08-12 16:48:36 DEBUG (SyncWorker_15) [eq3bt.eq3btsmart] Got status: b'020101000409000000001409281e07'
2019-08-12 16:48:36 DEBUG (SyncWorker_15) [eq3bt.eq3btsmart] Parsed status: Container: 
    cmd = 2
    mode = Container: 
        AUTO = True
        MANUAL = True
    valve = 0
    target_temp = 4.5
    away = b'\x00\x00\x00\x00' (total 4)
    presets = Container: 
        window_open_temp = 10.0
        window_open_time = 0:45:00
        comfort_temp = 20.0
        eco_temp = 15.0
        offset = 0.0
2019-08-12 16:48:36 DEBUG (SyncWorker_15) [eq3bt.eq3btsmart] Valve state:      0
2019-08-12 16:48:36 DEBUG (SyncWorker_15) [eq3bt.eq3btsmart] Mode:             manual off
2019-08-12 16:48:36 DEBUG (SyncWorker_15) [eq3bt.eq3btsmart] Target temp:      4.5
2019-08-12 16:48:36 DEBUG (SyncWorker_15) [eq3bt.eq3btsmart] Away end:         None
2019-08-12 16:48:36 DEBUG (SyncWorker_15) [eq3bt.eq3btsmart] Window open temp: 10.0
2019-08-12 16:48:36 DEBUG (SyncWorker_15) [eq3bt.eq3btsmart] Window open time: 0:45:00
2019-08-12 16:48:36 DEBUG (SyncWorker_15) [eq3bt.eq3btsmart] Comfort temp:     20.0
2019-08-12 16:48:36 DEBUG (SyncWorker_15) [eq3bt.eq3btsmart] Eco temp:         15.0
2019-08-12 16:48:36 DEBUG (SyncWorker_15) [eq3bt.eq3btsmart] Temp offset:      0.0

All the readings are correct and exactly the current settings of my eq3 thermostat.

The ‘state’ in home-assistant 0.97.2 is ‘unavailable’ nevertheless. The last version of home-assistant working with eq3bt was 0.95.4.

Upgrade python-eq3bt in eq3btsmart/manifest.json to a newer Version should fix it?

Inside docker homeassistant/home-assistant:0.97.0 I executed pip install --upgrade python-eq3bt which upgraded from 0.1.9 to 0.1.11. eq3cli ran without problems in 0.1.11 but didn’t in 0.1.9. An upgrade seems to be the solution.

However, after a restart of home-assistant the version of python-eq3bt is back to 0.1.9 and it won’t work.

Thanks axel0073 for pointing this upgrade out as the likely solution.

Upgrade python-eq3bt in eq3btsmart/manifest.json to a newer Version should fix it?

New Climate 1.0 requires some changes in submodules: https://github.com/home-assistant/home-assistant/pull/23899

maybe eq3btsmart also requires corrections?

I made a dirty change in: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/eq3btsmart/climate.py#L91

in propery “available” I always

return True

instead

return self._thermostat.mode > 0

and it looks like I can read the temperature, there is no message unavailable anymore

  • Still not working in 0.96.5.
  • With logger “homeassistant.components.climate: debug” this is all that is logged: INFO (MainThread) [homeassistant.components.climate] Setting up climate.eq3btsmart
  • State is “unavailable”, “supported_features: 17”
  • Nothing shows up in lovelace UI
  • Same thing worked in 0.95.4

@HomeBro Sadly not, this is just the output of eq3cli. HA changed its way of handling these values, I guess 😦 @MartinHjelmare Thank u for the formatting!

If you need output of eq3cli, I can help 😃

eq3cli --debug --mac='00:1A:22:xx:xx:xx'
DEBUG:eq3bt.eq3btsmart:Querying the device..
DEBUG:eq3bt.connection:Trying to connect to 00:1A:22:xx:xx:x
DEBUG:eq3bt.connection:Connected to 00:1A:22:xx:xx:xx
DEBUG:eq3bt.connection:Writing b'03130715172229' to 1041 with with_response=True
DEBUG:eq3bt.connection:Waiting for notifications for 1
DEBUG:eq3bt.connection:Got notification from 1057: b'0201090004090000000018032a2207'
DEBUG:eq3bt.eq3btsmart:Received notification from the device..
DEBUG:eq3bt.eq3btsmart:Got status: b'0201090004090000000018032a2207'
DEBUG:eq3bt.eq3btsmart:Parsed status: Container:
    cmd = 2
    mode = Container:
        AUTO = True
        MANUAL = True
        DST = True
    valve = 0
    target_temp = 4.5
    away = b'\x00\x00\x00\x00' (total 4)
    presets = Container:
        window_open_temp = 12.0
        window_open_time = 0:15:00
        comfort_temp = 21.0
        eco_temp = 17.0
        offset = 0.0
DEBUG:eq3bt.eq3btsmart:Valve state:      0
DEBUG:eq3bt.eq3btsmart:Mode:             manual off dst
DEBUG:eq3bt.eq3btsmart:Target temp:      4.5
DEBUG:eq3bt.eq3btsmart:Away end:         None
DEBUG:eq3bt.eq3btsmart:Window open temp: 12.0
DEBUG:eq3bt.eq3btsmart:Window open time: 0:15:00
DEBUG:eq3bt.eq3btsmart:Comfort temp:     21.0
DEBUG:eq3bt.eq3btsmart:Eco temp:         17.0
DEBUG:eq3bt.eq3btsmart:Temp offset:      0.0
[00:1A:22:xx:xx:xx] Target 4.5 (mode: manual off dst, away: no)
Locked: False
Batter low: False
Window open: False
Window open temp: 12.0
Window open time: 0:15:00
Boost: False
Current target temp: 4.5
Current comfort temp: 21.0
Current eco temp: 17.0
Current temp offset: 0.0
Current mode: manual off dst
Valve: 0