a parte da notificação pelo telegram esta funcionando ?
eu uso este
type: custom:mushroom-template-card
entity: this.entity_id
primary: "{{ state_attr('this.entity_id', 'friendly_name') }}"
secondary: >-
{% if states['this.entity_id'].state == '[]' %} Objeto Aguardando Postagem nos
Correios. {% elif states['this.entity_id'].state == "[{}]" %}Sincronizando
com sistema dos correios {% else %}
{{ state_attr('this.entity_id', 'status')|join() }}
{{ state_attr('this.entity_id', 'data')|join() }}
{{ state_attr('this.entity_id', 'local')|join() }}
{{ state_attr('this.entity_id', 'destino')|join() }}
{% endif %}
icon: >-
{% if states['this.entity_id'].state == "['Objeto entregue ao
destinatário']"%} mdi:package-variant-closed-check {% elif
states['this.entity_id'].state == "['Encaminhado para fiscalização
aduaneira']" %} mdi:store-off {% elif states['this.entity_id'].state ==
"['Objeto postado']" %} mdi:store-plus {% elif states['this.entity_id'].state
== "[]" %} mdi:package-variant-closed-remove {% elif
states['this.entity_id'].state == "[{}]" %} mdi:refresh {% elif
states['this.entity_id'].state == "['Objeto saiu para entrega ao
destinatário']" %} mdi:human-dolly {% elif states['this.entity_id'].state ==
"['Objeto recebido pelos Correios do Brasil']" %} mdi:flag-variant {% elif
states['this.entity_id'].state == "['Objeto em trânsito - por favor
aguarde']"%} mdi:truck {% endif %}
icon_color: >-
{% if states['this.entity_id'].state == "['Objeto entregue ao destinatário']"
%}green {% elif states['this.entity_id'].state == "['Encaminhado para
fiscalização aduaneira']" %} amber {% elif states['this.entity_id'].state ==
"[]" %}red {% elif states['this.entity_id'].state == "[{}]" %}red {% elif
states['this.entity_id'].state != "['Objeto entregue ao destinatário']"
%}yellow{% endif %}
multiline_secondary: true
badge_icon: >-
{% if states['this.entity_id'].state == "['Objeto entregue ao destinatário']"
%}mdi:check-bold {% elif states['this.entity_id'].state == "['Objeto
postado']" %}mdi:share {% elif states['this.entity_id'].state == "[]"
%}mdi:alert-box {% elif states['this.entity_id'].state == "['Objeto saiu para
entrega ao destinatário']" %}mdi:share {% elif states['this.entity_id'].state
== "['Objeto recebido pelos Correios do Brasil']" %}mdi:map-marker {% elif
states['this.entity_id'].state == "['Objeto em trânsito - por favor aguarde']"
%}mdi:share{% endif %}
badge_color: >-
{% if states['this.entity_id'].state == "['Objeto entregue ao destinatário']"
%}green {% elif states['this.entity_id'].state != "['Objeto entregue ao
destinatário']" %}grey{% endif %}
tap_action:
action: more-info
card_mod:
style:
mushroom-shape-icon$: |
ha-state-icon {
}
.shape {
--shape-animation: ping 3s linear infinite;
}
@keyframes ping {
{% if states['this.entity_id'].state == "['Objeto entregue ao destinatário']"%}
60% { box-shadow: 0 0 0 0 rgba(var(--rgb-green), 10); }
100% { box-shadow: 0 0 5px 15px transparent; }
{% elif states['this.entity_id'].state == "['Encaminhado para fiscalização aduaneira']" %}
60% { box-shadow: 0 0 0 0 rgba(var(--rgb-red), 10); }
100% { box-shadow: 0 0 5px 25px transparent; }
{% elif states['this.entity_id'].state == "[]" %}
60% { box-shadow: 0 0 0 0 rgba(var(--rgb-red), 10); }
100% { box-shadow: 0 0 5px 15px transparent; }
{% elif states['this.entity_id'].state == "[{}]" %}
60% { box-shadow: 0 0 0 0 rgba(var(--rgb-red), 10); }
100% { box-shadow: 0 0 5px 15px transparent; }
{% elif states['this.entity_id'].state != "['Objeto entregue ao destinatário']" %}
60% { box-shadow: 0 0 0 0 rgba(var(--rgb-yellow), 10); }
100% { box-shadow: 0 0 5px 15px transparent; }
{% endif %}
}
isso acontece cmg tbm, mais é porque os sensores são criados no nod red, em memoria local se reiniciar perde tudo mesmo.
Para resolver esse problema além de criar o sensor eu salvo ele em arquivo ex: /config/dados/sensores.txt e após o HA reiniciar, o node rede lê o arquivo e cria os sensores novamente.
@Candangobravo essa é a última versão
@kelvinrafaeli como vc faz para salvar em .txt ?
Obrigado meu amigo! Na teoria funcionou aqui! Vou fazer mais alguns testes…
Só mais um pergunta pra nao tomar seu tempo, mas como eu poderia colocar a Alexa pra notificar quando sair pra entrega ou tiver algum novo status?
Por exemplo eu sei que precisa colocar o node da Alexa no final do fluxo mas dentro do node eu uso o padrão:
{ “message”:msg.payload, “data”:{“type”:“announce”} }
???
Essa é minha dúvida… Obrigado novamente!
@kelvinrafaeli Por favor, compartilha conosco essa versão que faz backup dos sensores.
Cara qual problema está ocorrendo no seu? Quando reinicia o HA perde os “rastreios” cadastrados?
Tbm quero saber como fazer para não perder os rastreamentos
Vou mandar todo o fluxo pois a lógica está nos meus subflows.
Isso mesmo, reiniciou o HASS some tudo, tem que cadastrar de novo.
Valeu, vou testar aqui…
Vcs estao com problema na questao do ultimo updade do sistema, ontem testei e deu certo, hj nem o popup deu certo mais.
Deu certo mano? O meu tbm perdeu os rastreios quando reiniciei rsrs
Faltou a parte para ler os sensores depois que reiniciar, como não estava no mesmo flow acabei esquecendo rsrsrs.
[{"id":"47dc296b8e1c5158","type":"group","z":"3ce14269f17b34d7","name":"","style":{"label":true},"nodes":["b325973ba44511c5","11b1e6d631b840f6","56fa780bf40fecae","65053bde2f5cf5fa","cd5fd1dc17db5670","fec26513a00c1496","89c97ce58f43b383","774e65bfe22e1c32","20aee0baa9a68388","5706993de390fb7f","77fc9cdcc671c4bd","b7f49785a4020217","4a2b6888647ce49b","0dc8b9e53b024631","8ea6cfe8289eba96","9de736bd098bbbd6","bb9e9c34337f8938"],"x":34,"y":1439,"w":1172,"h":222},{"id":"cfbbfd0a23e6bfce","type":"subflow","name":"Ler lista","info":"","category":"","in":[{"x":100,"y":180,"wires":[{"id":"99a6931167c0b64d"}]}],"out":[{"x":940,"y":180,"wires":[{"id":"f3624b7a618c4920","port":0}]}],"env":[{"name":"Deixar null se for utilizar variavavel externa msg.input_select, ou mudar null para input_selec.nome_lista","type":"str","value":"","ui":{"type":"none"}},{"name":"entity_id","type":"str","value":"null"}],"meta":{},"color":"#DDAA99"},{"id":"f3624b7a618c4920","type":"function","z":"cfbbfd0a23e6bfce","name":"Passando sensor","func":"var payload = JSON.parse(msg.payload);\nmsg.payload = payload;\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":810,"y":180,"wires":[[]]},{"id":"99a6931167c0b64d","type":"switch","z":"cfbbfd0a23e6bfce","name":"input_select = null != null","property":"entity_id","propertyType":"env","rules":[{"t":"neq","v":"null","vt":"str"},{"t":"eq","v":"null","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":250,"y":180,"wires":[["1763e3790205f4ac"],["e7c024f6cd3d7fb7"]]},{"id":"e7c024f6cd3d7fb7","type":"function","z":"cfbbfd0a23e6bfce","name":"caminho","func":"msg.entity_id = msg.entity_id\nmsg.filename = \"/config/.dados/input_select/\" + msg.entity_id\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":460,"y":200,"wires":[["b64e06ba9223d60c"]]},{"id":"1763e3790205f4ac","type":"function","z":"cfbbfd0a23e6bfce","name":"caminho","func":"msg.entity_id = env.get('entity_id')\nmsg.filename = \"/config/.dados/input_select/\" + msg.entity_id\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":460,"y":160,"wires":[["b64e06ba9223d60c"]]},{"id":"b64e06ba9223d60c","type":"file in","z":"cfbbfd0a23e6bfce","name":"Ler dados","filename":"filename","filenameType":"msg","format":"lines","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":640,"y":180,"wires":[["f3624b7a618c4920"]]},{"id":"8fbbd748d94cec06","type":"subflow","name":"Ler sensor","info":"","category":"","in":[{"x":120,"y":240,"wires":[{"id":"b7627a3eb3701437"}]}],"out":[{"x":920,"y":240,"wires":[{"id":"80da0bebf24ddcae","port":0}]}],"env":[{"name":"Deixar null se for utilizar variavavel externa msg.entity_id, ou mudar null para sensor.nome_sensor","type":"str","value":"","ui":{"type":"none"}},{"name":"entity_id","type":"str","value":"null"},{"name":"input_select","type":"str","value":"null"}],"meta":{},"color":"#DDAA99"},{"id":"610b02d77fd77fca","type":"file in","z":"8fbbd748d94cec06","name":"Ler dados","filename":"filename","filenameType":"msg","format":"lines","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":620,"y":240,"wires":[["80da0bebf24ddcae"]]},{"id":"80da0bebf24ddcae","type":"function","z":"8fbbd748d94cec06","name":"Passando sensor","func":"var payload = JSON.parse(msg.payload);\n\nmsg.entity_id = payload.entity_id\n\n// Remover informações indesejadas\ndelete payload.entity_id;\ndelete payload.last_changed;\ndelete payload.last_updated;\ndelete payload.context;\n\nmsg.payload = {\n data: payload\n};\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":790,"y":240,"wires":[[]]},{"id":"1dad6dd1484de15a","type":"function","z":"8fbbd748d94cec06","name":"caminho","func":"msg.entity_id = msg.entity_id\nmsg.filename = \"/config/.dados/sensores/\"+msg.entity_id\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":480,"y":260,"wires":[["610b02d77fd77fca"]]},{"id":"b7627a3eb3701437","type":"switch","z":"8fbbd748d94cec06","name":"entity_id= null != null","property":"entity_id","propertyType":"env","rules":[{"t":"neq","v":"null","vt":"str"},{"t":"eq","v":"null","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":260,"y":240,"wires":[["2d3f303f519a334c"],["1dad6dd1484de15a"]]},{"id":"2d3f303f519a334c","type":"function","z":"8fbbd748d94cec06","name":"caminho","func":"msg.entity_id = env.get('entity_id')\nmsg.filename = \"/config/.dados/sensores/\"+msg.entity_id\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":480,"y":220,"wires":[["610b02d77fd77fca"]]},{"id":"b325973ba44511c5","type":"fs-ops-dir","z":"3ce14269f17b34d7","g":"47dc296b8e1c5158","name":"","path":"/config/.dados/sensores/","pathType":"str","filter":"*","filterType":"str","dir":"entity_id","dirType":"msg","x":400,"y":1520,"wires":[["56fa780bf40fecae"]]},{"id":"11b1e6d631b840f6","type":"subflow:8fbbd748d94cec06","z":"3ce14269f17b34d7","g":"47dc296b8e1c5158","name":"","x":970,"y":1520,"wires":[["77fc9cdcc671c4bd"]]},{"id":"56fa780bf40fecae","type":"function","z":"3ce14269f17b34d7","g":"47dc296b8e1c5158","name":"function ","func":"msg.payload = []\nfor (var i = 0; i < msg.entity_id.length; i++) {\n msg.payload[i] = msg.entity_id[i] \n msg.entity_id[i]+1;\n}\n\nreturn msg;\n","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":540,"y":1520,"wires":[["65053bde2f5cf5fa"]]},{"id":"65053bde2f5cf5fa","type":"split","z":"3ce14269f17b34d7","g":"47dc296b8e1c5158","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":670,"y":1520,"wires":[["cd5fd1dc17db5670"]]},{"id":"cd5fd1dc17db5670","type":"change","z":"3ce14269f17b34d7","g":"47dc296b8e1c5158","name":"set entity_id","rules":[{"t":"set","p":"entity_id","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":1520,"wires":[["11b1e6d631b840f6"]]},{"id":"fec26513a00c1496","type":"fs-ops-dir","z":"3ce14269f17b34d7","g":"47dc296b8e1c5158","name":"","path":"/config/.dados/input_select/","pathType":"str","filter":"*","filterType":"str","dir":"entity_id","dirType":"msg","x":400,"y":1620,"wires":[["774e65bfe22e1c32"]]},{"id":"89c97ce58f43b383","type":"split","z":"3ce14269f17b34d7","g":"47dc296b8e1c5158","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":670,"y":1620,"wires":[["5706993de390fb7f"]]},{"id":"774e65bfe22e1c32","type":"function","z":"3ce14269f17b34d7","g":"47dc296b8e1c5158","name":"function ","func":"msg.payload = []\nfor (var i = 0; i < msg.entity_id.length; i++) {\n msg.payload[i] = msg.entity_id[i]\n msg.entity_id[i] + 1;\n}\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":540,"y":1620,"wires":[["89c97ce58f43b383"]]},{"id":"20aee0baa9a68388","type":"subflow:cfbbfd0a23e6bfce","z":"3ce14269f17b34d7","g":"47dc296b8e1c5158","name":"","x":960,"y":1620,"wires":[["b7f49785a4020217"]]},{"id":"5706993de390fb7f","type":"change","z":"3ce14269f17b34d7","g":"47dc296b8e1c5158","name":"set entity_id","rules":[{"t":"set","p":"entity_id","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":1620,"wires":[["20aee0baa9a68388"]]},{"id":"77fc9cdcc671c4bd","type":"ha-api","z":"3ce14269f17b34d7","g":"47dc296b8e1c5158","name":"","server":"db1ab0af.caa65","version":1,"debugenabled":false,"protocol":"http","method":"post","path":"/api/states/{{entity_id}}","data":"","dataType":"json","responseType":"json","outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"results"}],"x":1110,"y":1520,"wires":[[]]},{"id":"b7f49785a4020217","type":"api-call-service","z":"3ce14269f17b34d7","g":"47dc296b8e1c5158","name":"input_select","server":"db1ab0af.caa65","version":5,"debugenabled":false,"domain":"","service":"","areaId":[],"deviceId":[],"entityId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1110,"y":1620,"wires":[[]]},{"id":"4a2b6888647ce49b","type":"server-events","z":"3ce14269f17b34d7","g":"47dc296b8e1c5158","name":"HA Restart","server":"db1ab0af.caa65","version":3,"exposeAsEntityConfig":"","eventType":"home_assistant_client","eventData":"","waitForRunning":true,"outputProperties":[{"property":"entity_id","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"$outputData(\"eventData\").event_type","valueType":"jsonata"},{"property":"event_type","propertyType":"msg","value":"$outputData(\"eventData\").event_type","valueType":"jsonata"}],"x":120,"y":1560,"wires":[["0dc8b9e53b024631"]]},{"id":"0dc8b9e53b024631","type":"switch","z":"3ce14269f17b34d7","g":"47dc296b8e1c5158","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"ready","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":250,"y":1560,"wires":[["b325973ba44511c5","fec26513a00c1496","bb9e9c34337f8938"]]},{"id":"8ea6cfe8289eba96","type":"inject","z":"3ce14269f17b34d7","g":"47dc296b8e1c5158","name":"Start manual","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":230,"y":1620,"wires":[["b325973ba44511c5","fec26513a00c1496","bb9e9c34337f8938"]]},{"id":"9de736bd098bbbd6","type":"comment","z":"3ce14269f17b34d7","g":"47dc296b8e1c5158","name":"Após reiniciar ler os sensores gravados","info":"","x":210,"y":1480,"wires":[]},{"id":"bb9e9c34337f8938","type":"api-call-service","z":"3ce14269f17b34d7","g":"47dc296b8e1c5158","name":"Pergunta default reset looping","server":"db1ab0af.caa65","version":5,"debugenabled":false,"domain":"script","service":"activate_alexa_actionable_notification","areaId":[],"deviceId":[],"entityId":[],"data":"{\"text\":\"O que deseja que eu faça?\",\"event_id\":\"id_resposta\",\"alexa_device\":\"media_player.default\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","output_location":"","output_location_type":"none","x":355,"y":1560,"wires":[[]],"l":false},{"id":"db1ab0af.caa65","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]
Vishhhh ta dando uns erros no node diretorio:
“Error: ENOENT: no such file or directory, scandir ‘/config/.dados/sensores/’”
01/12/2023, 18:51:20nó: 07e875deaa0d3399msg : error
“Error: ENOENT: no such file or directory, scandir ‘/config/.dados/input_select/’”
Alguma ideia?
Pode ser que ele não tenha permissão para gravar ou ler arquivos, seu nodered é um addon? Veja que no meu estou salvando os sensores em /config/.dados/sensores/
Eu uso la do próprio ha (addons) tem como fazer salvar?
fiz uma pequena alteracao no card, que e o nova informacao no caso o “informações eletrônicas enviadas para análise da autoridade aduaneira” e tambem coloquei da cor preta, achei que ficou interesante, nao sei porque, mais a opção de apagar o codigo de rastreamento nao esta pegando para mim, esses dias estava tentando mandar um comando no telegram para adiconar e excluir, mais nao obtive sucesso ainda
type: vertical-stack
cards:
- type: horizontal-stack
cards:
- type: custom:mushroom-template-card
primary: Novo
badge_icon: mdi:plus
secondary: Rastreamento
icon: mdi:package-variant-closed-plus
fill_container: true
layout: horizontal
icon_color: green
tap_action:
action: fire-dom-event
browser_mod:
service: browser_mod.popup
data:
title: Adicionar Rastreio
right_button: Salvar
right_button_action:
service: input_button.press
data:
entity_id: input_button.correios_salvar
content:
type: entities
entities:
- entity: input_select.correios_notificacao
name: Deseja receber notificações?
icon: mdi:bell-ring
- entity: input_text.correios_rastreio
name: Qual o Código de Rastreamento?
icon: mdi:package-variant-closed
- entity: input_text.correios_nome_objeto
name: Qual nome do Objeto?
icon: mdi:form-textbox
entity: input_text.correios_rastreio
card_mod:
style: |
ha-card {
--ha-card-background: black;
}
- type: custom:mushroom-template-card
primary: Excluir
secondary: Rastreamento
icon: mdi:package-variant-closed-remove
icon_color: red
badge_icon: mdi:delete
layout: horizontal
multiline_secondary: false
tap_action:
action: fire-dom-event
browser_mod:
service: browser_mod.popup
data:
title: Excluir Rastreio
right_button: Excluir
right_button_action:
service: input_button.press
data:
entity_id: input_button.correios_excluir
content:
type: entities
entities:
- entity: input_select.rastreio
name: Qual o Código de Rastreamento?
icon: mdi:package-variant-closed
card_mod:
style: |
ha-card {
height: 200px !important;
}
card_mod:
style: |
ha-card {
--ha-card-background: black;
}
- type: custom:button-card
layout: icon_name
name: Objetos Cadastrados
icon: mdi:package-variant-closed
styles:
grid:
- grid-template-areas: '"n i"'
- grid-template-columns: 1fr 20%
icon:
- align-self: end
- color: var(--text-primary-color)
- height: 35px
card:
- padding: 4px
- height: 40px
- background: var(--primary-color)
name:
- color: var(--text-primary-color)
- justify-self: start
- padding-left: 10%
- font-weight: 400
- font-size: 18px
- type: custom:auto-entities
card:
type: grid
columns: 1
square: false
card_param: cards
show_empty: false
filter:
include:
- entity_id: sensor.correios_*
options:
type: custom:mushroom-template-card
card_mod:
style: |
ha-card {
--ha-card-background: black;
color: white;
}
entity: this.entity_id
primary: '{{ state_attr(''this.entity_id'', ''friendly_name'') }}'
secondary: >-
{% if states['this.entity_id'].state == '[]' %} Objeto aguardando
postagem nos Correios. {% elif states['this.entity_id'].state ==
"[{}]" %}Sincronizando com sistema dos correios {% else
%} {{ state_attr('this.entity_id', 'status')|join()
}}
{{ state_attr('this.entity_id', 'data')|join() }}
{{ state_attr('this.entity_id', 'local')|join() }}
{{ state_attr('this.entity_id', 'destino')|join() }}
{% endif %}
icon: >-
{% if states['this.entity_id'].state == "['Objeto entregue ao
destinatário']" %}
mdi:package-variant-closed-check
{% elif states['this.entity_id'].state == "['Objeto entregue ao
remetente']" %}
mdi:package-variant-closed-check
{% elif states['this.entity_id'].state == "['Objeto postado']" %}
mdi:store-plus
{% elif states['this.entity_id'].state == "[]" %}
mdi:package-variant-closed-remove
{% elif states['this.entity_id'].state == "[{}]" %}
mdi:refresh
{% elif states['this.entity_id'].state == "['Objeto saiu para
entrega ao destinatário']" %}
mdi:human-dolly
{% elif states['this.entity_id'].state == "['Objeto está em rota
de entrega']" %}
mdi:human-dolly
{% elif states['this.entity_id'].state == "['Objeto recebido pelos
Correios do Brasil']" %}
mdi:flag-variant
{% elif states['this.entity_id'].state == "['Objeto em trânsito -
por favor aguarde']" %}
mdi:truck
{% elif states['this.entity_id'].state == "['Informações
eletrônicas enviadas para análise da autoridade aduaneira']" %}
mdi:file-document-outline
{% endif %}
icon_color: >-
{% if states['this.entity_id'].state == "['Objeto entregue ao
destinatário']" %}
green
{% elif states['this.entity_id'].state == "[]" %}
red
{% elif states['this.entity_id'].state == "[{}]" %}
red
{% elif states['this.entity_id'].state == "['Objeto saiu para
entrega ao destinatário']" %}
orange
{% elif states['this.entity_id'].state == "['Objeto está em rota
de entrega']" %}
orange
{% elif states['this.entity_id'].state == "['Objeto entregue ao
remetente']" %}
black
{% elif states['this.entity_id'].state == "['Informações
eletrônicas enviadas para análise da autoridade aduaneira']" %}
blue
{% else %}
yellow
{% endif %}
multiline_secondary: true
badge_icon: >-
{% if states['this.entity_id'].state == "['Objeto entregue ao
destinatário']" %}
mdi:check-bold
{% elif states['this.entity_id'].state == "['Objeto postado']" %}
mdi:share
{% elif states['this.entity_id'].state == "['Objeto entregue ao
remetente']" %}
mdi:share
{% elif states['this.entity_id'].state == "[]" %}
mdi:alert-box
{% elif states['this.entity_id'].state == "['Objeto saiu para
entrega ao destinatário']" %}
mdi:share
{% elif states['this.entity_id'].state == "['Objeto está em rota
de entrega']" %}
mdi:share
{% elif states['this.entity_id'].state == "['Objeto recebido pelos
Correios do Brasil']" %}
mdi:map-marker
{% elif states['this.entity_id'].state == "['Objeto em trânsito -
por favor aguarde']" %}
mdi:share
{% elif states['this.entity_id'].state == "['Informações
eletrônicas enviadas para análise da autoridade aduaneira']" %}
mdi:share
{% endif %}
badge_color: >-
{% if states['this.entity_id'].state == "['Objeto entregue ao
destinatário']" %}
green
{% elif states['this.entity_id'].state == "['Objeto entregue ao
remetente']" %}
green
{% elif states['this.entity_id'].state != "['Objeto entregue ao
destinatário']" %}
grey
{% endif %}
tap_action:
action: more-info
order_by:
last_changed: asc
sort:
method: last_changed
count: 10
reverse: true`Texto pré-formatado`