]> git.giorgioravera.it Git - homeassistant.git/commitdiff
Replace shelly 1 with shelly dimmer in bedroom
authorGiorgio Ravera <giorgio.ravera@gmail.com>
Fri, 15 May 2020 15:17:29 +0000 (17:17 +0200)
committerGiorgio Ravera <giorgio.ravera@gmail.com>
Fri, 15 May 2020 15:17:29 +0000 (17:17 +0200)
light/camera.yaml
script/shelly.yaml
shell_scripts/shelly_reboot.sh
shell_scripts/shelly_upgrade.sh
shell_scripts/shelly_version.sh

index 20e13ec6dde651de9f779d5f58f919a2b2568956..6b097dd8e7b71af577710c549346e7e8ba70e723 100644 (file)
@@ -3,11 +3,24 @@
 ######################################################################
 
 - platform: mqtt
+  schema: template
   name: Luce Camera
-  command_topic: "shellies/shelly1-24D1A8/relay/0/command"
-  state_topic: "shellies/shelly1-24D1A8/relay/0"
-  payload_on: "on"
-  payload_off: "off"
+  state_topic: "shellies/shellydimmer-D46CF2/light/0/status"
+  state_template: > 
+    {% if value_json.ison %}
+      on
+    {% else %}
+      off
+    {% endif %}
+  command_topic: "shellies/shellydimmer-D46CF2/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 1ab9d8aa7b96948aa8081d219048e87117b8f663..d9b3ae481e32d4d2aed642af9f8054003e8381fc 100644 (file)
@@ -66,10 +66,10 @@ shelly_upgrade:
         topic: 'shellies/shelly1-59E18C/command'
         payload: 'update_fw'
 
-    # Shelly 1 Luce Camera
+    # Shelly Dimmer Luce Camera
     - service: mqtt.publish
       data:
-        topic: 'shellies/shelly1-24D1A8/command'
+        topic: 'shellies/shellydimmer-D46CF2/command'
         payload: 'update_fw'
 
     # Shelly 1 Luce Balcone
@@ -96,6 +96,12 @@ shelly_upgrade:
         topic: 'shellies/shellyplug-s-7A31CB/command'
         payload: 'update_fw'
 
+#    # Shelly 1 TBD
+#    - service: mqtt.publish
+#      data:
+#        topic: 'shellies/shelly1-24D1A8/command'
+#        payload: 'update_fw'
+
 ######################################################################
 # Shelly: Reboot
 # - shell_command.shelly_reboot
index 00eaa4caf4d01a7f99c796dc74ffc4e568d50729..9aa7d97fef0e004573447c605dbfb6c5047bf393 100755 (executable)
@@ -14,7 +14,7 @@ SHELLY_ID=(
        shelly8.giorgioravera.it
        shelly9.giorgioravera.it
        shelly10.giorgioravera.it
-  shelly11.giorgioravera.it
+       shelly11.giorgioravera.it
        shellybulb.giorgioravera.it
        shellyem.giorgioravera.it
        shellydw.giorgioravera.it
index 79f65f2fbd10632c2ae6dd7f8d7d82ca31e6d9ef..b96e0952efbecc81b4c14453df01c6ce68792c22 100755 (executable)
@@ -15,11 +15,12 @@ SHELLY_ID=(
        shellybulb-BC8610
        shellyswitch25-7457D8
        shelly1-59E18C
-       shelly1-24D1A8
+  shellydimmer-D46CF2
   shelly1-C423C8
        shellyem-B9E1A0
        shellydw-B88F53
        shellyplug-s-7A31CB
+       #shelly1-24D1A8
 )
 
 echo "Upgrade Shelly Firmware"
index 746e6d5e8e4495043de63dc21dd807b4ed6704ef..ba8d5f0d9d857f5c1c4559cc47e0dedcda06621c 100755 (executable)
@@ -14,10 +14,10 @@ SHELLY_ID=(
        shelly8.giorgioravera.it
        shelly9.giorgioravera.it
        shelly10.giorgioravera.it
-  shelly11.giorgioravera.it
+       shelly11.giorgioravera.it
        shellybulb.giorgioravera.it
        shellyem.giorgioravera.it
-       shellydw.giorgioravera.it
+       #shellydw.giorgioravera.it
        shellyplugs.giorgioravera.it
 )