Integrar contadores inteligentes da EDP em Home Assistant

Para desactivar basta usar um pin.

Ao usares os dois activas completamente a bridge.

Mas, nesse aspecto já é domínio do Tasmota.

O motivo de alguns Wemos e Nodemcu não funcionarem com o pin 1 e 3.

É a existência de um pullup forte.

Ao fim destes anos, certas coisas fazem sentido agora.

Tradução adicionada como cortesia, porque sei que estou num fórum que não é em inglês:

Olá a todos,

Peço desculpa por usar o inglês, mas mudámo-nos recentemente para português e ainda estou a aprender a língua.
Achei este tópico muito perspicaz e tem muitas semelhanças com a forma como costumávamos extrair dados modbus de um inversor SunSynk na minha casa anterior.

Neste repositório do github está o código mais recente que usei para esse fim e pode ser facilmente adaptado para ler os registos corretos para as caixas EDP e expô-los como entidades em HA. Sinta-se à vontade para pegar em qualquer parte do código que queira reutilizar.

Eu costumava executar isso em um ESP32 com um chapéu modbus instalado e ele facilmente sondava dados a cada segundo, mas eu o mantive em intervalos de 5 segundos para facilitar o meu HA DB.

A configuração era semelhante à deste utilizador:
(imagem no próximo post)

Agora: Devido à caixa EDP estar longe da minha casa e não haver disponibilidade de um tubo para passar o cabo cat6, decidi instalar um Shelly Pro 3EM na placa principal, para poder ver/calcular a maior parte da informação disponível na caixa EDP. Terei todo o gosto em partilhar a forma como o fiz, mas é um trabalho em curso. Colocarei mais imagens nos próximos posts, devido às limitações das imagens incorporadas para os novos utilizadores

Parece que existe um conhecimento técnico aprofundado por parte das pessoas neste tópico, pelo que gostaria de colocar aqui uma questão simples.

O contador da EDP apresenta um valor total consumido para Vazio, Cheias e Ponta (1.8.1, 1.8.2 e 1.8.3) apesar de eu estar no tarifário “simples”.

Gostaria de saber quando é que o contador muda de cada tarifa para a seguinte, para poder ajustar a leitura total do contador em conformidade. O contador segue o horário abaixo indicado, incorporado na caixa EDP, ou existe outro horário programado na caixa Landis?
Além disso, que datas são utilizadas para determinar as tarifas de verão ou de inverno?


Hi All,

Apologies for using English, but we just recently moved to Portugual and I am still learning the language.
I found this thread very insightful and it has a lot of similarities on how we used to pull modbus data from a SunSynk inverter at my previous house.

In this github repo is the latest code I used for that purpose and it can very easily be adapted to read the correct registers for the EDP boxes and expose it as entities in HA. Feel free to take any bits of code you may want to reuse.

I used to run this on an ESP32 with a modbus hat installed and it easily polled data every second, but I kept it at 5 second intervals to go easier on my HA DB.

It looked similar to this user’s setup:
(image in next post)

Now: Due to the EDP box being far from my house and no availability of a pipe to run the cat6 cable in, I have settled on installing a Shelly Pro 3EM in the main board, so I can see/calculate the majority of information available in the EDP box. I am happy to share how I have done this, it’s a work in progress though. will post more images in next posts, due to embedded image limitations for new users

It seems there is a thorough technical understanding from the people on this thread, so I would like to pose a simple question here.

The EDP meter shows a total consumed value for Vazio, Cheias and Ponta (1.8.1, 1.8.2 and 1.8.3) even though I am on the “simples” tariff.

I would like to know when the meter switches from each tariff to the next so I can adjust my total meter reading accordingly. Does it follow the below timetable built into the EDP box, or is there another schedule programmed inside the Landis box?
Also, what dates are used to determine the summer or winter tariffs?
image

Follow up from previous post - My sunsynk modbus poller on ESPHome looked similar to this user’s setup:

This is what I have thus far in HA

Hello @Jacques_Aucamp

Can you share with us how you added the sub totals for “Today”, “This week”, “This month”, “This Quarter”, “This year”…, thanks.

Also, your “Setup” sensor and yaml would be nice, if you can share.

Thanks.

Olá a todos

Estive a ajudar um colega a montar um Elfin conectado por modbus com o home assistant (customer component).

Consigo ler os valores corretamente, contudo alguns deles como por exemplo o consumo em amps, fica a transitar entre o valor lido e “unavailable”.

Entretanto também me apercebi que o valor da tarifa (address 11) tem um ouput que difere do que tenho em casa.

Pode isto estar a acontecer por necessitar de ter configurações diferentes para o modelo do contador dele?

  - name: ERedes_box_contador_energia
    type: tcp
    host: <IP>
    port: 9502
    delay: 1
    timeout: 4
    retries: 5
    #retry_on_empty: true
    message_wait_milliseconds: 200
    - name: "ERedes Box Current" # 6D
      slave: 01
      address: 109
      input_type: input
      #count: 1
      data_type: uint16
      precision: 1
      scale: 0.1
      unit_of_measurement: A
      device_class: current
      scan_interval: 15

Configs do Elfin:
image

No fundo o meu problema é muito semelhante ao reportado pelo @Cesar_Araujo

Houve alguma solução?

Obrigado!

Olá, eu acabei por mudar para o easyhan, os contadores da e-redes não usam o protocolo standard e por isso temos que fazer maroscas para obter todos os registos. Cansei de fazer patch ao modbus do home assistant sempre que tinha um update. Easyhan, foi directo e simples. E alem disso tenho toda a informação possível.
O mestre nikito vai fazendo os updates e domina os “glitches” dos contadores para ter sempre leituras, mesmo nos casos onde tem o modem da e-redes.
Espero ter ajudado.

Obrigado pelo feedback @Cesar_Araujo

@nikito7 Sabe se existe alguma solução mantendo o Elfin?

Obrigado pela vossa disponibilidade

Actualmente desisti do Elfin. Principalmente do componente modbus do Home Assistant.

Só os Watts e kWh tem problemas.

A corrente deveria funcionar.

A maioria dos contadores são 8N1, Stop bits 1.

Excepto Landis e Ziv, desatualizados ou antigos.

O problema é pior com usb rs485.

Com o Elfin deveria funcionar com o custom_component.

Eu não sigo isso.

Os 32bits tem de ser com o data_type: custom

No easyhan bridge funciona:
Screenshot_20250215_214230_Home Assistant

Se o pedido modbus falhar fica unavailable

Sem custom:

Logger: homeassistant.config
Source: config.py:942
First occurred: 21:47:19 (1 occurrences)
Last logged: 21:47:19

Invalid config for ‘modbus’ at pkg/active/demo.yaml, line 40: EB2 38 uint32 c1: Size of structure is 4 bytes but count: 1 is 2 bytes ‘modbus->0->sensors->2’, got {‘name’: ‘EB2 38 uint32 c1’, ‘unique_id’: ‘eb2_demo38_c1’, ‘slave’: 1, ‘address’: 38, ‘input_type’: ‘input’, ‘data_type’: ‘custom’, ‘count’: 1, ‘structure’: ‘>L’, ‘precision’: 2, ‘scale’: 0.001, ‘unit_of_measurement’: ‘kWh’, ‘device_class’: ‘energy’, ‘state_class’: ‘total_increasing’}, please check the docs at https://www.home-assistant.io/integrations/modbus Invalid config for ‘modbus’ at pkg/active/demo.yaml, line 67: EB2 22+23 uint32 c2: Size of structure is 8 bytes but count: 2 is 4 bytes ‘modbus->0->sensors->4’, got {‘name’: ‘EB2 22+23 uint32 c2’, ‘unique_id’: ‘eb2_demo22_c2’, ‘slave’: 1, ‘address’: 22, ‘input_type’: ‘input’, ‘count’: 2, ‘data_type’: ‘custom’, ‘structure’: ‘>2L’, ‘scale’: 0.001, ‘precision’: 2}, please check the docs at https://www.home-assistant.io/integrations/modbus Invalid config for ‘modbus’ at pkg/active/demo.yaml, line 80: EB2 clock demo: Size of structure is 12 bytes but count: 1 is 2 bytes ‘modbus->0->sensors->5’, got {‘name’: ‘EB2 clock demo’, ‘unique_id’: ‘eb2_clock_demo’, ‘slave’: 1, ‘address’: 1, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘custom’, ‘structure’: ‘>H7BhB’}, please check the docs at https://www.home-assistant.io/integrations/modbus

O custom altera o único codigo que me aceitaram.
Sem isso nem o custom era possível.
Além que o custom não é a forma correta…

Eu já tinha utilizado esse script por isso nao tenho o erro indicado acima. Como é que posso perceber qual é a origem deste problema do unavailable? É estranho só acontecer com alguns dos sensores. Há uns que estão sempre a funcionar, mas há outros, nomeadamente este que referi a cima que está sempre a ficar unavailable.

Seria espetacular se tivesse algumas luzes de como despistar este problema, será que por vezes o contador dá output de um formato que não é reconhecido pelo modbus no HA?

Deve dar timeout. Ou conflito.

message_wait_milliseconds: 750


Não sei se isto faz alguma coisa:

min_value float (Optional)
The minimum allowed value of a sensor. If value < min_value –> min_value. Can be float or integer

[https://www.home-assistant.io/integrations/modbus/#min_value ]


In order for the developers better to identify the problem, please add the following lines to configuration.yaml:

logger:
  default: warning
  logs:
    homeassistant.components.modbus: debug
    pymodbus: debug

and restart Home Assistant, reproduce the problem, and include the log in the issue.

Tentei com as configs acima contudo tenho o mesmo problema.

Os sensores em questão ficam indisponiveis sempre que tenho a seguinte mensagem:

2025-02-16 13:57:06.983 DEBUG (SyncWorker_3) [pymodbus.logging] New Transaction state “SENDING”

2025-02-16 13:57:06.983 DEBUG (SyncWorker_3) [pymodbus.logging] Changing transaction state from “SENDING” to “WAITING FOR REPLY”

2025-02-16 13:57:06.987 ERROR (SyncWorker_3) [custom_components.modbus.modbus] Pymodbus: ERedes_box_contador_energia: Modbus Error: [Connection] ModbusTcpClient(192.168.1.241:9502): Connection unexpectedly closed 0.00011348724365234375 seconds into read of 8 bytes without response from slave before it closed connection

2025-02-16 13:57:12.009 DEBUG (SyncWorker_1) [pymodbus.logging] Connection to Modbus server established. Socket (‘192.168.1.242’, 58730)

2025-02-16 13:57:12.010 DEBUG (SyncWorker_1) [pymodbus.logging] Current transaction state - WAITING_FOR_REPLY

2025-02-16 13:57:12.010 DEBUG (SyncWorker_1) [pymodbus.logging] Running transaction 286

O que isto significa? Que a conexão foi fechada enquanto estavamos à espera de uma resposta do contador?

Problemas de wifi talvez.

olá,

estou a tentar ler os valores da corrente activa directamente pelo modbus no homeassistant mas tenho valores muito elevados:

A minha configuração é:

      #114 0x0072 Instantaneous Current (Sum of all phases)  (A)
      - name: "Contador Corrente"
        slave: 1
        address: 114
        input_type: input
        count: 1
        data_type: custom
        structure: ">H"
        precision: 0
        scale: 1
        unit_of_measurement: A
        device_class: current
        scan_interval: 5

A minha dúvida é saber se o contador está a devolver o valores em A ou em que unidade está a devolver?
Ou devo usar outro registo para ler a corrente?

Obrigado.

        input_type: input
        data_type: uint16
        precision: 1
        scale: 0.1

@nikito7 funciona correctamente, obrigado!

1 Curtiu

@nikito7 Não me parece ser WiFi, estive a ver e na minha casa tenho também os mesmos outputs nos logs, mas os valores não desaparecem. Qual seria a sugestão como alternativa? Existe algo que possa flashar num ESP8266? Há algum tutorial?
Confesso que me custa um bocado ter esse effort quando o Elfin deveria funcionar em condicoes.

Hi Rui,
It’s actually quite simple - simpler than I thought when I started.

I created a Utility Meter helper for each period, with different reset timers, daily, weekly, monthly etc.
For each one I created 3 supported tariffs: Ponta, Vazio, Cheias
The input sensor is always my overall energy consumption.

For example:

I then have a node red automation to set the tariffs at specific times of day. I’m not sure if the times I used is the same as the times the meter is programmed with, which is why I posed the question of these timings.

Here is the flow

[{"id":"b9e2053371079b60","type":"tab","label":"EDP","disabled":false,"info":"","env":[]},{"id":"6b26224259c5ec54","type":"group","z":"b9e2053371079b60","name":"","style":{"fill":"#EE162D","label":true,"fill-opacity":"0.5"},"nodes":["d74dd64fddd2c0f9"],"x":1674,"y":499,"w":212,"h":82},{"id":"e1fb2f0d247116be","type":"group","z":"b9e2053371079b60","name":"","style":{"fill":"#F69779","label":true,"fill-opacity":"0.5"},"nodes":["34d130e93c168b39"],"x":1674,"y":599,"w":252,"h":82},{"id":"befbbe41b63437ef","type":"group","z":"b9e2053371079b60","name":"","style":{"fill":"#FFD3C6","label":true,"fill-opacity":"0.5"},"nodes":["ce2b52931f84f1e2"],"x":1674,"y":699,"w":192,"h":82},{"id":"46adc74473598c85","type":"group","z":"b9e2053371079b60","name":"Summer Weekday","style":{"label":true},"nodes":["baebdfb04d2c8e2d","8c69af03ca2769bb","882cbcc8f6f3c6bc","37de1c93f0025670","9dbdf189557a858f","9e9183b72c5da69e","3edabf5f5ad5163b","dae4c06e7346acdf"],"x":934,"y":39,"w":482,"h":262},{"id":"2164025e5cbbb26f","type":"group","z":"b9e2053371079b60","name":"Summer Saturday","style":{"label":true},"nodes":["8a18161c48a7b2d8","03dbe8e8dc379896","888bd70683676890","6648db4696744f8a","53b2a2278d433f00","dc5a93cf0664ab1c","5f65da39344605e9","7f180e92af1ec5ef","9495d0946defaf2f","7e4bcae98bb14217"],"x":934,"y":319,"w":482,"h":322},{"id":"aed0ac32ad6ebdb7","type":"group","z":"b9e2053371079b60","name":"Summer Sunday","style":{"label":true},"nodes":["c32b97bdf8694c55","9b2422e47fc80d1f"],"x":934,"y":659,"w":442,"h":82},{"id":"1e0bcd3b8fd4d2cb","type":"group","z":"b9e2053371079b60","name":"Winter Weekday","style":{"label":true},"nodes":["0626357823744f8b","e0129325937dc6a3","128985fd73b38ec2","bb0583c18eed0102","0dd1cd8259b3e5b4","e76cf3bdd2482202","3528cfe45002014e","3569325f2f5b2771","2863aa17d1d965e9","6aad5779598bac99","f9cbdf2505c051e5","60bbecc4adb08f85"],"x":934,"y":759,"w":482,"h":382},{"id":"2dbc09c85b10e426","type":"group","z":"b9e2053371079b60","name":"Winter Saturday","style":{"label":true},"nodes":["384e2f91ca1d8316","b48f4b04b6770860","182167af7e4f496d","5e3f01a6ad1f3690","37c805d7c4999533","057f094fdcabea3e","37de11bf3074b40b","dd2c12694cfe445f","acd2e87da7d7656c","bfe960d535580d8e"],"x":934,"y":1159,"w":482,"h":322},{"id":"fd4a8729461676aa","type":"group","z":"b9e2053371079b60","name":"Winter Sunday","style":{"label":true},"nodes":["ea5923d76b152a72","e5f68861ff8950c3"],"x":934,"y":1499,"w":442,"h":82},{"id":"baebdfb04d2c8e2d","type":"time-range-switch","z":"b9e2053371079b60","g":"46adc74473598c85","name":"0h to 7h","lat":"39.246755","lon":"-9.137260","startTime":"00:00","endTime":"07:00","startOffset":"","endOffset":"","x":1020,"y":80,"wires":[["9dbdf189557a858f"],[]]},{"id":"8c69af03ca2769bb","type":"time-range-switch","z":"b9e2053371079b60","g":"46adc74473598c85","name":"7h to 09h15","lat":"39.246755","lon":"-9.137260","startTime":"07:00","endTime":"09:15","startOffset":"","endOffset":"","x":1030,"y":140,"wires":[["9e9183b72c5da69e"],[]]},{"id":"882cbcc8f6f3c6bc","type":"time-range-switch","z":"b9e2053371079b60","g":"46adc74473598c85","name":"09h15 to 12h15","lat":"39.246755","lon":"-9.137260","startTime":"09:15","endTime":"12:15","startOffset":"","endOffset":"","x":1040,"y":200,"wires":[["dae4c06e7346acdf"],[]]},{"id":"37de1c93f0025670","type":"time-range-switch","z":"b9e2053371079b60","g":"46adc74473598c85","name":"12:15 to 23:59","lat":"39.246755","lon":"-9.137260","startTime":"12:15","endTime":"23:59","startOffset":"","endOffset":"","x":1040,"y":260,"wires":[["3edabf5f5ad5163b"],[]]},{"id":"8a18161c48a7b2d8","type":"time-range-switch","z":"b9e2053371079b60","g":"2164025e5cbbb26f","name":"0h to 9h","lat":"39.246755","lon":"-9.137260","startTime":"00:00","endTime":"09:00","startOffset":"","endOffset":"","x":1020,"y":360,"wires":[["5f65da39344605e9"],[]]},{"id":"03dbe8e8dc379896","type":"time-range-switch","z":"b9e2053371079b60","g":"2164025e5cbbb26f","name":"9h to 14h","lat":"39.246755","lon":"-9.137260","startTime":"09:00","endTime":"14:00","startOffset":"","endOffset":"","x":1020,"y":420,"wires":[["53b2a2278d433f00"],[]]},{"id":"888bd70683676890","type":"time-range-switch","z":"b9e2053371079b60","g":"2164025e5cbbb26f","name":"20h to 22h","lat":"39.246755","lon":"-9.137260","startTime":"20:00","endTime":"22:00","startOffset":"","endOffset":"","x":1030,"y":540,"wires":[["dc5a93cf0664ab1c"],[]]},{"id":"0626357823744f8b","type":"time-range-switch","z":"b9e2053371079b60","g":"1e0bcd3b8fd4d2cb","name":"7h to 09h30","lat":"39.246755","lon":"-9.137260","startTime":"07:00","endTime":"09:30","startOffset":"","endOffset":"","x":1030,"y":860,"wires":[["3569325f2f5b2771"],[]]},{"id":"e0129325937dc6a3","type":"time-range-switch","z":"b9e2053371079b60","g":"1e0bcd3b8fd4d2cb","name":"09h30 to 12h","lat":"39.246755","lon":"-9.137260","startTime":"09:30","endTime":"12:00","startOffset":"","endOffset":"","x":1030,"y":920,"wires":[["f9cbdf2505c051e5"],[]]},{"id":"384e2f91ca1d8316","type":"time-range-switch","z":"b9e2053371079b60","g":"2dbc09c85b10e426","name":"09h30 to 13h","lat":"39.246755","lon":"-9.137260","startTime":"09:30","endTime":"13:00","startOffset":"","endOffset":"","x":1030,"y":1260,"wires":[["acd2e87da7d7656c"],[]]},{"id":"128985fd73b38ec2","type":"time-range-switch","z":"b9e2053371079b60","g":"1e0bcd3b8fd4d2cb","name":"12h to 18h30","lat":"39.246755","lon":"-9.137260","startTime":"12:00","endTime":"18:30","startOffset":"","endOffset":"","x":1030,"y":980,"wires":[["2863aa17d1d965e9"],[]]},{"id":"bb0583c18eed0102","type":"time-range-switch","z":"b9e2053371079b60","g":"1e0bcd3b8fd4d2cb","name":"18h30 to 21h","lat":"39.246755","lon":"-9.137260","startTime":"18:30","endTime":"21:00","startOffset":"","endOffset":"","x":1030,"y":1040,"wires":[["60bbecc4adb08f85"],[]]},{"id":"b48f4b04b6770860","type":"time-range-switch","z":"b9e2053371079b60","g":"2dbc09c85b10e426","name":"18h30 to 22h","lat":"39.246755","lon":"-9.137260","startTime":"18:30","endTime":"22:00","startOffset":"","endOffset":"","x":1030,"y":1380,"wires":[["bfe960d535580d8e"],[]]},{"id":"182167af7e4f496d","type":"time-range-switch","z":"b9e2053371079b60","g":"2dbc09c85b10e426","name":"22h to 23h59","lat":"39.246755","lon":"-9.137260","startTime":"22:00","endTime":"23:59","startOffset":"","endOffset":"","x":1030,"y":1440,"wires":[["dd2c12694cfe445f"],[]]},{"id":"c0f885aa8ed198ca","type":"function","z":"b9e2053371079b60","name":"Summer?","func":"function lastSunday(year, month) {\n    var date = new Date(year,month,1,12);\n    let weekday = date.getDay();\n    let dayDiff = weekday===0 ? 7 : weekday;\n    let lastSunday = date.setDate(date.getDate() - dayDiff);\n    return date;\n}\n\n\nvar season = \"\";\nvar today = new Date();\nvar year = today.getFullYear();\n\n\nvar winterstart = lastSunday(year, 10) // Last Sunday of October\nvar summerstart = lastSunday(year, 3) // Last Sunday of March\n\nif (today > summerstart) {\n    if (today < winterstart) {\n        return [msg, null]; //summer\n    } else {\n        return [null, msg]; //winter\n    }\n} else {\n    return [null, msg]; //winter\n}\n\n\n","outputs":2,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":440,"y":620,"wires":[["5936b5003b94f452","6b22f43a7735b9a6","f58ae391753dc942"],["2dae59a19f6c70ef","589714cd12d63223","8ccbde644c6f9119"]],"outputLabels":["summer","winter"]},{"id":"5936b5003b94f452","type":"weekday-gate","z":"b9e2053371079b60","name":"Weekday","weekdays":["1","2","3","4","5"],"x":680,"y":300,"wires":[["baebdfb04d2c8e2d","8c69af03ca2769bb","37de1c93f0025670","882cbcc8f6f3c6bc"]]},{"id":"6b22f43a7735b9a6","type":"weekday-gate","z":"b9e2053371079b60","name":"Saturday","weekdays":["6"],"x":680,"y":340,"wires":[["8a18161c48a7b2d8","03dbe8e8dc379896","6648db4696744f8a","888bd70683676890","9495d0946defaf2f"]]},{"id":"f58ae391753dc942","type":"weekday-gate","z":"b9e2053371079b60","name":"Sunday","weekdays":["0"],"x":680,"y":380,"wires":[["c32b97bdf8694c55"]]},{"id":"2dae59a19f6c70ef","type":"weekday-gate","z":"b9e2053371079b60","name":"Weekday","weekdays":["1","2","3","4","5"],"x":690,"y":1020,"wires":[["0626357823744f8b","e0129325937dc6a3","128985fd73b38ec2","bb0583c18eed0102","0dd1cd8259b3e5b4","e76cf3bdd2482202"]]},{"id":"589714cd12d63223","type":"weekday-gate","z":"b9e2053371079b60","name":"Saturday","weekdays":["6"],"x":690,"y":1060,"wires":[["37c805d7c4999533","384e2f91ca1d8316","5e3f01a6ad1f3690","b48f4b04b6770860","182167af7e4f496d"]]},{"id":"8ccbde644c6f9119","type":"weekday-gate","z":"b9e2053371079b60","name":"Sunday","weekdays":["0"],"x":690,"y":1100,"wires":[["ea5923d76b152a72"]]},{"id":"6648db4696744f8a","type":"time-range-switch","z":"b9e2053371079b60","g":"2164025e5cbbb26f","name":"14h to 20h","lat":"39.246755","lon":"-9.137260","startTime":"14:00","endTime":"20:00","startOffset":"","endOffset":"","x":1030,"y":480,"wires":[["7f180e92af1ec5ef"],[]]},{"id":"5e3f01a6ad1f3690","type":"time-range-switch","z":"b9e2053371079b60","g":"2dbc09c85b10e426","name":"13h to 18h30","lat":"39.246755","lon":"-9.137260","startTime":"13:00","endTime":"18:30","startOffset":"","endOffset":"","x":1030,"y":1320,"wires":[["37de11bf3074b40b"],[]]},{"id":"0dd1cd8259b3e5b4","type":"time-range-switch","z":"b9e2053371079b60","g":"1e0bcd3b8fd4d2cb","name":"21h to 23h59","lat":"39.246755","lon":"-9.137260","startTime":"21:00","endTime":"23:59","startOffset":"","endOffset":"","x":1030,"y":1100,"wires":[["6aad5779598bac99"],[]]},{"id":"37c805d7c4999533","type":"time-range-switch","z":"b9e2053371079b60","g":"2dbc09c85b10e426","name":"0h to 9h30","lat":"39.246755","lon":"-9.137260","startTime":"00:00","endTime":"09:30","startOffset":"","endOffset":"","x":1030,"y":1200,"wires":[["057f094fdcabea3e"],[]]},{"id":"d74dd64fddd2c0f9","type":"api-call-service","z":"b9e2053371079b60","g":"6b26224259c5ec54","name":"Vazio (Off Peak)","server":"ab268d74b0ab2f23","version":7,"debugenabled":false,"action":"select.select_option","floorId":[],"areaId":[],"deviceId":[],"entityId":["select.edp_tariff_all_time","select.edp_tariff_this_month","select.edp_tariff_this_quarter","select.edp_tariff_this_week","select.edp_tariff_this_year","select.edp_tariff_today"],"labelId":[],"data":"{\"option\":\"Vazio (Off Peak)\"}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"all","blockInputOverrides":false,"domain":"select","service":"select_option","x":1780,"y":540,"wires":[[]]},{"id":"e76cf3bdd2482202","type":"time-range-switch","z":"b9e2053371079b60","g":"1e0bcd3b8fd4d2cb","name":"0h to 7h","lat":"39.246755","lon":"-9.137260","startTime":"00:00","endTime":"07:00","startOffset":"","endOffset":"","x":1020,"y":800,"wires":[["3528cfe45002014e"],[]]},{"id":"c32b97bdf8694c55","type":"time-range-switch","z":"b9e2053371079b60","g":"aed0ac32ad6ebdb7","name":"00h to 23h59","lat":"39.246755","lon":"-9.137260","startTime":"00:00","endTime":"23:59","startOffset":"","endOffset":"","x":1030,"y":700,"wires":[["9b2422e47fc80d1f"],[]]},{"id":"ea5923d76b152a72","type":"time-range-switch","z":"b9e2053371079b60","g":"fd4a8729461676aa","name":"0h to 23h59","lat":"39.246755","lon":"-9.137260","startTime":"00:00","endTime":"23:59","startOffset":"","endOffset":"","x":1030,"y":1540,"wires":[["e5f68861ff8950c3"],[]]},{"id":"9dbdf189557a858f","type":"link out","z":"b9e2053371079b60","g":"46adc74473598c85","name":"Vazio (Off Peak)","mode":"link","links":["35bf3369f72012a6"],"x":1270,"y":80,"wires":[],"l":true},{"id":"35bf3369f72012a6","type":"link in","z":"b9e2053371079b60","name":"Vazio (Off Peak)","links":["057f094fdcabea3e","3528cfe45002014e","37de11bf3074b40b","5f65da39344605e9","7f180e92af1ec5ef","9b2422e47fc80d1f","9dbdf189557a858f","dd2c12694cfe445f","e5f68861ff8950c3","7e4bcae98bb14217"],"x":1605,"y":540,"wires":[["d74dd64fddd2c0f9"]]},{"id":"9b2422e47fc80d1f","type":"link out","z":"b9e2053371079b60","g":"aed0ac32ad6ebdb7","name":"Vazio (Off Peak)","mode":"link","links":["35bf3369f72012a6"],"x":1270,"y":700,"wires":[],"l":true},{"id":"3528cfe45002014e","type":"link out","z":"b9e2053371079b60","g":"1e0bcd3b8fd4d2cb","name":"Vazio (Off Peak)","mode":"link","links":["35bf3369f72012a6"],"x":1270,"y":800,"wires":[],"l":true},{"id":"057f094fdcabea3e","type":"link out","z":"b9e2053371079b60","g":"2dbc09c85b10e426","name":"Vazio (Off Peak)","mode":"link","links":["35bf3369f72012a6"],"x":1270,"y":1200,"wires":[],"l":true},{"id":"37de11bf3074b40b","type":"link out","z":"b9e2053371079b60","g":"2dbc09c85b10e426","name":"Vazio (Off Peak)","mode":"link","links":["35bf3369f72012a6"],"x":1270,"y":1320,"wires":[],"l":true},{"id":"dd2c12694cfe445f","type":"link out","z":"b9e2053371079b60","g":"2dbc09c85b10e426","name":"Vazio (Off Peak)","mode":"link","links":["35bf3369f72012a6"],"x":1270,"y":1440,"wires":[],"l":true},{"id":"e5f68861ff8950c3","type":"link out","z":"b9e2053371079b60","g":"fd4a8729461676aa","name":"Vazio (Off Peak)","mode":"link","links":["35bf3369f72012a6"],"x":1270,"y":1540,"wires":[],"l":true},{"id":"984483d366e7c09b","type":"link in","z":"b9e2053371079b60","name":"Cheias (Median Peak)","links":["9e9183b72c5da69e","3edabf5f5ad5163b","53b2a2278d433f00","dc5a93cf0664ab1c","3569325f2f5b2771","2863aa17d1d965e9","6aad5779598bac99","acd2e87da7d7656c","bfe960d535580d8e"],"x":1605,"y":640,"wires":[["34d130e93c168b39"]]},{"id":"9e9183b72c5da69e","type":"link out","z":"b9e2053371079b60","g":"46adc74473598c85","name":"Cheias (Median Peak)","mode":"link","links":["984483d366e7c09b"],"x":1290,"y":140,"wires":[],"l":true},{"id":"3edabf5f5ad5163b","type":"link out","z":"b9e2053371079b60","g":"46adc74473598c85","name":"Cheias (Median Peak)","mode":"link","links":["984483d366e7c09b"],"x":1290,"y":260,"wires":[],"l":true},{"id":"53b2a2278d433f00","type":"link out","z":"b9e2053371079b60","g":"2164025e5cbbb26f","name":"Cheias (Median Peak)","mode":"link","links":["984483d366e7c09b"],"x":1290,"y":420,"wires":[],"l":true},{"id":"dc5a93cf0664ab1c","type":"link out","z":"b9e2053371079b60","g":"2164025e5cbbb26f","name":"Cheias (Median Peak)","mode":"link","links":["984483d366e7c09b"],"x":1290,"y":540,"wires":[],"l":true},{"id":"3569325f2f5b2771","type":"link out","z":"b9e2053371079b60","g":"1e0bcd3b8fd4d2cb","name":"Cheias (Median Peak)","mode":"link","links":["984483d366e7c09b"],"x":1290,"y":860,"wires":[],"l":true},{"id":"2863aa17d1d965e9","type":"link out","z":"b9e2053371079b60","g":"1e0bcd3b8fd4d2cb","name":"Cheias (Median Peak)","mode":"link","links":["984483d366e7c09b"],"x":1290,"y":980,"wires":[],"l":true},{"id":"6aad5779598bac99","type":"link out","z":"b9e2053371079b60","g":"1e0bcd3b8fd4d2cb","name":"Cheias (Median Peak)","mode":"link","links":["984483d366e7c09b"],"x":1290,"y":1100,"wires":[],"l":true},{"id":"acd2e87da7d7656c","type":"link out","z":"b9e2053371079b60","g":"2dbc09c85b10e426","name":"Cheias (Median Peak)","mode":"link","links":["984483d366e7c09b"],"x":1290,"y":1260,"wires":[],"l":true},{"id":"bfe960d535580d8e","type":"link out","z":"b9e2053371079b60","g":"2dbc09c85b10e426","name":"Cheias (Median Peak)","mode":"link","links":["984483d366e7c09b"],"x":1290,"y":1380,"wires":[],"l":true},{"id":"667f9e182da3977f","type":"link in","z":"b9e2053371079b60","name":"Ponta (Peak)","links":["dae4c06e7346acdf","f9cbdf2505c051e5","60bbecc4adb08f85"],"x":1605,"y":740,"wires":[["ce2b52931f84f1e2"]]},{"id":"dae4c06e7346acdf","type":"link out","z":"b9e2053371079b60","g":"46adc74473598c85","name":"Vazio (Off Peak)","mode":"link","links":["667f9e182da3977f"],"x":1270,"y":200,"wires":[],"l":true},{"id":"f9cbdf2505c051e5","type":"link out","z":"b9e2053371079b60","g":"1e0bcd3b8fd4d2cb","name":"Vazio (Off Peak)","mode":"link","links":["667f9e182da3977f"],"x":1270,"y":920,"wires":[],"l":true},{"id":"60bbecc4adb08f85","type":"link out","z":"b9e2053371079b60","g":"1e0bcd3b8fd4d2cb","name":"Vazio (Off Peak)","mode":"link","links":["667f9e182da3977f"],"x":1270,"y":1040,"wires":[],"l":true},{"id":"5f65da39344605e9","type":"link out","z":"b9e2053371079b60","g":"2164025e5cbbb26f","name":"Vazio (Off Peak)","mode":"link","links":["35bf3369f72012a6"],"x":1270,"y":360,"wires":[],"l":true},{"id":"7f180e92af1ec5ef","type":"link out","z":"b9e2053371079b60","g":"2164025e5cbbb26f","name":"Vazio (Off Peak)","mode":"link","links":["35bf3369f72012a6"],"x":1270,"y":480,"wires":[],"l":true},{"id":"bd57d00c65581c46","type":"inject","z":"b9e2053371079b60","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"60","crontab":"","once":true,"onceDelay":"10","topic":"","payload":"","payloadType":"date","x":210,"y":620,"wires":[["c0f885aa8ed198ca"]]},{"id":"34d130e93c168b39","type":"api-call-service","z":"b9e2053371079b60","g":"e1fb2f0d247116be","name":"Cheias (Median Peak)","server":"ab268d74b0ab2f23","version":7,"debugenabled":false,"action":"select.select_option","floorId":[],"areaId":[],"deviceId":[],"entityId":["select.edp_tariff_all_time","select.edp_tariff_this_month","select.edp_tariff_this_quarter","select.edp_tariff_this_week","select.edp_tariff_this_year","select.edp_tariff_today"],"labelId":[],"data":"{\"option\":\"Cheias (Median Peak)\"}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"all","blockInputOverrides":false,"domain":"select","service":"select_option","x":1800,"y":640,"wires":[[]]},{"id":"ce2b52931f84f1e2","type":"api-call-service","z":"b9e2053371079b60","g":"befbbe41b63437ef","name":"Ponta (Peak)","server":"ab268d74b0ab2f23","version":7,"debugenabled":false,"action":"select.select_option","floorId":[],"areaId":[],"deviceId":[],"entityId":["select.edp_tariff_all_time","select.edp_tariff_this_month","select.edp_tariff_this_quarter","select.edp_tariff_this_week","select.edp_tariff_this_year","select.edp_tariff_today"],"labelId":[],"data":"{\"option\":\"Ponta (Peak)\"}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"all","blockInputOverrides":false,"domain":"select","service":"select_option","x":1770,"y":740,"wires":[[]]},{"id":"9495d0946defaf2f","type":"time-range-switch","z":"b9e2053371079b60","g":"2164025e5cbbb26f","name":"22h to 23h59","lat":"39.246755","lon":"-9.137260","startTime":"22:00","endTime":"23:59","startOffset":"","endOffset":"","x":1030,"y":600,"wires":[["7e4bcae98bb14217"],[]]},{"id":"7e4bcae98bb14217","type":"link out","z":"b9e2053371079b60","g":"2164025e5cbbb26f","name":"Vazio (Off Peak)","mode":"link","links":["35bf3369f72012a6"],"x":1270,"y":600,"wires":[],"l":true},{"id":"ab268d74b0ab2f23","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":true,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":": ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"default","statusTimeFormat":"h:m","enableGlobalContextStore":true}]

Only allowed one image per post, hence the second reply. Here is the node red flow


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


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