Closed a1ex-ak closed 5 months ago
no idea, works for me:
Please always paste full yaml config, not pictures
без понятия, у меня работает:
type: entities
show_header_toggle: false
state_color: true
entities:
- entity: climate.kitchen_chalet
type: custom:mini-climate
name: 'Кухня '
icon: mdi:countertop
swap_temperatures: true
group: true
secondary_info:
type: hvac-mode
icon: 'mdi:thermostat'
toggle:
hide: true
hvac_mode:
style: >-
(value, entity) => ({ color: value !== 'off' ? 'orange !important' :
'grey' })
source:
heat:
icon: mdi:fire
name: 'Обогрев '
'off':
icon: mdi:power
name: 'Выкл. '
change_action: >
(selected, entity) => this.call_service('climate', 'set_hvac_mode', {
entity_id: entity.entity_id, hvac_mode: selected })
indicators:
humidity:
icon:
template: () => 'mdi:water-percent'
style: |
(value) => (value > 0 ? { color: '#4682B4'} : {})
unit: '%'
round: 1
source:
entity: sensor.sonoff_a480072e16_humidity
power_consumption:
icon:
template: >
(value) => (value > 90 ? 'mdi:battery' : {}),(value) => (value < 60
? 'mdi:battery-50' : 'mdi:battery'),(value) => (value < 80 ?
'mdi:battery-70' : 'mdi:battery')
style: >
(value) => (value > 90 ? { color: '#008000'} : {}),(value) => (value
< 60 ? { color: '#FF0000'} : { color: '#008000'}),(value) => (value
< 80 ? { color: '#FFFF00'} : { color: '#008000'})
unit: '%'
round: 1
source:
entity: sensor.sonoff_a480072e16_battery
- type: divider
- entity: switch.sonoff_1001676f3c
icon: mdi:radiator
secondary_info: last-changed
hvac_mode not hvac-mode please pay attention
secondary_info: type: hvac-mode icon: 'mdi:thermostat'
Corrected it, but now it only displays the icon and no text
secondary_info:
type: hvac_mode
icon: 'mdi:thermostat'
toggle:
hide: true
no idea, works for me:
Im sorry I got it all wrong.... It should be hvac-mode. But in hvac-mode it will not use the provided icon as it doesn't really make sense - the icon need to change according to the HVAC mode.
In order to overide icons (and the text shown) you need o map all possible hvac modes in the hvac_mode
source attribute.
For example:
type: custom:mini-climate
entity: climate.living_room
secondary_info:
type: hvac-mode
hvac_mode:
source:
'off':
name: bla
icon: mdi:thermostat
Also please notice that the rendering of the component while you edit the config is not stable (not sure why) so to verify changes, please save it and see what happens
secondary_info: type: hvac-mode hvac_mode: source: 'off': name: bla icon: mdi:thermostat
type: entities
show_header_toggle: false
state_color: true
entities:
- entity: climate.kitchen_chalet
type: custom:mini-climate
name: 'Кухня '
icon: mdi:countertop
swap_temperatures: true
group: true
#secondary_info: hvac-mode
secondary_info:
type: hvac-mode
hvac_mode:
source:
'off':
name: bla
icon: mdi:thermostat
heat:
name: Обогрев
icon: mdi:thermostat
toggle:
hide: true
hvac_mode:
style: >-
(value, entity) => ({ color: value !== 'off' ? 'orange !important' :
'grey' })
source:
heat:
icon: mdi:fire
name: 'Обогрев '
'off':
icon: mdi:power
name: 'Выкл. '
change_action: >
(selected, entity) => this.call_service('climate', 'set_hvac_mode', {
entity_id: entity.entity_id, hvac_mode: selected })
indicators:
humidity:
icon:
template: () => 'mdi:water-percent'
style: |
(value) => (value > 0 ? { color: '#4682B4'} : {})
unit: '%'
round: 1
source:
entity: sensor.sonoff_a480072e16_humidity
power_consumption:
icon:
template: >
(value) => (value > 90 ? 'mdi:battery' : {}),(value) => (value < 60
? 'mdi:battery-50' : 'mdi:battery'),(value) => (value < 80 ?
'mdi:battery-70' : 'mdi:battery')
style: >
(value) => (value > 90 ? { color: '#008000'} : {}),(value) => (value
< 60 ? { color: '#FF0000'} : { color: '#008000'}),(value) => (value
< 80 ? { color: '#FFFF00'} : { color: '#008000'})
unit: '%'
round: 1
source:
entity: sensor.sonoff_a480072e16_battery
- type: divider
- entity: switch.sonoff_1001676f3c
icon: mdi:radiator
secondary_info: last-changed
errror
Обнаружены ошибки конфигурации:
duplicated mapping key (12:5)
9 | swap_temperatures: true
10 | group: true
11 | secondary_info: hvac-mode
12 | secondary_info:
----------^
13 | type: hvac-mode
14 | hvac_mode:
so act according to what the message says - remove the duplicate key
поэтому действуйте согласно сообщению - удалите дубликат переключателя
I don’t quite understand how to do this, since the duplicate hvac_mode is a button in front of the temperature numbers
secondary_info:
type: hvac-mode
hvac_mode:
source:
'off':
name: bla
icon: mdi:thermostat
heat:
name: Обогрев
icon: mdi:thermostat
toggle:
hide: true
hvac_mode:
style: >-
(value, entity) => ({ color: value !== 'off' ? 'orange !important' :
'grey' })
source:
heat:
icon: mdi:fire
name: 'Обогрев '
'off':
icon: mdi:power
name: 'Выкл. '
change_action: >
(selected, entity) => this.call_service('climate', 'set_hvac_mode', {
entity_id: entity.entity_id, hvac_mode: selected })
it is talking about the yaml syntax, not related to the card itself. You can't have a yaml that have duplicate keys:
a: 1
a: 1
речь идет о синтаксисе yaml, не имеющем отношения к самой карте. У вас может быть yaml с повторяющимися ключами:
a: 1 a: 1
Please forgive me, but I'm even more confused
Just past the full config here that gives you that error
I had a typo in the last comment I fixed it
Just past the full config here that gives you that error
I'm sorry, but I don't understand. Pok your nose, what am I doing wrong?
Please paste the full config here so I can check
*paste
type: entities
show_header_toggle: false
state_color: true
entities:
- entity: climate.kitchen_chalet
type: custom:mini-climate
name: 'Кухня '
icon: mdi:countertop
swap_temperatures: true
group: true
secondary_info:
type: hvac-mode
hvac_mode:
source:
'off':
name: bla
icon: mdi:thermostat
heat:
name: Обогрев
icon: mdi:thermostat
toggle:
hide: true
hvac_mode:
style: >-
(value, entity) => ({ color: value !== 'off' ? 'orange !important' :
'grey' })
source:
heat:
icon: mdi:fire
name: 'Обогрев '
'off':
icon: mdi:power
name: 'Выкл. '
change_action: >
(selected, entity) => this.call_service('climate', 'set_hvac_mode', {
entity_id: entity.entity_id, hvac_mode: selected })
indicators:
humidity:
icon:
template: () => 'mdi:water-percent'
style: |
(value) => (value > 0 ? { color: '#4682B4'} : {})
unit: '%'
round: 1
source:
entity: sensor.sonoff_a480072e16_humidity
power_consumption:
icon:
template: >
(value) => (value > 90 ? 'mdi:battery' : {}),(value) => (value < 60
? 'mdi:battery-50' : 'mdi:battery'),(value) => (value < 80 ?
'mdi:battery-70' : 'mdi:battery')
style: >
(value) => (value > 90 ? { color: '#008000'} : {}),(value) => (value
< 60 ? { color: '#FF0000'} : { color: '#008000'}),(value) => (value
< 80 ? { color: '#FFFF00'} : { color: '#008000'})
unit: '%'
round: 1
source:
entity: sensor.sonoff_a480072e16_battery
- type: divider
- entity: switch.sonoff_1001676f3c
icon: mdi:radiator
secondary_info: last-changed
And what is the issue with it?
И в чем проблема?
mdi:fire instead of mdi:thermostat
According to docs, hvac_mode is not inside the secondary info object, but outside of it, you already have it fix it there please
According to docs, hvac_mode is not inside the secondary info object, but outside of it, you already have it fix it there please
So this is exactly what I can’t figure out how to do?
so that the second displays what I need and the button works. Is this possible?
type: entities
show_header_toggle: false
state_color: true
entities:
- entity: climate.living_room
type: custom:mini-climate
name: 'Кухня '
icon: mdi:countertop
swap_temperatures: true
group: true
secondary_info:
type: hvac-mode
toggle:
hide: true
hvac_mode:
style: >-
(value, entity) => ({ color: value !== 'off' ? 'orange !important' :
'grey' })
source:
'off':
name: bla
icon: mdi:thermostat
heat:
name: Обогрев
icon: mdi:thermostat
change_action: >
(selected, entity) => this.call_service('climate', 'set_hvac_mode', {
entity_id: entity.entity_id, hvac_mode: selected })
indicators:
humidity:
icon:
template: () => 'mdi:water-percent'
style: |
(value) => (value > 0 ? { color: '#4682B4'} : {})
unit: '%'
round: 1
source:
entity: sensor.sonoff_a480072e16_humidity
power_consumption:
icon:
template: >
(value) => (value > 90 ? 'mdi:battery' : {}),(value) => (value < 60
? 'mdi:battery-50' : 'mdi:battery'),(value) => (value < 80 ?
'mdi:battery-70' : 'mdi:battery')
style: >
(value) => (value > 90 ? { color: '#008000'} : {}),(value) => (value
< 60 ? { color: '#FF0000'} : { color: '#008000'}),(value) => (value
< 80 ? { color: '#FFFF00'} : { color: '#008000'})
unit: '%'
round: 1
source:
entity: sensor.sonoff_a480072e16_battery
- type: divider
- entity: switch.sonoff_1001676f3c
icon: mdi:radiator
secondary_info: last-changed
You already have hvac_mode set in your coniofg , just use it instead
type: entities ... - type: divider - entity: switch.sonoff_1001676f3c icon: mdi:radiator secondary_info: last-changed
You already have hvac_mode set in your coniofg , just use it instead
doesn't work for me result
Im sorry don't know how to help any further than that
Thank you ))
I'm trying to change the secondary_info icon
but it doesn't change, what am I doing wrong?