From 7040dc32f401efe0515c7f3df01cef426241aded Mon Sep 17 00:00:00 2001 From: Giorgio Ravera Date: Sun, 14 Apr 2019 14:46:48 +0200 Subject: [PATCH] Added light global, bathroom lights and renamed bulb effecrs --- components/google.yaml | 9 ++++++--- light/all.yaml | 12 ++++++++++++ light/bagno.yaml | 27 +++++++++++++++++++++++++++ light/corridoio.yaml | 2 +- light/cucina.yaml | 2 +- light/sala.yaml | 31 +++++++++++++++---------------- lovelace/covers.yaml | 2 +- ui-lovelace.yaml | 34 ++++++++++++++++++++++++++++++---- 8 files changed, 93 insertions(+), 26 deletions(-) create mode 100644 light/all.yaml create mode 100644 light/bagno.yaml diff --git a/components/google.yaml b/components/google.yaml index 6c275a9d..801ad4fe 100644 --- a/components/google.yaml +++ b/components/google.yaml @@ -22,10 +22,13 @@ entity_config: light.luce_divano: room: Sala expose: true -# Tapparelle - cover.tapparella_globale: - room: Generale + light.luce_bagno: + room: Sala + expose: true + light.luce_specchio: + room: Sala expose: true +# Tapparelle cover.tapparella_cucina: room: Cucina expose: true diff --git a/light/all.yaml b/light/all.yaml new file mode 100644 index 00000000..f21d0570 --- /dev/null +++ b/light/all.yaml @@ -0,0 +1,12 @@ +###################################################################### +# Global Light +###################################################################### + +- platform: group + name: Luci Globale + entities: + - light.luce_corridoio + - light.luce_cucina + - light.luce_divano + - light.luce_bagno + - light.luce_specchio diff --git a/light/bagno.yaml b/light/bagno.yaml new file mode 100644 index 00000000..6e24966d --- /dev/null +++ b/light/bagno.yaml @@ -0,0 +1,27 @@ +###################################################################### +# Bathroom Light +###################################################################### + +- platform: mqtt + name: Luce Bagno + command_topic: "shellies/shellyswitch25-7457D8/relay/0/command" + state_topic: "shellies/shellyswitch25-7457D8/relay/0" + payload_on: "on" + payload_off: "off" + retain: false + qos: 1 + optimistic: false + +###################################################################### +# Bathroom Mirror Light +###################################################################### + +- platform: mqtt + name: Luce Specchio + command_topic: "shellies/shellyswitch25-7457D8/relay/1/command" + state_topic: "shellies/shellyswitch25-7457D8/relay/1" + payload_on: "on" + payload_off: "off" + retain: false + qos: 1 + optimistic: false diff --git a/light/corridoio.yaml b/light/corridoio.yaml index 925c16b2..113bb6c8 100644 --- a/light/corridoio.yaml +++ b/light/corridoio.yaml @@ -1,5 +1,5 @@ ###################################################################### -# Living Room Light (Color) +# Corridor Light ###################################################################### - platform: mqtt diff --git a/light/cucina.yaml b/light/cucina.yaml index bf9c75ef..9c2bd69a 100644 --- a/light/cucina.yaml +++ b/light/cucina.yaml @@ -1,5 +1,5 @@ ###################################################################### -# Kitchen Room Light +# Kitchen Light ###################################################################### - platform: mqtt diff --git a/light/sala.yaml b/light/sala.yaml index e24740fc..3535ec74 100644 --- a/light/sala.yaml +++ b/light/sala.yaml @@ -23,17 +23,17 @@ "gain": {{ (brightness/255*100) | int }}, {%- endif -%} {%- if effect is defined -%} - {%- if effect == 'Meteor Shower' -%} + {%- if effect == 'Pioggia di Meteore' -%} "effect": 1 - {%- elif effect == 'Gradual Change' -%} + {%- elif effect == 'Cambio Graduale' -%} "effect": 2 {%- elif effect == 'Breath' -%} "effect": 3 {%- elif effect == 'Flash' -%} "effect": 4 - {%- elif effect == 'On/Off Gradual' -%} + {%- elif effect == 'On/Off Graduale' -%} "effect": 5 - {%- elif effect == 'Red/Green Change' -%} + {%- elif effect == 'Rosso/Verde' -%} "effect": 6 {%- else -%} "effect": 0 @@ -45,8 +45,7 @@ command_off_template: > { "turn": "off", - "mode": "color", - "effect": 0 + "mode": "color" } state_template: > {% if value_json.ison == true and value_json.mode == "color" %} @@ -61,28 +60,28 @@ white_value_template: '{{ value_json.white }}' effect_template: > {%- if value_json.effect == 1 -%} - Meteor Shower + Pioggia di Meteore {%- elif value_json.effect == 2 -%} - Gradual Change + Cambio Graduale {%- elif value_json.effect == 3 -%} Breath {%- elif value_json.effect == 4 -%} Flash {%- elif value_json.effect == 5 -%} - On/Off Gradual + On/Off Graduale {%- elif value_json.effect == 6 -%} - Red/Green Change + Rosso/Verde {%- else -%} Off {%- endif -%} effect_list: - "Off" - - Meteor Shower - - Gradual Change + - Pioggia di Meteore + - Cambio Graduale - Breath - Flash - - On/Off Gradual - - Red/Green Change + - On/Off Graduale + - Rosso/Verde retain: false qos: 1 optimistic: false @@ -94,8 +93,8 @@ - platform: mqtt name: Luce Divano Bianca schema: template - command_topic: "shellies/shellybulb-/color/0/set" - state_topic: "shellies/shellybulb-/color/0/status" + command_topic: "shellies/shellybulb-BC8610/color/0/set" + state_topic: "shellies/shellybulb-BC8610/color/0/status" command_on_template: > { "turn": "on", diff --git a/lovelace/covers.yaml b/lovelace/covers.yaml index 124ef69d..654d894f 100644 --- a/lovelace/covers.yaml +++ b/lovelace/covers.yaml @@ -12,7 +12,7 @@ title: Comandi tapparelle show_header_toggle: false entities: - - cover.all_covers + - cover.tapparella_globale - cover.tapparella_cucina - cover.tapparella_sala - cover.tapparella_studio diff --git a/ui-lovelace.yaml b/ui-lovelace.yaml index 41a297da..b620b867 100644 --- a/ui-lovelace.yaml +++ b/ui-lovelace.yaml @@ -11,7 +11,6 @@ views: ###################################################################### - title: Principale id: main - #icon: mdi:home-assistant icon: mdi:home badges: - device_tracker.google_maps_115265981849847357125 @@ -38,6 +37,7 @@ views: image: /local/rooms/sala.jpg entities: - light.luce_divano + - light.luce_divano_bianca - cover.tapparella_sala - climate.sala_termostato_sala - media_player.tv_sala @@ -59,6 +59,8 @@ views: show_state: true image: /local/rooms/bagno.jpg entities: + - light.luce_bagno + - light.luce_specchio - climate.bagno_termostato_bagno - type: picture-glance @@ -97,16 +99,40 @@ views: - title: Luci id: light icon: mdi:lightbulb + badges: + - light.luce_cucina + - light.luce_corridoio + - light.luce_divano + - light.luce_bagno + - light.luce_specchio cards: - type: light - entity: light.luce_cucina + name: Luci Globale + entity: light.luci_globale + + - type: light name: Luce Cucina + entity: light.luce_cucina + - type: light - entity: light.luce_corridoio name: Luce Corridoio + entity: light.luce_corridoio + - type: light - entity: light.luce_divano name: Luce Divano + entity: light.luce_divano + + - type: light + name: Luce Divano Bianca + entity: light.luce_divano_bianca + + - type: light + name: Luce Bagno + entity: light.luce_bagno + + - type: light + name: Luce Specchio + entity: light.luce_specchio ###################################################################### # Covers -- 2.47.3