home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.25k stars 30.59k forks source link

After updating core-2023.6.3 wattmeter not working #95600

Closed nokia321 closed 1 year ago

nokia321 commented 1 year ago

The problem

Hello. Since the last update, the Watt meter has stopped showing. Integration via MQQT. After returning the older version, the wattmeter is functional.

What version of Home Assistant Core has the issue?

core-2023.6.3

What was the last working version of Home Assistant Core?

core-2023.6.1

What type of installation are you running?

Home Assistant OS

Integration causing the issue

core-2023.6.3

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 year ago

Hey there @emontnemery, @jbouwh, mind taking a look at this issue as it has been labeled with an integration (mqtt) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `mqtt` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign mqtt` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


mqtt documentation mqtt source (message by IssueLinks)

jbouwh commented 1 year ago

What do you mean with the Watt meter. Is there any configuration or documentation you can refer to that can help to understand your issue and how to reproduce it?

daaex1 commented 1 year ago

Since Update to 2023.6.3 no Devices available in the MQTT Device Entitiy. With MQTT Explorer i see all devices. grafik grafik

jbouwh commented 1 year ago

Your view show the state. Can you post the config message and the state payload message from above? May be there was a change in Zigbee2Mqtt, if so, open an issue at the Zigbee2Mqtt repo.

daaex1 commented 1 year ago

Hy thanks for your msg.

Do you mean this one ? Sorry im new to zigbee2mqtt and mosquitto broker.

02.07.2023 08:47:23

{"commit":"b014857","coordinator":{"meta":{"maintrel":"3 ","majorrel":"6","minorrel":"10","product":8,"revision":"6.10.3.0 build 297"},"type":"EZSP v8"},"log_level":"info","network":{"channel":11,"extendedPanID":221,"panID":6754},"permit_join":false,"version":"1.32.0-dev"} 02.07.2023 08:47:10(-12.98 seconds)

{"commit":"b014857","coordinator":{"meta":{"maintrel":"3 ","majorrel":"6","minorrel":"10","product":8,"revision":"6.10.3.0 build 297"},"type":"EZSP v8"},"log_level":"info","network":{"channel":11,"extendedPanID":221,"panID":6754},"permit_join":false,"version":"1.32.0-dev"} 02.07.2023 08:45:52(-78.53 seconds)

{"commit":"b014857","coordinator":{"meta":{"maintrel":"3 ","majorrel":"6","minorrel":"10","product":8,"revision":"6.10.3.0 build 297"},"type":"EZSP v8"},"log_level":"info","network":{"channel":11,"extendedPanID":221,"panID":6754},"permit_join":false,"version":"1.32.0-dev"} 02.07.2023 08:45:50(-1.58 seconds)

{"commit":"b014857","coordinator":{"meta":{"maintrel":"3 ","majorrel":"6","minorrel":"10","product":8,"revision":"6.10.3.0 build 297"},"type":"EZSP v8"},"log_level":"info","network":{"channel":11,"extendedPanID":221,"panID":6754},"permit_join":false,"version":"1.32.0-dev"} 02.07.2023 08:44:36(-74.47 seconds)

{"commit":"b014857","coordinator":{"meta":{"maintrel":"3 ","majorrel"

2023-07-02 08:28:11.010 ERROR (MainThread) [homeassistant.util.logging] Exception in async_discover when dispatching 'mqtt_discovery_new_sensor_mqtt': ({'availability': [{'topic': 'zigbee2mqtt/bridge/state'}], 'device': {'configuration_url': '/api/hassio_ingress/JgdzaRsadO5jWjhSXcce84LvNQsfH_K7tDNFL0d0XT0/#/device/0xa4c138169d07ae76/info', 'identifiers': ['zigbee2mqtt_0xa4c138169d07ae76'], 'manufacturer': 'TuYa', 'model': 'Soil sensor (TS0601_soil)', 'name': 'Soil 2'}, 'device_class': 'temperature', 'enabled_by_default': True, 'json_attributes_topic': 'zigbee2mqtt/Soil 2', 'name': 'Soil 2 temperature', 'state_class': 'measurement', 'state_topic': 'zigbee2mqtt/Soil 2', 'unique_id': '0xa4c138169d07ae76_temperature_zigbee2mqtt', 'unit_of_measurement': '°C', 'value_template': '{{ value_json.temperature }}', 'platform': 'mqtt'},) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/mqtt/mixins.py", line 270, in async_discover config: DiscoveryInfoType = discovery_schema(discovery_payload) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/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.11/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.11/site-packages/voluptuous/validators.py", line 351, in _exec v = func(v) ^^^^^^^ File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 272, in call return self._compiled([], data) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 818, in validate_callable return schema(data) ^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 272, in call return self._compiled([], data) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 595, in validate_dict return base_validate(path, iteritems(data), out) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 433, in validate_mapping raise er.MultipleInvalid(errors) voluptuous.error.MultipleInvalid: invalid url for dictionary value @ data['device']['configuration_url']

Thanks vor futher assist.

Best regards

jbouwh commented 1 year ago

It seems that the configuration payload has an invalid device URL in the device configuration. The value in the payload is not a valid URL. I suggest you open an issue at https://github.com/Koenkk/zigbee2mqtt/issues. Please include the logs you also added here. As this is not an issue with HA, I will need to close the issue here. I hope you understand that.

jbouwh commented 1 year ago

Sorry I just realized the failure is is not about the watt meter. The config message published under homeassistant/{platform}/some_id/config. You should check the config published if it is valid.

daaex1 commented 1 year ago

ok can you advise me, where to check ?

jbouwh commented 1 year ago

You can find the configs in MQTT explorer under homeassistant/* topic. Find the config topic that does not work and the corresponding state payload.

daaex1 commented 1 year ago

all devices working and all states ar visible trough the mqtt explorer. but MQTT with Mosquitto won't show any devices. grafik

jbouwh commented 1 year ago

Mqtt will only show devices if the config is valid.

daaex1 commented 1 year ago

{ "availability": [ { "topic": "homeassistant/bridge/state" } ], "device": { "configuration_url": "/api/hassio_ingress/JgdzaRsadO5jWjhSXcce84LvNQsfH_K7tDNFL0d0XT0/#/device/0xa4c138c8f579aecb/info", "identifiers": [ "zigbee2mqtt_0xa4c138c8f579aecb" ], "manufacturer": "TuYa", "model": "Soil sensor (TS0601_soil)", "name": "Soil3" }, "enabled_by_default": true, "icon": "mdi:water-percent", "json_attributes_topic": "homeassistant/Soil3", "name": "Soil3 soil moisture", "state_class": "measurement", "state_topic": "homeassistant/Soil3", "unique_id": "0xa4c138c8f579aecb_soil_moisture_homeassistant", "unit_of_measurement": "%", "value_template": "{{ value_json.soil_moisture }}" }

jbouwh commented 1 year ago

Right. Also here the configuration url fails the schema. May be the url is missing the host part intentionally.

jbouwh commented 1 year ago

@Koenkk I the configuration URL intentionally not following a standard URL schema?

daaex1 commented 1 year ago

i can't change the url under zigbee2mqtt edge > settings > frontend. the url keeps resetting.

jbouwh commented 1 year ago

I know, that is why I asked @Koenkk. It might just work if we would loosen the URL validation.

daaex1 commented 1 year ago

thanks a lot ;-)

jbouwh commented 1 year ago

{ "availability": [ { "topic": "homeassistant/bridge/state" } ], "device": { "configuration_url": "/api/hassio_ingress/JgdzaRsadO5jWjhSXcce84LvNQsfH_K7tDNFL0d0XT0/#/device/0xa4c138c8f579aecb/info", "identifiers": [ "zigbee2mqtt_0xa4c138c8f579aecb" ], "manufacturer": "TuYa", "model": "Soil sensor (TS0601_soil)", "name": "Soil3" }, "enabled_by_default": true, "icon": "mdi:water-percent", "json_attributes_topic": "homeassistant/Soil3", "name": "Soil3 soil moisture", "state_class": "measurement", "state_topic": "homeassistant/Soil3", "unique_id": "0xa4c138c8f579aecb_soil_moisture_homeassistant", "unit_of_measurement": "%", "value_template": "{{ value_json.soil_moisture }}" }

This is not your watt meter BTW

jbouwh commented 1 year ago

Unfortunally, the URL does not work (a schema fix is not enough) , the schema and host part must be added to make it work in the frontend. This must be fix in Zigbee2MQTT which is no part of Home Assistant.

jbouwh commented 1 year ago

See https://github.com/Koenkk/zigbee2mqtt/issues/18170

jbouwh commented 1 year ago

@nokia321 As you can see this issue already exists. So for now I am going the close this issue as we won't fix this in HA.

nokia321 commented 1 year ago

Unfortunately, it is difficult for me to solve it, so I threw away the zigbee TuYa PJ-MGW1203 wattmeter and ordered Shelly EM.