Hi,
I’m not using any xiaomi bridge. The heater is connected to Wi-Fi and that is how HA reaches it (though cloud).
Hi,
I’m not using any xiaomi bridge. The heater is connected to Wi-Fi and that is how HA reaches it (though cloud).
Can you Please share how you make the template sensors. I can not find out how to do. I make a copy off the template sensors but nothing happens
Where do you get the temperature and termostat sensor from
You have the configuration I used here:
Thank you @sergio_pt for your work!
Does someone started to look at a local way of controlling those heater? (*I am not a big fan of Clouds…)
I hope @sergio_pt doesn’t mind, but I have to share that I recently discovered a different custom component which ALSO supports this heater and with more control over it - it’s called Xiaomi MIoT for Home Assistant.
With this custom component you can setup the device to work with IP + Token (not via cloud) and also control these switches.
Additionally this component is not specific to the heater and allows to integrate a considerable amount of other Xiaomi devices (some not supported by python-miio library and Xiaomi Miio core integration).
Only awkward thing is that this integration is still a bit garbled with Chinese characters here and there, but my usage experience has been quite positive until now.
I don’t mind at all this for me was always temporary until someone came along with a real integration
Can you share how you configured it?
Quick note: both my code and that integration use the same code, so they are both local.
In Lovelace, this is basically its look:
I also created a new climate entity with the switch to turn heater on/off and a separate external temperature sensor. The UI integration also has this option, but although I specified the external temperature sensor in it, the integration-provided climate entity was still using the heater’s integrated temperature sensor. If this gets fixed in a future release, I will be able to skip this additional climate entity.
In terms of UI integration, I have the below entities (temperature sensor and child lock control can be chosen from the UI integration options):
I also had to slightly change the mapping and params in the UI integration config (for details, check upper comments in below YAML), to expose the alarm indicator as entity attribute.
From a HA config perspective, here’s the relevant YAML:
### To make sure that Xiaomi MIoT custom component can fetch all properties needed in HA, changed the mapping/params (idea taken from https://github.com/ha0y/xiaomi_miot_raw/issues/120)
### -- Aquecedor Quarto -- (alarm indicator added)
#Mapping:
#{"heater":{"switch_status":{"siid":2,"piid":1},"fault":{"siid":2,"piid":2},"target_temperature":{"siid":2,"piid":5}},"environment":{"temperature":{"siid":4,"piid":7}},"physical_controls_locked":{"physical_controls_locked":{"siid":5,"piid":1}},"indicator_light":{"brightness":{"siid":7,"piid":3}},"alarm":{"indicator":{"siid":6,"piid":1}}}
#
#Params:
#{"heater":{"switch_status":{"power_on":true,"power_off":false},"target_temperature":{"value_range":[18,28,1]},"main":true,"current_temp_source":"sensor.temperature_158d0001571539"},"environment":{"temperature":{"access":5,"format":"float","unit":"celsius","value_range":[-30,100,0.1]}},"physical_controls_locked":{"enabled":true},"indicator_light":{"brightness":{"value_range":[0,1,1]},"enabled":false},"alarm":{"indicator":{"enabled":true}}}
####################################################
# #
# Switch #
# #
####################################################
switch:
- platform: template
switches:
aquecedor_quarto:
friendly_name: "Aquecedor Quarto"
value_template: "{{ is_state_attr('climate.aquecedor_quarto', 'heater_switch_status', true) }}"
availability_template: "{{ not ( is_state('climate.aquecedor_quarto', 'unavailable') ) }}"
icon_template: "{{ 'mdi:radiator' }}"
turn_on:
service: script.turn_on_aquecedor_quarto
turn_off:
service: script.turn_off_aquecedor_quarto
- platform: template
switches:
luzes_aquecedor_quarto:
friendly_name: "Luzes Aquecedor"
value_template: "{{ is_state_attr('climate.aquecedor_quarto', 'indicator__brightness', 0) }}"
availability_template: "{{ not ( is_state('climate.aquecedor_quarto', 'unavailable') ) }}"
icon_template: "{{ 'mdi:gesture-tap-button' }}"
turn_on:
service: script.turn_on_luzes_aquecedor_quarto
turn_off:
service: script.turn_off_luzes_aquecedor_quarto
- platform: template
switches:
som_aquecedor_quarto:
friendly_name: "Som Aquecedor"
value_template: "{{ is_state_attr('climate.aquecedor_quarto', 'alarm_indicator', true) }}"
availability_template: "{{ not ( is_state('climate.aquecedor_quarto', 'unavailable') ) }}"
icon_template: "{{ 'mdi:alarm-bell' }}"
turn_on:
service: script.turn_on_som_aquecedor_quarto
turn_off:
service: script.turn_off_som_aquecedor_quarto
####################################################
# #
# Scripts #
# #
####################################################
script:
### Turn on Aquecedor Quarto ###
turn_on_aquecedor_quarto:
alias: "Turn on Aquecedor Quarto"
sequence:
- service: xiaomi_miot_raw.set_miot_property
data:
entity_id: climate.aquecedor_quarto
siid: 2
piid: 1
value: true
### Turn off Aquecedor Quarto ###
turn_off_aquecedor_quarto:
alias: "Turn off Aquecedor Quarto"
sequence:
- service: xiaomi_miot_raw.set_miot_property
data:
entity_id: climate.aquecedor_quarto
siid: 2
piid: 1
value: false
### Turn on Luzes Aquecedor Quarto ###
turn_on_luzes_aquecedor_quarto:
alias: "Turn on Luzes Aquecedor Quarto"
sequence:
- service: xiaomi_miot_raw.set_miot_property
data:
entity_id: climate.aquecedor_quarto
siid: 7
piid: 3
value: 0
### Turn off Luzes Aquecedor Quarto ###
turn_off_luzes_aquecedor_quarto:
alias: "Turn off Luzes Aquecedor Quarto"
sequence:
- service: xiaomi_miot_raw.set_miot_property
data:
entity_id: climate.aquecedor_quarto
siid: 7
piid: 3
value: 1
### Turn on Som Aquecedor Quarto ###
turn_on_som_aquecedor_quarto:
alias: "Turn on Som Aquecedor Quarto"
sequence:
- service: xiaomi_miot_raw.set_miot_property
data:
entity_id: climate.aquecedor_quarto
siid: 6
piid: 1
value: true
### Turn off Som Aquecedor Quarto ###
turn_off_som_aquecedor_quarto:
alias: "Turn off Som Aquecedor Quarto"
sequence:
- service: xiaomi_miot_raw.set_miot_property
data:
entity_id: climate.aquecedor_quarto
siid: 6
piid: 1
value: false
Although some entity naming is in PT, I think it is understandable, but feel free to ask any questions. Scripts could also be reduced to a single one with parameters, I haven’t spent time on it yet.
Hope this helps.
Wonderful @sergio_pt! If this is local, this is great.
Now that I’m thinking about that, I’ve indeed didn’t put anything related to my Cloud account in the configuration.
The reason I thought that this was using the cloud is the Lag time (1-2 seconds) from the On-Off and status update.
Thanks again for your work
Good evening, @sergio_pt!
как запустить обогреватель zhimi.heater.za1?
Installed version 118.5, but the heater did not appear = (
Hi,
Was it working before for you?
I don’t have that model só it’s hard for me to debug.
Is there any error in logs?
раньше работал на другом компоненте, который сейчас не поддерживается GitHub - bazuchan/miheater-home-assistant: Home-Assistant custom component for SmartMi Zhimi Heaters
Регистратор: custom_components.miheater.climate Источник: custom_components/miheater/climate.py:80 Интеграция: miheater ([документация] (GitHub - ee02217/homeassistant-mi-heater: Home Assistant integration for MiHeaters.)) Первый происхождений: 07:56:37 (1 вхождения) Последняя авторизация: 07:56:37 обнаружено zhimi.heater.za1 2.1.4 esp32
Logger: homeassistant.components.climate
Source: custom_components/miheater/climate.py:204
Integration: Климат (documentation, issues)
First occurred: 07:56:38 (1 occurrences)
Last logged: 07:56:38
Error while setting up miheater platform for climate
Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 249, in _async_setup_platform await asyncio.shield(task) File “/usr/local/lib/python3.9/concurrent/futures/thread.py”, line 52, in run result = self.fn(*self.args, **self.kwargs) File “/config/custom_components/miheater/climate.py”, line 84, in setup_platform miHeater = MiHeater(device, name, model, unique_id, hass) File “/config/custom_components/miheater/climate.py”, line 122, in init self.getAttrData() File “/config/custom_components/miheater/climate.py”, line 204, in getAttrData data[‘power’] = power[0][“value”] KeyError: ‘value’
Wow. I have no idea what that might be.
What is your device model and configs?
Tested environment: HASS 0.118.5
Home Assistant 2021.11.5
zhimi.heater.za1
the heater system detects but does not want to do anything with it
I am also using this integration with the zhimi.heater.mc2 model. It works but there are a lot (a lot) of erros in the log every time.
Would be any way to help improving the integration, or maybe is there any other integration to solve this problems?
I dont have that heater version, so it’s very hard for me to try to fix something.
But my code is public, so anyone that wishes to contribute is welcome to do so
Unfortunately, I can’t program = (
So it’s hard for me to figure out the code
Hi, where I should put this templates to have this sensors?
Hi!
I have these in sensor.yaml file