Comments (4)
So I see this was removed here: #297 due to the white_value change.
The documentation says it to use COLOR_MODE. https://developers.home-assistant.io/docs/core/entity/light#color-modes
from ha-shellies-discovery.
The given examples use the default MQTT light schema and the script uses the template schema. I don't want to use the default schema because it doesn't support tansition
, so this would be a breaking change. Theoretically, we can use JSON schema for RGBW2, but I don't have a device and I'm not able to create a proper configuration. If you provide me a working configuration for the JSON schema, I'll try to implement it in a script.
EDIT:
I've read the documentation again and the JSON schema cannot be used for RGBW2.
from ha-shellies-discovery.
Please test the script from this branch https://github.com/bieniu/ha-shellies-discovery/compare/rgbw2-fix
from ha-shellies-discovery.
Got this error:
Exception in discovery_callback when dispatching 'mqtt_discovery_updated_('light', 'shellyrgbw2-A890BA-0')': ({'name': 'Shelly RGBW2 A890BA Light 0', 'availability_topic': 'shellies/shellyrgbw2-A890BA/online', 'payload_available': 'true', 'payload_not_available': 'false', 'command_topic': 'shellies/shellyrgbw2-A890BA/color/0/command', 'state_topic': 'shellies/shellyrgbw2-A890BA/color/0', 'state_value_template': '{{value.lower()}}', 'payload_on': 'on', 'payload_off': 'off', 'rgbw_command_topic': 'shellies/shellyrgbw2-A890BA/color/0/set', 'rgbw_command_template': "{'red':{{red}},'green':{{green}},'blue':{{blue}},'white':{{white}}}", 'rgbw_state_topic': 'shellies/shellyrgbw2-A890BA/color/0/status', 'rgbw_value_template': '{{value_json.red}},{{value_json.green}},{{value_json.blue}},{{value_json.white}}', 'brightness_state_topic': 'shellies/shellyrgbw2-A890BA/color/0/status', 'brightness_value_template': '{{value_json.gain|float|multiply(2.55)|round(0)}}', 'brightness_command_topic': 'shellies/shellyrgbw2-A890BA/color/0/set', 'brightness_command_template': "{'gain':{{value|float|multiply(0.3922)|round(0)}}}", 'effect_command_topic': 'shellies/shellyrgbw2-A890BA/color/0/set', 'effect_command_template': "{ {%if value=='Off'%}'effect':0{%elif value=='Meteor Shower'%}'effect':1{%elif value=='Gradual Change'%}'effect':2{%elif value=='Flash'%}'effect':3{%endif%} }", 'effect_list': ['Off', 'Meteor Shower', 'Gradual Change', 'Flash'], 'effect_state_topic': 'shellies/shellyrgbw2-A890BA/color/0/status', 'effect_value_template': '{%if value_json.effect==1%}Meteor Shower{%elif value_json.effect==2%}Gradual Change{%elif value_json.effect==3%}Flash{%else%}Off{%endif%}', 'unique_id': 'shellyrgbw2-a890ba-light-0', 'qos': 0, 'device': {'connections': [['mac', 'e8:db:84:a8:90:ba']], 'name': 'Shelly RGBW2 A890BA', 'model': 'Shelly RGBW2', 'sw_version': '20221027-095909/v1.12.1-ga9117d3', 'hw_version': 'gen1 (SHRGBW2)', 'manufacturer': 'Allterco Robotics', 'configuration_url': 'http://192.168.1.199/'}, 'platform': 'mqtt'},) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/mqtt/mixins.py", line 864, in discovery_callback await self._discovery_update(payload) File "/usr/src/homeassistant/homeassistant/components/mqtt/mixins.py", line 1057, in discovery_update config: DiscoveryInfoType = self.config_schema()(discovery_payload) File "/usr/local/lib/python3.10/site-packages/voluptuous/validators.py", line 232, in __call__ return self._exec((Schema(val) for val in self.validators), v) File "/usr/local/lib/python3.10/site-packages/voluptuous/validators.py", line 355, in _exec raise e if self.msg is None else AllInvalid(self.msg, path=path) File "/usr/local/lib/python3.10/site-packages/voluptuous/validators.py", line 351, in _exec v = func(v) File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 272, in __call__ return self._compiled([], data) File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 818, in validate_callable return schema(data) File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 272, in __call__ return self._compiled([], data) File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 595, in validate_dict return base_validate(path, iteritems(data), out) File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 433, in validate_mapping raise er.MultipleInvalid(errors) voluptuous.error.MultipleInvalid: required key not provided @ data['command_on_template']
Exception in discovery_callback when dispatching 'mqtt_discovery_updated_('light', 'shellyrgbw2-DE3731-0')': ({'name': 'Shelly RGBW2 DE3731 Light 0', 'availability_topic': 'shellies/shellyrgbw2-DE3731/online', 'payload_available': 'true', 'payload_not_available': 'false', 'command_topic': 'shellies/shellyrgbw2-DE3731/color/0/command', 'state_topic': 'shellies/shellyrgbw2-DE3731/color/0', 'state_value_template': '{{value.lower()}}', 'payload_on': 'on', 'payload_off': 'off', 'rgbw_command_topic': 'shellies/shellyrgbw2-DE3731/color/0/set', 'rgbw_command_template': "{'red':{{red}},'green':{{green}},'blue':{{blue}},'white':{{white}}}", 'rgbw_state_topic': 'shellies/shellyrgbw2-DE3731/color/0/status', 'rgbw_value_template': '{{value_json.red}},{{value_json.green}},{{value_json.blue}},{{value_json.white}}', 'brightness_state_topic': 'shellies/shellyrgbw2-DE3731/color/0/status', 'brightness_value_template': '{{value_json.gain|float|multiply(2.55)|round(0)}}', 'brightness_command_topic': 'shellies/shellyrgbw2-DE3731/color/0/set', 'brightness_command_template': "{'gain':{{value|float|multiply(0.3922)|round(0)}}}", 'effect_command_topic': 'shellies/shellyrgbw2-DE3731/color/0/set', 'effect_command_template': "{ {%if value=='Off'%}'effect':0{%elif value=='Meteor Shower'%}'effect':1{%elif value=='Gradual Change'%}'effect':2{%elif value=='Flash'%}'effect':3{%endif%} }", 'effect_list': ['Off', 'Meteor Shower', 'Gradual Change', 'Flash'], 'effect_state_topic': 'shellies/shellyrgbw2-DE3731/color/0/status', 'effect_value_template': '{%if value_json.effect==1%}Meteor Shower{%elif value_json.effect==2%}Gradual Change{%elif value_json.effect==3%}Flash{%else%}Off{%endif%}', 'unique_id': 'shellyrgbw2-de3731-light-0', 'qos': 0, 'device': {'connections': [['mac', 'e8:db:84:de:37:31']], 'name': 'Shelly RGBW2 DE3731', 'model': 'Shelly RGBW2', 'sw_version': '20221027-095909/v1.12.1-ga9117d3', 'hw_version': 'gen1 (SHRGBW2)', 'manufacturer': 'Allterco Robotics', 'configuration_url': 'http://192.168.1.173/'}, 'platform': 'mqtt'},) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/mqtt/mixins.py", line 864, in discovery_callback await self._discovery_update(payload) File "/usr/src/homeassistant/homeassistant/components/mqtt/mixins.py", line 1057, in discovery_update config: DiscoveryInfoType = self.config_schema()(discovery_payload) File "/usr/local/lib/python3.10/site-packages/voluptuous/validators.py", line 232, in __call__ return self._exec((Schema(val) for val in self.validators), v) File "/usr/local/lib/python3.10/site-packages/voluptuous/validators.py", line 355, in _exec raise e if self.msg is None else AllInvalid(self.msg, path=path) File "/usr/local/lib/python3.10/site-packages/voluptuous/validators.py", line 351, in _exec v = func(v) File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 272, in __call__ return self._compiled([], data) File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 818, in validate_callable return schema(data) File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 272, in __call__ return self._compiled([], data) File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 595, in validate_dict return base_validate(path, iteritems(data), out) File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 433, in validate_mapping raise er.MultipleInvalid(errors) voluptuous.error.MultipleInvalid: required key not provided @ data['command_on_template']
I'm trying to see if maybe the issue is that it doesn't set any "supported_color_modes". Not having a lot of luck with it though.
from ha-shellies-discovery.
Related Issues (20)
- Improve sensor templates
- Remove Wh -> kWh conversion
- Devices naming similar to Native Shelly Addon HOT 1
- Feature request: add long- and shortpush sensors again please HOT 5
- Support for SHCB-1 (Shelly Bulb RGBW GU10) HOT 12
- Shelly Door/Window 2 always show up as unavaliable after a restart of home assistant HOT 1
- Please add support for Shelly 3EM sensors when using the optional neutral current transformer
- Info: "mqtt":disabled? HOT 4
- SystemError: AST constructor recursion depth mismatch (before=33, after=60) HOT 10
- discovering shelly devices HOT 3
- Shelly UNI second binary input is not mapped
- Invalid event type error in logs HOT 1
- Invalid event type with latest version HOT 4
- TRV - Mapping valve_min_report and calculation of Idle/Heating mode HOT 10
- error: The device name prefix will be stripped... HOT 2
- Shelly Gen1 is not discovered correctly HOT 3
- Entities become unavailable when the battery-powered device goes to sleep with firmware 1.1.0
- Shelly UNI "ext_" parameters implementation to sensor HA block (entity) HOT 2
- Problem with Shelly Dimmer and MQTT connection flag. HOT 4
- Shelly Plus2PM announces with changed attributes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ha-shellies-discovery.