Configurando do Sonoff Pow R2

Alguém pode me ajudar?
Configurei tudo certo e não sei porque não mostrar os valores do dia e do dia anterior conforme foto em anexo.

sensor:

SONOFF POW FREEZER E GELADEIRA

  • platform: mqtt
    name: “Voltagem Freezer e Geladeira”
    state_topic: “tele/sonoff-freezergeladeira/SENSOR” value_template: “{{ value_json.ENERGY.Voltage }}” unit_of_measurement: “V”
    icon: mdi:flash
  • platform: mqtt
    name: “Watts Freezer e Geladeira”
    state_topic: “tele/sonoff-freezergeladeira/SENSOR” value_template: “{{ value_json.ENERGY.Power }}” unit_of_measurement: “W”
    icon: mdi:power-plug
  • platform: mqtt
    name: “Corrente Freezer e Geladeira”
    state_topic: “tele/sonoff-freezergeladeira/SENSOR” value_template: “{{ value_json.ENERGY.Current }}” unit_of_measurement: “A”
    icon: mdi:current-ac
  • platform: mqtt
    name: “Consumo Di獺rio Freezer e Geladeira” state_topic: “tele/sonoff-freezergeladeira/SENSOR” value_template: “{{ value_json.ENERGY.Today }}” unit_of_measurement: “kWh”
    icon: mdi:mdi:counter
  • platform: mqtt
    name: “Consumo Dia Anterior Freezer e Geladeira” state_topic: “tele/sonoff-freezergeladeira/SENSOR” value_template: “{{ value_json.ENERGY.Yesterday }}” unit_of_measurement: “kWh”
    icon: mdi:counter
  • platform: mqtt
    name: “Consumo Total Freezer e Geladeira” state_topic: “tele/sonoff-freezergeladeira/SENSOR” value_template: “{{ value_json.ENERGY.Total }}” unit_of_measurement: “kWh”
    icon: mdi:counter
  • platform: integration
    source: sensor.watts_freezer_geladeira name: Energia Gasta Freezer e Geladeira unit_prefix: k

round: 3

SONOFF POW MAQUINA DE LAVAR

  • platform: mqtt
    name: “Voltagem Maquina de Lavar”
    state_topic: “tele/sonoff-maquinalavar/SENSOR” value_template: “{{ value_json.ENERGY.Voltage }}” unit_of_measurement: “V”
    icon: mdi:flash
  • platform: mqtt
    name: “Watts Maquina de Lavar”
    state_topic: “tele/sonoff-maquinalavar/SENSOR” value_template: “{{ value_json.ENERGY.Power }}” unit_of_measurement: “W”
    icon: mdi:power-plug
  • platform: mqtt
    name: “Corrente Maquina de Lavar”
    state_topic: “tele/sonoff-maquinalavar/SENSOR” value_template: “{{ value_json.ENERGY.Current }}” unit_of_measurement: “A”
    icon: mdi:current-ac
  • platform: mqtt
    name: “Consumo Di獺rio Maquina de Lavar” state_topic: “tele/sonoff-maquinalavar/SENSOR” value_template: “{{ value_json.ENERGY.Today }}” unit_of_measurement: “kWh”
    icon: mdi:mdi:counter
  • platform: mqtt
    name: “Consumo Dia Anterior Maquina de Lavar” state_topic: “tele/sonoff-maquinalavar/SENSOR” value_template: “{{ value_json.ENERGY.Yesterday }}” unit_of_measurement: “kWh”
    icon: mdi:counter
  • platform: mqtt
    name: “Consumo Total Maquina de Lavar” state_topic: “tele/sonoff-maquinalavar/SENSOR” value_template: “{{ value_json.ENERGY.Total }}” unit_of_measurement: “kWh”
    icon: mdi:counter
  • platform: integration
    source: sensor.watts_maquina_lavar name: Energia Gasta Maquina de Lavar unit_prefix: k

round: 3

SONOFF POW SALA RACK

  • platform: mqtt
    name: “Voltagem Sala Rack”
    state_topic: “tele/sonoff-salarack/SENSOR” value_template: “{{ value_json.ENERGY.Voltage }}” unit_of_measurement: “V”
    icon: mdi:flash
  • platform: mqtt
    name: “Watts Sala Rack”
    state_topic: “tele/sonoff-salarack/SENSOR” value_template: “{{ value_json.ENERGY.Power }}” unit_of_measurement: “W”
    icon: mdi:power-plug
  • platform: mqtt
    name: “Corrente Sala Rack”
    state_topic: “tele/sonoff-salarack/SENSOR” value_template: “{{ value_json.ENERGY.Current }}” unit_of_measurement: “A”
    icon: mdi:current-ac
  • platform: mqtt
    name: “Consumo Di獺rio Sala Rack”
    state_topic: “tele/sonoff-salarack/SENSOR” value_template: “{{ value_json.ENERGY.Today }}” unit_of_measurement: “kWh”
    icon: mdi:mdi:counter
  • platform: mqtt
    name: “Consumo Dia Anterior Sala Rack” state_topic: “tele/sonoff-salarack/SENSOR” value_template: “{{ value_json.ENERGY.Yesterday }}” unit_of_measurement: “kWh”
    icon: mdi:counter
  • platform: mqtt
    name: “Consumo Total Sala Rack”
    state_topic: “tele/sonoff-salarack/SENSOR” value_template: “{{ value_json.ENERGY.Total }}” unit_of_measurement: “kWh”
    icon: mdi:counter
  • platform: integration
    source: sensor.watts_sala_rack name: Energia Gasta Sala Rack unit_prefix: k

unit_prefix: k round: 3

Calculando consumo energetico em reais/input text - platform: template

sensors:

Consumo geral da casa (mqtt)

energia_gasta_dia:
friendly_name: “Gasto no dia”
icon_template: mdi:cash-usd-outline
unit_of_measurement: ‘R$’
value_template: “{{ ( float(states.sensor.consumo_diario.state) *
float(states.input_text.text_valor_kwh.state) ) | round(2) }}” energia_gasta_ontem:
friendly_name: “Gasto ontem”
icon_template: mdi:cash-usd-outline
unit_of_measurement: ‘R$’
value_template: “{{ ( float(states.sensor.consumo_dia_anterior.state) *
float(states.input_text.text_valor_kwh.state) ) | round(2) }}” energia_gasta_total:
friendly_name: “Gasto total”
icon_template: mdi:cash-usd-outline
unit_of_measurement: ‘R$’
value_template: “{{ ( float(states.sensor.consumo_total.state) *
float(states.input_text.text_valor_kwh.state) ) | round(2) }}” ##### Consumo geral da casa (HA)
gasto_hoje:
friendly_name: “Gasto hoje”
icon_template: mdi:cash-usd-outline
unit_of_measurement: ‘R$’
value_template: "{{ ( float(states.sensor.kwh_gasto_hoje.state) *

float(states.input_text.text_valor_kwh.state) ) | round(2) }}"
gasto_semanal:
friendly_name: “Gasto na semana”
icon_template: mdi:cash-usd-outline
unit_of_measurement: ‘R$’
value_template: "{{ ( float(states.sensor.kwh_gasto_semana.state) *

float(states.input_text.text_valor_kwh.state) ) | round(2) }}"
gasto_mes:
friendly_name: “Gasto no m礙s”
icon_template: mdi:cash-usd-outline
unit_of_measurement: ‘R$’
value_template: “{{ ( float(states.sensor.kwh_gasto_mes.state) *
float(states.input_text.text_valor_kwh.state) ) | round(2) }}” ####### Freezer e Geladeira

####### Freezer e Geladeira
energia_gasta_dia_fg:
friendly_name: “Freezer e Geladeira gastou hoje”
icon_template: mdi:cash-usd-outline
unit_of_measurement: ‘R$’
value_template: “{{ ( float(states.sensor.consumo_diario_freezer_geladeira.state) *
float(states.input_text.text_valor_kwh.state) ) | round(2) }}” energia_gasta_ontem_fg:
friendly_name: “Freezer e Geladeira gastou ontem” icon_template: mdi:cash-usd-outline unit_of_measurement: ‘R$’
value_template:
“{{ ( float(states.sensor.consumo_dia_anterior_freezer_geladeira.state) * float(states.input_text.text_valor_kwh.state) ) | round(2) }}”
energia_gasta_semana_fg:
friendly_name: “Freezer e Geladeira Gastou na semana” icon_template: mdi:cash-usd-outline
unit_of_measurement: ‘R$’
value_template: “{{ ( float(states.sensor.kwh_gasto_semana_fg.state) *
float(states.input_text.text_valor_kwh.state) ) | round(2) }}” energia_gasta_mes_fg:
friendly_name: “Freezer e Geladeira Gastou no m礙s” icon_template: mdi:cash-usd-outline
unit_of_measurement: ‘R$’
value_template: “{{ ( float(states.sensor.kwh_gasto_mes_fg.state) *
float(states.input_text.text_valor_kwh.state) ) | round(2) }}” ###### Maquina de Lavar
energia_gasta_dia_ma:
friendly_name: “Maquina de Lavar gastou hoje”
icon_template: mdi:cash-usd-outline
unit_of_measurement: ‘R$’
value_template: “{{ ( float(states.sensor.consumo_diario_maquinalavar.state) *
float(states.input_text.text_valor_kwh.state) ) | round(2) }}” energia_gasta_ontem_ma:
friendly_name: “Maquina de Lavar gastou ontem”
icon_template: mdi:cash-usd-outline
unit_of_measurement: ‘R$’
value_template: "{{ ( float(states.sensor.consumo_dia_anterior_maquinalavar.state)

  • float(states.input_text.text_valor_kwh.state) ) | round(2) }}" energia_gasta_semana_ma:
    friendly_name: “Maquina de Lavar Gastou na semana”
    icon_template: mdi:cash-usd-outline
    unit_of_measurement: ‘R$’
    value_template: “{{ ( float(states.sensor.kwh_gasto_semana_ma.state) *
    float(states.input_text.text_valor_kwh.state) ) | round(2) }}” energia_gasta_mes_ma:
    friendly_name: “Maquina de Lavar Gastou no m礙s”

friendly_name: “Maquina de Lavar Gastou no m礙s” icon_template: mdi:cash-usd-outline
unit_of_measurement: ‘R$’
value_template: “{{ ( float(states.sensor.kwh_gasto_mes_ma.state) *
float(states.input_text.text_valor_kwh.state) ) | round(2) }}” ####### Sala Rack
energia_gasta_dia_sa:
friendly_name: “Sala Rack gastou hoje”
icon_template: mdi:cash-usd-outline
unit_of_measurement: ‘R$’
value_template: “{{ ( float(states.sensor.consumo_diario_sala_rack.state) *
float(states.input_text.text_valor_kwh.state) ) | round(2) }}” energia_gasta_ontem_sa:
friendly_name: “Sala Rack gastou ontem”
icon_template: mdi:cash-usd-outline
unit_of_measurement: ‘R$’
value_template: “{{ ( float(states.sensor.consumo_dia_anterior_sala_rack.state) *
float(states.input_text.text_valor_kwh.state) ) | round(2) }}” energia_gasta_semana_sa:
friendly_name: “Sala Rack Gastou na semana”
icon_template: mdi:cash-usd-outline
unit_of_measurement: ‘R$’
value_template: “{{ ( float(states.sensor.kwh_gasto_semana_sa.state) *
float(states.input_text.text_valor_kwh.state) ) | round(2) }}” energia_gasta_mes_sa:
friendly_name: “Sala Rack Gastou no m礙s”
icon_template: mdi:cash-usd-outline
unit_of_measurement: ‘R$’
value_template: “{{ ( float(states.sensor.kwh_gasto_mes_sa.state) *
float(states.input_text.text_valor_kwh.state) ) | round(2) }}”
freezergeladeira_status:
friendly_name_template: Status Freezer e Geladeira value_template: >-
{% if is_state(‘switch.freezer_geladeira’, ‘off’) %} Desligada
{% elif states(‘sensor.watts_freezer_geladeira’)|float > 3 %} Ligada
{% else %} Standby
{% endif %} icon_template: >-
{% if is_state(‘switch.freezer_geladeira’, ‘off’) %} mdi:power-off
{% elif states(‘sensor.watts_freezer_geladeira’)|float > 3 %} mdi:power
{% else %}

mdi:power-cycle {% endif %}
maquinalavar_status:
friendly_name_template: Status M獺quina de Lavar value_template: >-
{% if states(‘sensor.watts_maquina_lavar’)|float > 3 %} Lavando
{% else %} Desligada
{% endif %} icon_template: >-
{% if states(‘sensor.watts_maquina_lavar’)|float > 3 %} mdi:dishwasher
{% else %} mdi:washing-machine
{% endif %}
salarack_status:
friendly_name_template: Status Sala Rack value_template: >-
{% if is_state(‘switch.sala_rack’, ‘off’) %} Desligada
{% elif states(‘sensor.watts_sala_rack’)|float > 1 %} Ligada
{% endif %} icon_template: >-
{% if is_state(‘switch.sala_rack’, ‘off’) %} mdi:power-off
{% elif states(‘sensor.watts_sala_rack’)|float > 1 %} mdi:power
{% endif %}
switch:

  • platform: mqtt
    name: “Freezer e Geladeira”
    state_topic: “stat/sonoff-freezergeladeira/POWER” command_topic: “cmnd/sonoff-freezergeladeira/power” availability_topic: “tele/sonoff-freezergeladeira/LWT” payload_available: “Conectado” payload_not_available: “Desconectado”
    qos: 1 payload_on: “ON”

payload_off: “OFF” retain: true

  • platform: mqtt
    name: “Maquina de Lavar”
    state_topic: “stat/sonoff-maquinalavar/POWER” command_topic: “cmnd/sonoff-maquinalavar/power” availability_topic: “tele/sonoff-maquinalavar/LWT” payload_available: “Conectado” payload_not_available: “Desconectado”
    qos: 1 payload_on: “ON” payload_off: “OFF” retain: true
  • platform: mqtt
    name: “Sala Rack”
    state_topic: “stat/sonoff-salarack/POWER” command_topic: “cmnd/sonoff-salarack/power” availability_topic: “tele/sonoff-salarack/LWT” payload_available: “Conectado” payload_not_available: “Desconectado”
    qos: 1 payload_on: “ON” payload_off: “OFF” retain: true

utility_meter:

Energia geral kwh_gasto_hoje:
source: sensor.consumo_diario cycle: daily
offset: ‘00:00:00’
tariffs:

  • verde
  • amarela - vermelha
    kwh_gasto_semana:
    source: sensor.consumo_diario cycle: weekly
    kwh_gasto_mes:
    source: sensor.consumo_diario cycle: monthly
    offset:

days: 1 hours: 0 minutes: 0

Freezer e Geladeira kwh_gasto_semana_fg:

source: sensor.energia_gasta_freezer_geladeira
cycle: weekly kwh_gasto_mes_fg:
source: sensor.energia_gasta_freezer_geladeira cycle: monthly

Maquina de Lavar kwh_gasto_semana_ma:

source: sensor.energia_gasta_maquina_lavar
cycle: weekly kwh_gasto_mes_ma:
source: sensor.energia_gasta_maquina_lavar cycle: monthly

Sala Rack kwh_gasto_semana_sa:

source: sensor.energia_gasta_sala_rack
cycle: weekly kwh_gasto_mes_sa:
source: sensor.energia_gasta_sala_rack cycle: monthly
input_text: text_valor_kwh:
name: “Valor kW/h” initial: “0.83669”

@Alesson

Tente substituir isso: value_template: “{{ value_json.ENERGY.Today }}”
por isso: value_template: ‘{{ value_json[“ENERGY”][“Today”] }}’

1 Like

@BentoAlves

Um amigo no grupo do telegram me ajudou é por que não coloquem o …consumo_maquina_de_lavar. Por causa do ‘de’. e também no …consumo_freezer_e_geladeira. Por causa do ‘e’. Ficou faltando ai acrescentei e deu certo.

olá sou novo por aqui estou começando agora e gostei muito dessa configuração você consegue fazer um passo a passo para eu consiga fazer aqui.