Boas malta, hoje trago um tutorial onde fiz os meus próprios candeeiros para iluminação do pátio com a abertura do portão de entrada. Comecei por construir os candeeiros com tubo de pvc de 90 milímetros e com algumas curvas (duas por candeeiro). Para as mangas usei frascos da mokambo. entao comecei por aquecer a curva para poder alargar o tubo para a tampa caber la.
Nessas tampas abri um buraco para poder meter os casquilhos como mostra imagem seguinte.
Após ter estes passos feitos o proximo passo é rebitar as tampas as curvas de pvc para ficar tudo seguro…
que vai ficar com este aspecto final…
Para os tornar inteligentes usei 2 sonoffs dual com tasmota.
Escrevi os códigos que vou partilhar com voces. E para completar e como já tinha os sensor de portas no portão os candeeiros acendem com a abertura do mesmo.
homeassistant:
###############################################################################
# #
# C U S T O M I Z E #
# #
###############################################################################
customize:
light.candeeiro_patio_1:
icon: mdi:lightbulb-on
light.candeeiro_patio_2:
icon: mdi:lightbulb-on
light.candeeiro_patio_3:
icon: mdi:lightbulb-on
light.candeeiro_patio_4:
icon: mdi:lightbulb-on
###############################################################################
# #
# S W I T C H #
# #
###############################################################################
light:
- platform: mqtt
name: "Candeeiro pátio 1"
state_topic: "stat/lamp1_2/POWER1"
command_topic: "cmnd/lamp1_2/power1"
availability_topic: "tele/lamp1_2/LWT"
payload_available: "Online"
payload_not_available: "Offline"
qos: 1
payload_on: "ON"
payload_off: "OFF"
retain: false
- platform: mqtt
name: "Candeeiro pátio 2"
state_topic: "stat/lamp1_2/POWER2"
command_topic: "cmnd/lamp1_2/power2"
availability_topic: "tele/lamp1_2/LWT"
payload_available: "Online"
payload_not_available: "Offline"
qos: 1
payload_on: "ON"
payload_off: "OFF"
retain: false
- platform: mqtt
name: "Candeeiro pátio 3"
state_topic: "stat/lamp3_4/POWER1"
command_topic: "cmnd/lamp3_4/power1"
availability_topic: "tele/lamp3_4/LWT"
payload_available: "Online"
payload_not_available: "Offline"
qos: 1
payload_on: "ON"
payload_off: "OFF"
retain: false
- platform: mqtt
name: "Candeeiro pátio 4"
state_topic: "stat/lamp3_4/POWER2"
command_topic: "cmnd/lamp3_4/power2"
availability_topic: "tele/lamp3_4/LWT"
payload_available: "Online"
payload_not_available: "Offline"
qos: 1
payload_on: "ON"
payload_off: "OFF"
retain: false
###############################################################################
# #
# A U T O M A Ç Õ E S #
# #
###############################################################################
automation:
- alias: Ligar Iluminação do canteiro
initial_state: true
trigger:
platform: state
entity_id: binary_sensor.door_window_sensor_158d0002729eba
from: 'off'
to: 'on'
condition:
condition: or
conditions:
- condition: sun
after: sunset
after_offset: "+00:10:00"
- condition: sun
before: sunrise
action:
- delay:
seconds: 5
- service: light.turn_on
data:
entity_id: light.candeeiro_patio_1
- delay:
seconds: 3
- service: light.turn_on
data:
entity_id: light.candeeiro_patio_2
- delay:
seconds: 3
- service: light.turn_on
data:
entity_id: light.candeeiro_patio_3
- delay:
seconds: 3
- service: light.turn_on
data:
entity_id: light.candeeiro_patio_4
- alias: Desligar Iluminação do canteiro
initial_state: true
trigger:
platform: state
entity_id: binary_sensor.door_window_sensor_158d0002729eba
to: 'off'
for:
minutes: 3
action:
- delay:
seconds: 2
- service: light.turn_off
data:
entity_id: light.candeeiro_patio_4
- delay:
seconds: 2
- service: light.turn_off
data:
entity_id: light.candeeiro_patio_3
- delay:
seconds: 2
- service: light.turn_off
data:
entity_id: light.candeeiro_patio_2
- delay:
seconds: 2
- service: light.turn_off
data:
entity_id: light.candeeiro_patio_1
#botao zigbee para iluminacao do patio
- alias: Ligar iluminacao patio 2 lampadas
initial_state: true
trigger:
platform: state
entity_id: sensor.0x00158d000359e754_click
to: 'single'
condition:
condition: or
conditions:
- condition: sun
after: sunset
- condition: sun
before: sunrise
action:
service_template: >
{% if is_state('group.duas_lampadas_do_patio', 'off') %}
light.turn_on
{%- elif is_state('group.duas_lampadas_do_patio', 'on') -%}
light.turn_off
{% endif %}
entity_id: group.duas_lampadas_do_patio
- alias: Ligar iluminacao patio
initial_state: true
trigger:
platform: state
entity_id: sensor.0x00158d000359e754_click
to: 'double'
condition:
condition: or
conditions:
- condition: sun
after: sunset
- condition: sun
before: sunrise
action:
service_template: >
{% if is_state('group.lampadas_do_patio', 'off') %}
light.turn_on
{%- elif is_state('group.lampadas_do_patio', 'on') -%}
light.turn_off
{% endif %}
entity_id: group.lampadas_do_patio
###############################################################################
# #
# G R O U P S #
# #
###############################################################################
group:
Duas lâmpadas do pátio:
control: hidden
entities:
- light.candeeiro_patio_2
- light.candeeiro_patio_3
Lâmpadas do pátio:
control: hidden
entities:
- light.candeeiro_patio_1
- light.candeeiro_patio_2
- light.candeeiro_patio_3
- light.candeeiro_patio_4
- light.iluminacao_das_garagens
Depois com um botão zigbee da xiaomi criei um interruptor para poder acender e apagar as luzes sempre que necessário.
Deixo-vos 2 vídeos para voces poderem ver como ficou tudo no final…
O delay entre as lâmpadas foi só porque achei engraçado. Espero ter despertado a vossa imaginação e desafio-vos a partilhar os vossos diy.