From cd89e95428f47e8c428e6734a2d761f45f50849d Mon Sep 17 00:00:00 2001 From: Giorgio Ravera Date: Fri, 15 May 2020 17:17:29 +0200 Subject: [PATCH] Replace shelly 1 with shelly dimmer in bedroom --- light/camera.yaml | 21 +++++++++++++++++---- script/shelly.yaml | 10 ++++++++-- shell_scripts/shelly_reboot.sh | 2 +- shell_scripts/shelly_upgrade.sh | 3 ++- shell_scripts/shelly_version.sh | 4 ++-- 5 files changed, 30 insertions(+), 10 deletions(-) diff --git a/light/camera.yaml b/light/camera.yaml index 20e13ec6..6b097dd8 100644 --- a/light/camera.yaml +++ b/light/camera.yaml @@ -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 diff --git a/script/shelly.yaml b/script/shelly.yaml index 1ab9d8aa..d9b3ae48 100644 --- a/script/shelly.yaml +++ b/script/shelly.yaml @@ -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 diff --git a/shell_scripts/shelly_reboot.sh b/shell_scripts/shelly_reboot.sh index 00eaa4ca..9aa7d97f 100755 --- a/shell_scripts/shelly_reboot.sh +++ b/shell_scripts/shelly_reboot.sh @@ -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 diff --git a/shell_scripts/shelly_upgrade.sh b/shell_scripts/shelly_upgrade.sh index 79f65f2f..b96e0952 100755 --- a/shell_scripts/shelly_upgrade.sh +++ b/shell_scripts/shelly_upgrade.sh @@ -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" diff --git a/shell_scripts/shelly_version.sh b/shell_scripts/shelly_version.sh index 746e6d5e..ba8d5f0d 100755 --- a/shell_scripts/shelly_version.sh +++ b/shell_scripts/shelly_version.sh @@ -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 ) -- 2.47.3