]> git.giorgioravera.it Git - homeassistant.git/commitdiff
Replaced Shelly1 for living room with ShellyDimmer
authorGiorgio Ravera <giorgio.ravera@gmail.com>
Sat, 13 Jun 2020 10:00:46 +0000 (12:00 +0200)
committerGiorgio Ravera <giorgio.ravera@gmail.com>
Sat, 13 Jun 2020 10:00:46 +0000 (12:00 +0200)
light/sala.yaml
scripts/shelly.yaml
shell_scripts/shelly_upgrade.sh

index aed62f5b561a9377a37120dddea06baa77db4e0b..44c057c911aabfdf13e39ea9b73521302e109137 100644 (file)
@@ -3,11 +3,24 @@
 ######################################################################
 
 - platform: mqtt
+  schema: template
   name: Luce Sala
-  command_topic: "shellies/shelly1-C426F9/relay/0/command"
-  state_topic: "shellies/shelly1-C426F9/relay/0"
-  payload_on: "on"
-  payload_off: "off"
+  state_topic: "shellies/shellydimmer-D3EA58/light/0/status"
+  state_template: > 
+    {% if value_json.ison %}
+      on
+    {% else %}
+      off
+    {% endif %}
+  command_topic: "shellies/shellydimmer-D3EA58/light/0/set"
+  command_on_template: >
+    {"turn": "on"
+      {% if brightness is defined %} 
+        , "brightness": {{ brightness | float | multiply(0.3922) | round(0) }}
+      {% endif %}
+    }  
+  command_off_template: '{ "turn" : "off" }'
+  brightness_template: "{{ value_json.brightness | float | multiply(2.55) | round(0) }}"  
   retain: false
   qos: 0
   optimistic: false
index 3eceb6a483791f76fe093d9419e19ae440af1121..a976e428d1e51f2fd6ab1c9dc402244f0cc4aaf5 100644 (file)
@@ -42,10 +42,10 @@ shelly_upgrade:
         topic: 'shellies/shelly1-93B27D/command'
         payload: 'update_fw'
 
-    # Shelly 1 Luce Sala
+    # Shelly Dimmer Luce Sala
     - service: mqtt.publish
       data:
-        topic: 'shellies/shelly1-C426F9/command'
+        topic: 'shellies/shellydimmer-D3EA58/command'
         payload: 'update_fw'
 
     # Shelly 2.5 Luci Bagno
index 7b0b5cb9425c6a3b0becea145a36a4b92b4c9866..3a1c1d6b9d12e10aeb58b9af78fc7be2ba0458e9 100755 (executable)
@@ -11,11 +11,11 @@ SHELLY_ID=(
        shellyswitch-559C49
        shelly1-24D1EE
        shelly1-93B27D
-       shelly1-C426F9
+       shellydimmer-D3EA58
        shellyswitch25-7457D8
        shelly1-59E18C
-  shellydimmer-D46CF2
-  shelly1-C423C8
+       shellydimmer-D46CF2
+       shelly1-C423C8
        shellybulb-BC8610
        shellyem-B9E1A0
        shellyplug-s-7A31CB