Giter VIP home page Giter VIP logo

Comments (4)

pjrt avatar pjrt commented on September 22, 2024

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.

bieniu avatar bieniu commented on September 22, 2024

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.

bieniu avatar bieniu commented on September 22, 2024

Please test the script from this branch https://github.com/bieniu/ha-shellies-discovery/compare/rgbw2-fix

from ha-shellies-discovery.

pjrt avatar pjrt commented on September 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.