New version: 0.8.7
Changelog:
- Add some abbreviation topics to Shelly RGBW2 config topic
Please anyone with Shelly RGBW2 to check that everything works well.
New version: 0.8.7
Changelog:
Please anyone with Shelly RGBW2 to check that everything works well.
New version: 0.8.8
Changelog:
Thanks for your component.
I am just using in the discovery automation:
data_template:
id: '{{ trigger.payload_json.id }}'
mac: '{{ trigger.payload_json.mac }}'
fw_ver: '{{ trigger.payload_json.fw_ver }}'
shelly1-XXXXXX-relay-0: 'light'
But my shelly1 is in any case in the switch group (switch.shelly1_XXXXXX_relay_0).
Is it correct?
If the letters are in the XXXXXX they should be upper case.
Thanks.
It works nice!
New version: 0.8.9
Changelog:
New version: 0.8.10
Changelog:
position_topic
(HA 0.93 required)New version: 0.9.0
Changelog:
Could you add RGBW2 white mode?
RGBW2 white mode is on my âto-doâ list.
New version: 0.9.1
Changelog:
shellyrgbw2-AABB22: 'white'
- means that Shelly RGBW2 works in white-modeshellyrgbw2-CC2211: 'rgbw'
- means that Shelly RGBW2 works in color-mode (default)shellyswitch-334455: 'cover'
- means that Shelly2 works in roller mode and useCan you please advice what configuration settings I should add to automations.yaml to use Shelly 2.5 in roller mode?
Iâve tried: shellyswitch25-73C874: 'cover'
the Shelly is discovered however appears as Switch in HA and when I switch the relay id does nothing.
Iam using your suggested template automations.yaml and Shelly 2.5 v1.4.9-shelly2.5-hotfix3
- id: 'shellies_discovery'
alias: 'Shellies Discovery'
trigger:
- platform: mqtt
topic: shellies/announce
action:
service: python_script.shellies_discovery
data_template:
id: '{{ trigger.payload_json.id }}'
mac: '{{ trigger.payload_json.mac }}'
fw_ver: '{{ trigger.payload_json.fw_ver }}'
EDIT: I use your new version : 0.9.1
I tried a while ago and Shelly2.5 was added as a cover.
Your automation should look like this:
- id: 'shellies_discovery'
alias: 'Shellies Discovery'
trigger:
- platform: mqtt
topic: shellies/announce
action:
service: python_script.shellies_discovery
data_template:
id: '{{ trigger.payload_json.id }}'
mac: '{{ trigger.payload_json.mac }}'
fw_ver: '{{ trigger.payload_json.fw_ver }}'
shellyswitch25-73C874: 'cover'
Did you restart HA? Sometimes you need two reboots or run twice an announce
automation.
Yes, Iâve tried to restart and also remove Entity and run discovery again. But it does not help.
I also see some additional errors in the log related to power consumption
2019-05-18 20:52:30 ERROR
(MainThread) [homeassistant.components.mqtt.sensor] Exception in async_discover_sensor when dispatching âmqtt_discovery_new_sensor_mqttâ: ({ânameâ: âShelly2.5 73C874 Power 0â, âstate_topicâ: âshellies/shellyswitch25-73C874/relay/0/powerâ, âunit_of_measurementâ: âWâ, âdevice_classâ: âpowerâ, âvalue_templateâ: â{{ value | float | round(1) }}â, âavailability_topicâ: âshellies/shellyswitch25-73C874/onlineâ, âpayload_availableâ: âtrueâ, âpayload_not_availableâ: âfalseâ, âunique_idâ: âshellyswitch25-73C874-relay-power-0â, âdeviceâ: {âidentifiersâ: [â######73C874â], ânameâ: âShelly2.5 73C874â, âmodelâ: âShelly2.5â, âsw_versionâ: â20190416-151347/v1.4.9-shelly2.5-hotfix3@26ed6ef3â, âmanufacturerâ: âShellyâ}, âplatformâ: âmqttâ},)
Traceback (most recent call last):
File â/usr/src/app/homeassistant/helpers/config_validation.pyâ, line 658, in call
return super().call(data)
File â/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.pyâ, line 267, in call
return self._compiled([], data)
File â/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.pyâ, line 589, in validate_dict
return base_validate(path, iteritems(data), out)
File â/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.pyâ, line 427, in validate_mapping
raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: value is not allowed for dictionary value @ data[âdevice_classâ]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File â/usr/src/app/homeassistant/components/mqtt/sensor.pyâ, line 70, in async_discover_sensor
config = PLATFORM_SCHEMA(discovery_payload)
File â/usr/src/app/homeassistant/helpers/config_validation.pyâ, line 670, in call
validated = super().call(data)
File â/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.pyâ, line 267, in call
return self._compiled([], data)
File â/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.pyâ, line 589, in validate_dict
return base_validate(path, iteritems(data), out)
File â/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.pyâ, line 427, in validate_mapping
raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: value is not allowed for dictionary value @ data[âdevice_classâ]
2019-05-18 20:52:30 ERROR (MainThread) [homeassistant.components.mqtt.sensor] Exception in async_discover_sensor when dispatching âmqtt_discovery_new_sensor_mqttâ: ({ânameâ: âShelly2.5 73C874 Energy 0â, âstate_topicâ: âshellies/shellyswitch25-73C874/relay/0/energyâ, âunit_of_measurementâ: âkWhâ, âdevice_classâ: âpowerâ, âvalue_templateâ: â{{ (value | float / 60 / 1000) | round(2) }}â, âavailability_topicâ: âshellies/shellyswitch25-73C874/onlineâ, âpayload_availableâ: âtrueâ, âpayload_not_availableâ: âfalseâ, âunique_idâ: âshellyswitch25-73C874-relay-energy-0â, âdeviceâ: {âidentifiersâ: [â807D3A73C874â], ânameâ: âShelly2.5 73C874â, âmodelâ: âShelly2.5â, âsw_versionâ: â20190416-151347/v1.4.9-shelly2.5-hotfix3@26ed6ef3â, âmanufacturerâ: âShellyâ}, âplatformâ: âmqttâ},)
Traceback (most recent call last):
File â/usr/src/app/homeassistant/helpers/config_validation.pyâ, line 658, in call
return super().call(data)
File â/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.pyâ, line 267, in call
return self._compiled([], data)
File â/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.pyâ, line 589, in validate_dict
return base_validate(path, iteritems(data), out)
File â/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.pyâ, line 427, in validate_mapping
raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: value is not allowed for dictionary value @ data[âdevice_classâ]
Which version of Home Assistant do you use?
I am using HA 0.91.4
Hi,
@Bieniu - thanks very much for this, Iâve successfully autodiscovered 8 shelly 2.5s using your script which saved me a lot of head scratching. I have a query you may know the answer to.
When I toggle one switch on a 2.5, both are marked as unavailable in HA until the switch transition is completed. So automations, e.g. turn on all kitchen lights, will fail sometimes on one relay, unless I add a delay between turning on relays in the same shelly.
Have you observed this? Any idea if this is solvable by config in HA?
Thanks very much, appreciate your efforts.
Iâve found adding the switches on each relay manually in configuration.xml works fine:
light: - platform: mqtt name: "Kitchen spotlights" state_topic: "shellies/shellyswitch25-740B37/relay/1" command_topic: "shellies/shellyswitch25-740B37/relay/1/command" qos: 2 payload_on: "on" payload_off: "off" - platform: mqtt name: "Kitchen island strip" state_topic: "shellies/shellyswitch25-5DBAD1/relay/0" command_topic: "shellies/shellyswitch25-5DBAD1/relay/0/command" qos: 2 payload_on: "on" payload_off: "off"
Like this I can add all switches to a group, and use homeassistant.turn_off on the group and all entities respond consistently straight away, whereas with the autodiscovery script entities i had to add a delay between the switching off entities in in the same 2.5. All good for me with manual config, just thought youâd want to know.
Cheers.
Script requires HA 0.93. You have to update HA or use version 0.8.1 of the script.
I had this issue when I updated Mosquitto to 1.6.x and I donât know what is the reason of the issue. With Mosquitto 1.5.x there is no issue.