Erro 2018-12-01 15:25:06 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: 'value_json' is undefined (value: EC3029off, template: {{ value_json.RfReceived.Data }})

tenho aqui um erro a uns tempos e que se repete no log vezes sem conta

2018-12-01 15:25:06 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: ‘value_json’ is undefined (value: EC3029off, template: {{ value_json.RfReceived.Data }})

entretanto ate ja mudei EC3029off para EC3029_off e nao é que continua a dar o erro, ja fiz uma pesquisa em todos os ficheiros por EC3029off e nem aparece mas o erro continua la, alguma dica, isto é do sensor de fumo que sempre funcionou bem.

obrigado

E se pesquisares por {{ value_json.RfReceived.Data }} o que encontras?

ai ja tenho 8 linhas com esse codigo

Mostra os ficheiros completos onde isso aparece.

group:
  
  cozinha:
    view: yes
    name: Cozinha
    icon: mdi:food
    entities:
      - group.cozinhagroup
      - group.cozinhaautomacaogroup
      - sensor.sensor_co
      - sensor.temperature_158d00022c9c0c


  cozinhagroup:
    control: hidden
    name: Controle
    entities:
      - switch.luz_principal_tecto
      - switch.luz_secundaria_tecto
      - switch.televisao

      
  cozinhaautomacaogroup:
    control: hidden
    name: Cozinha
    entities:
      - automation.int_televisao

      
###############################################################################
#                                                                             #
#                           B I N A R Y_ S E N S O R S                        #
#                                                                             #
############################################################################### 

binary_sensor:

  - platform: mqtt
    name: "sensor gas"
    payload_on: "F33B0D"
    payload_off: "F33B0Doff"
    sensor_class: gas
    state_topic: "tele/sonoff_bridge/RESULT"
    value_template: '{{ value_json.RfReceived.Data }}' 
    retain: true
    
  - platform: mqtt
    name: "Detector de Fumo"
    payload_on: "EC3029"
    payload_off: "EC3029_off"
    sensor_class: smoke
    state_topic: "tele/sonoff_bridge/RESULT"
    value_template: '{{ value_json.RfReceived.Data }}' 
    retain: true


  - platform: mqtt
    name: "Detector de CO"
    payload_on: "2BCA98"
    payload_off: "2BCA98off"
    sensor_class: gas
    state_topic: "tele/sonoff_bridge/RESULT"
    value_template: '{{ value_json.RfReceived.Data }}' 
    retain: true

 


###############################################################################
#                                                                             #
#                           S W I T C H                                       #
#                                                                             #
############################################################################### 

switch:

  - platform: mqtt
    name: "Luz principal tecto"
    state_topic: "stat/t1cozinha/POWER1"
    command_topic: "cmnd/t1cozinha/POWER1"
    qos: 1
    payload_on: "ON"
    payload_off: "OFF"
    payload_available: "Online"
    payload_not_available: "Offline"
    retain: true
    
  - platform: mqtt
    name: "Luz secundaria tecto"
    state_topic: "stat/t1cozinha/POWER2"
    command_topic: "cmnd/t1cozinha/POWER2"
    qos: 1
    payload_on: "ON"
    payload_off: "OFF"
    payload_available: "Online"
    payload_not_available: "Offline"
    retain: true

  - platform: mqtt
    name: "Televisao"
    state_topic: "stat/sonoff_pow/POWER"
    command_topic: "cmnd/sonoff_pow/POWER"
    availability_topic: "tele/sonoff_pow/LWT"
    qos: 1
    payload_on: "ON"
    payload_off: "OFF"
    payload_available: "Online"
    payload_not_available: "Offline"
    retain: true


###############################################################################
#                                                                             #
#                           A U T O M A Ç Õ E S                               #
#                                                                             #
###############################################################################  

automation:

##### ALARME GAS #####

  - alias: Sensor Gas
    initial_state: 'on'
    trigger:
      platform: state
      entity_id: binary_sensor.sensor_gas
      to: 'on'
      for:
        seconds: 10
    action:
      service: mqtt.publish
      data:
        topic: tele/sonoff_bridge/RESULT
        payload: F33B0Doff
        retain: 'true'

  - alias: Sensor Gas Telegram
    initial_state: 'on'
    trigger:
     platform: state
     entity_id: binary_sensor.sensor_gas
     to: 'on'
    action:
      - service: notify.telegram
        data:
          title: "Alarme"
          message: "FUGA DE GAS"

          
##### ALARME FUMO #####

  - alias: Sensor Fumo
    initial_state: 'on'
    trigger:
      platform: state
      entity_id: binary_sensor.detector_de_fumo
      to: 'on'
      for:
        seconds: 10
    action:
      service: mqtt.publish
      data:
        topic: tele/sonoff_bridge/RESULT
        payload: EC3029_off
        retain: 'true'

  - alias: Sensor Fumo Telegram
    initial_state: 'on'
    trigger:
     platform: state
     entity_id: binary_sensor.detector_de_fumo
     to: 'on'
    action:
      - service: notify.telegram
        data:
          title: "Alarme"
          message: "ALARME FUMO COZINHA"


##### ALARME CO #####

  - alias: Sensor CO
    initial_state: 'on'
    trigger:
      platform: state
      entity_id: binary_sensor.detector_de_co
      to: 'on'
      for:
        seconds: 10
    action:
      service: mqtt.publish
      data:
        topic: tele/sonoff_bridge/RESULT
        payload: 2BCA98off
        retain: 'true'

  - alias: Sensor CO Telegram
    initial_state: 'on'
    trigger:
     platform: state
     entity_id: binary_sensor.detector_de_co
     to: 'on'
    action:
      - service: notify.telegram
        data:
          title: "Alarme"
          message: "ALARME CO COZINHA"




##### TELEVISAO #####


  - alias: Int televisao
    initial_state: 'on'
    trigger:
      platform: state
      entity_id: binary_sensor.interruptor_televisao
      to: 'on'
      for:
        seconds: 4
    action:
      service: mqtt.publish
      data:
        topic: tele/sonoff_bridge/RESULT
        payload: C69078off
        retain: 'true'

  - alias: tv
    initial_state: 'on'
    hide_entity: true
    trigger:
      platform: mqtt
      topic: tele/sonoff_bridge/RESULT
    condition:
      condition: template
      value_template: '{{ trigger.payload_json.RfReceived.Data == "C69078" }}'
    action:
      service: switch.toggle
      data:
        entity_id: switch.televisao
group:
  
  garagem:
    view: yes
    name: Garagem
    entities:
      - group.garagemgroup

  garagemgroup:
    control: hidden
    name: Garagem
    entities:


###############################################################################
#                                                                             #
#                           B I N A R Y_ S E N S O R S                        #
#                                                                             #
############################################################################### 
binary_sensor:

  - platform: mqtt
    name: "pirGaragem"
    payload_on: "D27E5E"
    payload_off: "D27E5Eoff"
    sensor_class: motion
    state_topic: "tele/sonoff_bridge/RESULT"
    value_template: '{{ value_json.RfReceived.Data }}' 
    retain: true
    
  - platform: mqtt
    name: "pir2Garagem"
    payload_on: "D28FFE"
    payload_off: "D28FFEoff"
    sensor_class: motion
    state_topic: "tele/sonoff_bridge/RESULT"
    value_template: '{{ value_json.RfReceived.Data }}' 
    retain: true
  
#  - platform: mqtt
#    name: "Porta Garagem"
#    payload_on: "248EC1"
#    payload_off: "248EC1off"
#    sensor_class: door
#    state_topic: "tele/sonoff_bridge/RESULT"
#    value_template: '{{ value_json.RfReceived.Data }}' 
#    retain: true

###############################################################################
#                                                                             #
#                           S W I T C H                                       #
#                                                                             #
############################################################################### 



###############################################################################
#                                                                             #
#                           A U T O M A Ç Õ E S                               #
#                                                                             #
###############################################################################  

automation:

  - alias: reset pirGaragem
    initial_state: 'on'
    trigger:
      platform: state
      entity_id: binary_sensor.pirgaragem
      to: 'on'
      for:
        seconds: 6
    action:
      service: mqtt.publish
      data:
        topic: tele/sonoff_bridge/RESULT
        payload: D27E5Eoff
        retain: 'true'

  - alias: alarme telegram pirgaragem
    initial_state: 'on'
    trigger:
     platform: state
     entity_id: binary_sensor.pirgaragem
     to: 'on'
    action:
      - service: notify.telegram
        data:
          title: "Alarme"
          message: "pirGaragem"
  
### PIR2GARGEM 

  - alias: reset pir2Garagem
    initial_state: 'on'
    trigger:
      platform: state
      entity_id: binary_sensor.pir2garagem
      to: 'on'
      for:
        seconds: 6
    action:
      service: mqtt.publish
      data:
        topic: tele/sonoff_bridge/RESULT
        payload: D28FFEoff
        retain: 'true'

  - alias: alarme telegram pir2garagem
    initial_state: 'on'
    trigger:
     platform: state
     entity_id: binary_sensor.pir2garagem
     to: 'on'
    action:
      - service: notify.telegram
        data:
          title: "Alarme"
          message: "pir2Garagem"
binary_sensor:

    
  - platform: mqtt
    name: "sensor inundação WC"
    payload_on: "5D135C"
    payload_off: "5D135Coff"
    sensor_class: moisture
    state_topic: "tele/sonoff_bridge/RESULT"
    value_template: '{{ value_json.RfReceived.Data }}' 
    retain: true
binary_sensor:
  - Botao1:
    binary_sensor.switch_158d00016d9f0c:
    friendly_name: "Botao1"
    platform: xiaomi_aqara
    icon: mdi:toggle-switch
    vendor: Xiaomi
    
  - platform: mqtt
    name: "Sensor Inundação Aquario"
    payload_on: "D44F5C"
    payload_off: "D44F5Coff"
    sensor_class: moisture
    state_topic: "tele/sonoff_bridge/RESULT"
    value_template: '{{ value_json.RfReceived.Data }}' 
    retain: true

@Paulo_Morgado
Experimenta trocar as plicas por aspas nos value_template.

1 Curtiu

igual :disappointed:

2018-12-01 19:07:56 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: ‘value_json’ is undefined (value: EC3029_off, template: {{ value_json.RfReceived.Data }})

2018-12-01 19:07:56 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: ‘value_json’ is undefined (value: EC3029_off, template: {{ value_json.RfReceived.Data }})

2018-12-01 19:07:56 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: ‘value_json’ is undefined (value: EC3029_off, template: {{ value_json.RfReceived.Data }})

2018-12-01 19:07:56 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: ‘value_json’ is undefined (value: EC3029_off, template: {{ value_json.RfReceived.Data }})

2018-12-01 19:07:56 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: ‘value_json’ is undefined (value: EC3029_off, template: {{ value_json.RfReceived.Data }})

2018-12-01 19:07:56 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: ‘value_json’ is undefined (value: EC3029_off, template: {{ value_json.RfReceived.Data }})

2018-12-01 19:07:57 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: ‘value_json’ is undefined (value: EC3029_off, template: {{ value_json.RfReceived.Data }})

2018-12-01 19:07:57 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: ‘value_json’ is undefined (value: EC3029_off, template: {{ value_json.RfReceived.Data }})

2018-12-01 19:07:57 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: ‘value_json’ is undefined (value: EC3029_off, template: {{ value_json.RfReceived.Data }})

2018-12-01 19:07:57 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: ‘value_json’ is undefined (value: EC3029_off, template: {{ value_json.RfReceived.Data }})

2018-12-01 19:07:57 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: ‘value_json’ is undefined (value: EC3029_off, template: {{ value_json.RfReceived.Data }})

2018-12-01 19:07:57 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: ‘value_json’ is undefined (value: EC3029_off, template: {{ value_json.RfReceived.Data }})

2018-12-01 19:07:57 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: ‘value_json’ is undefined (value: EC3029_off, template: {{ value_json.RfReceived.Data }})

2018-12-01 19:07:57 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: ‘value_json’ is undefined (value: EC3029_off, template: {{ value_json.RfReceived.Data }})

mas agora corrigiu de EC3029off, para EC3029_off,

estava a pensar usar este.

I find this to be easier and offer more flexibility…

    sensor:
      - platform: mqtt
        state_topic: 'omg/+/433toMQTT'
        name: last_433
        expire_after: 1

The expire_after: 1 makes sure that the last received code doesn’t appear to be sending constantly.

Then, to make a “triggering” binary sensor (like for a button press, or a PIR sensor), I do this:

    binary_sensor:
      - platform: template
        sensors:
          office_motion_433:
            value_template: '{{ is_state("sensor.last_433", "2258554") }}'
            delay_off: '00:05:30'
            device_class: motion

The “delay_off” of each of these sensors is set to something slightly longer than the retrigger time of that particular sensor. This way, the sensor stays “on” for the entire motion period, and turns off once it’s no longer detected motion.

This allows for each sensor to be configured according to how it works, and also allows for a single, continuous motion event on each sensor, instead of seeing “on” then “off” 5 seconds later over and over again through the motion event.

ja tive esse erro, nao me lembro como resolvi :wink:
Mas isso nao invalida o funcionamento.

eu alterei o formato todo dos sensores de movimento so para nao ver esse erro, mais tarde posso postar como fiz, até porque gosto bem mais da forma nova que pesquisei e coloquei em funcionamento.

então quando for possível partilha com o pessoal sff
é que sao dezenas de erros iguais no log

obrigado

no sensor.yaml tenho assim

  - platform: mqtt
    state_topic: 'tele/bridge/RESULT'
    value_template: "{{ value_json.RfReceived.Data }}"
    name: last_433
    expire_after: 1

e depois em binary_sensor.yaml

  - platform: template
    sensors:
      quartos:
        value_template: '{{ is_state("sensor.last_433", "006636") }}'
        delay_off: '00:00:10'
        device_class: motion

  - platform: template
    sensors:
      hall:
        value_template: '{{ is_state("sensor.last_433", "EA5CD6") }}'
        delay_off: '00:00:10'
        device_class: motion

o state_topic: ‘tele/bridge/RESULT’ é o topic do vosso bridge mqtt e value_template: ‘{{ is_state(“sensor.last_433”, “EA5CD6”) }}’ é substituido por cada um dos vossos PIR

o delay_off esta a 10 segundos.

Este tópico foi automaticamente fechado 90 dias após a última resposta. Novas respostas não são permitidas.


Copyright © 2017-2021. Todos os direitos reservados
CPHA.pt - info@cpha.pt


FAQ | Termos de Serviço/Regras | Política de Privacidade