I have bought a new one because after i add the Itho fan Device the damn thing seems to get bricked for some reason. I can not get it to work i can only flash it with the Node MCU custom firmware. ESPeasy for some reason just wont work. Does anyone has a clue because i just killed my second ESP8266 by following this manual.
Just pushed a new yaml configuration for HA to match the fan behaviour to the new fan changes that are introduced in HA Core 2021.3.1
https://github.com/jodur/ESPHOME-ITHO
Thank you very much, but still struggling to get it even starting…
Keep trying but I keep running in circles. Hopefully one day I will try again
Hi All,
Does someone know how to implement the new FAN MQTT topics into the automation with the existing ESP home image? Or must the plugin in ESP rebuild to handle the new FAN MQTT topics?
Breaking change for last HA version 2021.4
The [fan entity model](https://developers.home-assistant.io/docs/core/entity/fan/) has been changed. This impacts the way the MQTT Fan supports speeds and the following configuration options are deprecated and will be removed in Home Assistant Core 2021.7.0:
* `speed_command_topic`
* `speed_state_topic`
* `state_value_template`
* `speed_list`
Additionally,`preset_modes` and `percentage` are added to replace the legacy model supporting only three speeds `low`, `medium` and `high`. Therefore, `command templates` for `state`, `oscillation`, `preset_mode` and`percentage` are introduced.
Please. if you find a solution for the deprecated parts, share it here
This is what i’ve got so far:
- platform: mqtt
name: Ecofan
command_topic: "ITHO/fan/cmd"
state_topic: "ITHO/fan/State"
state_value_template: "{% if value|float==0 %}State 0{% endif %}{% if value|float >0 %}State 1{% endif %}"
payload_off: "State 0"
payload_on: "State 1"
preset_modes:
- 'low'
- 'medium'
- 'high'
- 'full'
preset_mode_command_topic: "ITHO/fan/cmd"
preset_mode_command_template: >
{% if value == 'low' %}
State 1
{% elif value == 'medium' %}
State 2
{% elif value == 'high' %}
State 3
{% elif value == 'full' %}
State 4
{% else %}
State 0
{% endif %}
preset_mode_state_topic: "ITHO/fan/State"
preset_mode_value_template: >
{% if value_json.fan == low %}
State 1
{% elif value_json.fan == medium %}
State 2
{% elif value_json.fan == high %}
State 3
{% elif value_json.fan == full %}
State 4
{% else %}
State 0
{% endif %}
Open for improvement/additions.
The speed attribute is not showing so something is still not quiet right…
some progres…
changed the preset_mode_template
preset_mode_value_template: >
{% if value == '1' %}
low
{% elif value == '2' %}
medium
{% elif value == '3' %}
high
{% elif value == '4' %}
full
{% else %}
off
{% endif %}
Standby is still something to work on…
Which is solved by adding ‘off’ to the preset modes
preset_modes:
- 'off'
- 'low'
- 'medium'
- 'high'
- 'full'
So, the code that’s working for me is:
- platform: mqtt
name: Ecofan
command_topic: "ITHO/fan/cmd"
state_topic: "ITHO/fan/State"
state_value_template: "{% if value|float==0 %}State 0{% endif %}{% if value|float >0 %}State 1{% endif %}"
payload_off: "State 0"
payload_on: "State 1"
preset_modes:
- 'off'
- 'low'
- 'medium'
- 'high'
- 'full'
preset_mode_command_topic: "ITHO/fan/cmd"
preset_mode_command_template: >
{% if value == 'low' %}
State 1
{% elif value == 'medium' %}
State 2
{% elif value == 'high' %}
State 3
{% elif value == 'full' %}
State 4
{% else %}
State 0
{% endif %}
preset_mode_state_topic: "ITHO/fan/State"
preset_mode_value_template: >
{% if value == '1' %}
low
{% elif value == '2' %}
medium
{% elif value == '3' %}
high
{% elif value == '4' %}
full
{% else %}
off
{% endif %}
A bonus to all this is the ‘full’ mode.
And a bit of fiddeling with the custom button-card gets you this:
Can you share your custom card config?
sure.
The button_card_templates:
button_card_templates:
fan-icon-settings:
show_icon: true
show_label: false
show_name: false
styles:
card:
- height: 36px
- width: 50px
grid:
- grid-template-areas: '"i"'
- grid-template-columnns: auto
icon:
- height: 26px
- width: 26px
state:
- value: 'on'
spin: true
fan-name-settings:
show_icon: false
show_label: false
show_name: true
styles:
card:
- height: 36px
grid:
- grid-template-areas: '"n"'
- grid-template-columnns: auto
name:
- justify-self: start
fan-speed-settings:
show_icon: false
show_name: true
styles:
card:
- height: 35px
- font-size: 12px
- width: 35px
- border: 1px solid white
- border-radius: 5px
- text-transform: uppercase
- background-color: 'var(ha-card-background)'
icon:
- icon-size: 14px
vertical-divider-grey:
color_type: blank-card
styles:
card:
- width: 3px
- color: 'var(--primary-color)'
horizontal-divider-grey:
color_type: blank-card
styles:
card:
- height: 3px
- background-color: 'var(ha-card-background)
And the card:
- type: custom:vertical-stack-in-card
# title: EcoFan
cards:
- type: custom:button-card
template: horizontal-divider-grey
- type: horizontal-stack
cards:
- type: custom:button-card
template: fan-icon-settings
entity: fan.ecofan
tap_action:
action: call-service
service: fan.toggle
service_data:
entity_id: fan.ecofan
- type: custom:button-card
template: vertical-divider-grey
- type: custom:button-card
template: fan-name-settings
entity: fan.ecofan
name: Fan
tap_action:
action: call-service
service: fan.toggle
service_data:
entity_id: fan.ecofan
- type: custom:button-card # Low Button
template: fan-speed-settings
name: low
tap_action:
action: call-service
service: fan.set_preset_mode
service_data:
entity_id: fan.ecofan
preset_mode: low
styles:
card:
- background-color: >
[[[
if ((states['fan.ecofan'].attributes.preset_mode === 'low') && (states['fan.ecofan'].state === 'on'))
return "#2980b9";
return "grey";
]]]
- type: custom:button-card
template: vertical-divider-grey
- type: custom:button-card # Med Button
template: fan-speed-settings
name: med
tap_action:
action: call-service
service: fan.set_preset_mode
service_data:
entity_id: fan.ecofan
preset_mode: medium
styles:
card:
- background-color: >
[[[
if ((states['fan.ecofan'].attributes.preset_mode === 'medium') && (states['fan.ecofan'].state === 'on'))
return "#2980b9";
return "grey";
]]]
- type: custom:button-card
template: vertical-divider-grey
- type: custom:button-card # High Button
template: fan-speed-settings
name: high
tap_action:
action: call-service
service: fan.set_preset_mode
service_data:
entity_id: fan.ecofan
preset_mode: high
styles:
card:
- background-color: >
[[[
if ((states['fan.ecofan'].attributes.preset_mode === 'high') && (states['fan.ecofan'].state === 'on'))
return "#2980b9";
return "grey";
]]]
- type: custom:button-card
template: vertical-divider-grey
- type: custom:button-card # Full Button
template: fan-speed-settings
name: full
tap_action:
action: call-service
service: fan.set_preset_mode
service_data:
entity_id: fan.ecofan
preset_mode: full
styles:
card:
- background-color: >
[[[
if ((states['fan.ecofan'].attributes.preset_mode === 'full') && (states['fan.ecofan'].state === 'on'))
return "#2980b9";
return "grey";
]]]
- type: custom:button-card
template: vertical-divider-grey
- type: custom:button-card # Off Button
template: fan-speed-settings
name: 'off'
# color: white
tap_action:
action: call-service
service: fan.turn_off
service_data:
entity_id: fan.ecofan
styles:
card:
- background-color: >
[[[
if (states['fan.ecofan'].state === 'off')
return "#2980b9";
return "grey";
]]]
- type: custom:button-card
template: vertical-divider-grey
- type: custom:button-card
template: horizontal-divider-grey
Don’t forget the custom:vertical-stack-in-card.
Hi Cadster. im struggling to get it back to work. my previous mqtt worked fine. now it stops.
Im trying to get your code into my itho.yaml. but without success. Can you share what i need to recode?
If i copy your code into itho.yaml i get a error code.
Thanks
stangen question did you still use your:
command_topic: "ITHO/fan/cmd"
state_topic: "ITHO/fan/State"
preset_mode_command_topic: "ITHO/fan/cmd" # same as command_topic
preset_mode_state_topic: "ITHO/fan/State" # same as state_topic
or did you copy one at one … if your topics are different then you need to change that back to old line.
that was my fault in first place…
Good morning. thanks for the reply. I changed the topics and now i am on the good way i think.
What i have now:
sensor:
- platform: mqtt
name: Tijd
state_topic: "ITHO/Fan/Timer"
value_template: "{{value}}"
unit_of_measurement: 's'
- platform: mqtt
name : Snelheid
state_topic: "ITHO/Fan/State"
value_template: >
{% if value|float==0 %}Standby{% endif %}
{% if value|float==1 %}Laag{% endif %}
{% if value|float==2 %}Medium{% endif %}
{% if value|float==3 %}Hoog{% endif %}
{% if value|float==4 %}Full{% endif %}
{% if value|float>=11 %}Hoog(T){% endif %}
fan:
- platform: mqtt
command_topic: "ITHO/Fan/cmd"
state_topic : "ITHO/Fan/State"
state_value_template: "{% if value|float==0 %}State 0{% endif %}{% if value|float >0 %}State 1{% endif %}"
payload_off: "State 0"
payload_on: "State 1"
preset_modes:
- 'off'
- 'low'
- 'medium'
- 'high'
- 'full'
preset_mode_command_topic: "ITHO/Fan/cmd"
preset_mode_command_template: >
{% if value == 'low' %}
State 1
{% elif value == 'medium' %}
State 2
{% elif value == 'high' %}
State 3
{% elif value == 'full' %}
State 4
{% else %}
State 0
{% endif %}
preset_mode_state_topic: "ITHO/fan/State"
preset_mode_value_template: >
{% if value == '1' %}
low
{% elif value == '2' %}
medium
{% elif value == '3' %}
high
{% elif value == '4' %}
full
{% else %}
off
{% endif %}
payload_low_speed: "State 1"
payload_medium_speed: "State 2"
payload_high_speed: "State 3"
optimistic: "true"
name: Afzuiging badkamer
speeds:
- low
- medium
- high
group:
Ventilator:
entities:
- fan.afzuiging_badkamer
- sensor.Snelheid
- sensor.Tijd
From this point i have my working HA again. But only i can change the fan speeds etc with the wireless remote from the ecofan it self. I tried to pair the ESP again with the join command but it doesnt connect anymore. Also not when i use the leave command 9999.
So from this point im almost there. Maybe someone has any idea so we can sort this out
here is my setup
sensor:
- platform: mqtt
name: "ITHO Speed"
state_topic: "Servers/itho/fan/state"
icon: mdi:fan
value_template: >-
{% if value|float == 0 %}
Standby
{% elif value|float == 1 %}
Low
{% elif value|float == 2 %}
Medium
{% elif value|float == 3 %}
High
{% elif value|float == 4 %}
Full
{% else %}
High(Timer)
{% endif %}
- platform: mqtt
name: "ITHO Tijd"
icon: mdi:remote
state_topic: "Servers/itho/fan/timer"
value_template: "{{ value }}"
unit_of_measurement: "s"
- platform: mqtt
name: "ITHO Remote"
state_topic: "Servers/itho/fan/lastidindex"
icon: mdi:fan
value_template: >-
{% if value|float == 1 %}
Kitchen
{% elif value|float == 2 %}
Bathroom
{% else %}
none
{% endif %}
- platform: mqtt
name: "ITHO Tijd"
icon: mdi:av-timer
state_topic: "Servers/itho/fan/timer"
value_template: "{{ value }}"
unit_of_measurement: "s"
fan:
- platform: mqtt
name: "Afzuiging badkamer"
command_topic: "Servers/itho/fan/cmd" # "ITHO/fan/cmd"
state_topic: "Servers/itho/fan/state" # "ITHO/fan/State"
state_value_template: "{% if value|float==0 %}State 0{% endif %}{% if value|float >0 %}State 1{% endif %}"
payload_off: "State 0"
payload_on: "State 1"
preset_modes:
- "off"
- "low"
- "medium"
- "high"
preset_mode_command_topic: "Servers/itho/fan/cmd" # "ITHO/fan/cmd"
preset_mode_command_template: >
{% if value == 'low' %}
State 1
{% elif value == 'medium' %}
State 2
{% elif value == 'high' %}
State 3
{% else %}
State 0
{% endif %}
preset_mode_state_topic: "Servers/itho/fan/state"
preset_mode_value_template: >
{% if value == '1' %}
low
{% elif value == '2' %}
medium
{% elif value == '3' %}
high
{% else %}
off
{% endif %}
Thanks for sharing. i have made some changes on my code and now its working ( after powerless making of the ESP module ). so now i can also change speeds from HA. And thanks for the addon in remote ( now i can see which remote i am using or control by HA ).
One thing i want to add is the ‘remote’ option automatic. This option makes the Itho go higher based on Rh. This option enables the medium. I think this is missing from the code of @jodur ?
I hope someone can help me. I’m busy trying to use the version off @jodur in ESPHOME. But i can’t get a join with my Itho box. Also don’t see any error in the logs.
Only thing i did see, when i do a OTA, i get a error (Error1) with uploading the bin file. And when i disconnect pin D1, i can upload.
I have a other nodemcu with cc1101, with espeasy that is working fine with my ithobox. But i would have all my boards in ESPHOME.
i have ESPHOME installed. but since i had some OTA issues and errors i just did the ITHO outside ESPHOME. but good question. its good to have it in ESPHOME instead of outside. sry i cant help you on this
@Alfagek , It is a know problem that the interrupts causes issues with a OTA. The workarround is indeed disconnecting the interrupt pin or disable the interupt trough a software change in the esp version. I know there is a change request from someone who implemented a software switch to disable the interrupts. I am waiting for ESP home to implement a OTA event trigger, so whe can disable the interrupt during OTA. For now the workarrounf for updating is a USB/COM upload or disconnecting the interrupt pin when using OTA.
@jodur , thanks for the explanation.
Other question I have, how can I debug why I can’t pair with my itho box. In the logs i see “join on” “join off” when I use the join switch. But it doesn’t pair with the itho.
With a other nodemcu I have it working with espeasy and a old version from Sten vollebrecht
Working great, thanks