Climate ModBus don't display nothing

Hi all,
i set on configuration.yaml a new climate entity but it not appear on dashboard. I enable platform demo too and it apper

configuration.yaml
climate:
  - platform: demo
  
  - platform: modbus
    name: kitchen01
    slave: 11
    target_temp_register: 8
    current_temp_register: 2
    count: 1
    precision: 1

Looking on log i see this error:

NotImplementedError
    raise NotImplementedError
  File "/usr/lib/python3.6/site-packages/homeassistant/components/climate/__init__.py", line 559, in temperature_unit
    self.hass, self.current_temperature, self.temperature_unit,
  File "/usr/lib/python3.6/site-packages/homeassistant/components/climate/__init__.py", line 486, in state_attributes
    attr = self.state_attributes or {}
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 222, in async_update_ha_state
Traceback (most recent call last):

Platform: hassio with latest ha 0.71.0

here a copy of my climate control

  - platform: generic_thermostat
    entity_id: office_temp
    name: "Office Temperature"
    heater: switch.office_fan
    target_sensor: sensor.office_temperature
    min_temp: 15
    max_temp: 30
    ac_mode: true
    target_temp: 22
    initial_operation_mode: "auto"
    away_temp: 16

works a dream

image

is it a modbus climate?
Shall you give the code of modbus part?

Really interested to get this going. Anyone using it?

Hi all,
i open the issue again after a summer of doing other things

The issue is if I use climate modbus , it doens’t work due an errore in the code, i think
My configuration is over hassio latest release:

climate:
-platform: modbus
name: Kitchen Climate
slave: 11
target_temp_register: 003
current_temp_register: 002

The error is:

2018-10-27 15:30:04 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py”, line 239, in async_update_ha_state
attr = self.state_attributes or {}
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/climate/init.py”, line 230, in state_attributes
self.hass, self.current_temperature, self.temperature_unit,
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/climate/init.py”, line 298, in temperature_unit
raise NotImplementedError
NotImplementedError

Looking in the code, i think that modbus.py need a variable temperature_unit but i don’t know how to set

Any hints?
Thanks

Ok i fixed the code and now i’m able to read and write value. I also add scale support

scale
(float)(Optional)Scale factor (output = scale * value + offset).
Default value: 1

My only issue is that the target temp is displayed as Unknown

2018-11-02_19h13_49

here the code:

Hi,

I have just encounter same issue as well. Have you got the time to refactor the changes back to HA?

Hi, i’ll do on september and i’ll try to commit on ha

1 Like

if you want to try,

Thanks. It doesn’t work for me as the climate platform cannot be loaded. Looks like init.py needs to be modified to take 2 more arguments (unit_of_measurement and precision). WIll look into it when I have time

Traceback (most recent call last):
  File "/usr/src/app/homeassistant/helpers/entity_platform.py", line 149, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/modbus/climate.py", line 76, in setup_platform
    scale
TypeError: __init__() takes 9 positional arguments but 11 were given

ok, this week i’ll check

I have fixed the issues and added more configuration options
https://github.com/adamchengtkc/home-assistant-dev

Will try to make a PR when I have time