8000 No update in MQTT Binary Sensor · Issue #7478 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

No update in MQTT Binary Sensor #7478

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
elle2 opened this issue May 7, 2017 · 10 comments · Fixed by #8057
Closed

No update in MQTT Binary Sensor #7478

elle2 opened this issue May 7, 2017 · 10 comments · Fixed by #8057

Comments

@elle2
Copy link
elle2 commented May 7, 2017

Make sure you are running the latest version of Home Assistant before reporting an issue.

You should only file an issue if you found a bug. Feature and enhancement requests should go in the Feature Requests section of our community forum:

Home Assistant release (hass --version):
0.44.0

Python release (python3 --version):
3.4.2

Component/platform:
binary_sensor/mqtt

Description of problem:
HA receive the mqtt message with correct state_topic but there is no internal message to homeassistant.components.mqtt and there is no update of the binary_sensor

Expected:
Change of the binary_sensor state

Problem-relevant configuration.yaml entries and steps to reproduce:

binary_sensor:
  - platform: mqtt
      state_topic: "devices/ds18b201/$online"
      name: "Status DS18B20"
      payload_on: "true"
      payload_off: "false"
  1. 192.168.0.3 is IP address of MQTT Broker
  2. mosquitto_pub -h 192.168.0.3 -t "devices/ds18b201/$online" -m "true"
  3. mqtt broker send PUBLISH message to home assistant

Traceback (if applicable):

Additional info:
The same configuration worked in Home Assistant 0.43

In mqtt broker log file there is the mqtt PUBLISH message sent to HA.

In HA log there are other messages related to other mqtt messages received, for example:
2017-05-07 19:22:45 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on devices/ds18b201/temperature/degrees: 21.2

@fabaff
Copy link
Member
fabaff commented May 9, 2017

I doubt that your configuration worked as the indentation is wrong (or it's a copy-&-paste error).

As far as I remember are topics starting with $ treated specially. It could be that only $SYS works with the MQTT client implementation which we use.

@elle2
Copy link
Author
elle2 commented May 10, 2017

Yes, there is a copy&past error, this is my actual configuration:

binary_sensor:
  - platform: mqtt
    state_topic: "devices/ds18b201/$online"
    name: "Status DS18B20"
    payload_on: "true"
    payload_off: "false"

In Home Assistant release 0.43 the same configuration (and topic) worked well.

@fabaff
Copy link
Member
fabaff commented May 10, 2017

We updated paho-mqtt with #7214 for 0.43.1.

@modus-operandi
Copy link
modus-operandi commented May 10, 2017

Same issue for me with version 0.44.2 in the public docker container image. I tried rolling back to paho-mqtt==1.2.2 with no better results.

This is problematic for users of homie-esp8266 library since it exposes a fair amount of values using a $ symbol. This issue might be related to PR #7269 but I'd have to test to be sure. For now I'm just using 0.43.

@fabaff
Copy link
Member
fabaff commented May 11, 2017

Yes, looks like that subtopics starting with $ are no longer supported.

@dgomes
Copy link
Contributor
dgomes commented Jun 14, 2017

@modus-operandi I'm facing the same problem, did you figure some work-around ?

@modus-operandi
Copy link
modus-operandi commented Jun 15, 2017

@dgomes My workaround was to downgrade my home-assistant version to 0.43. I'm using docker so I just pulled the 0.43 image (homeassistant/home-assistant:0.43) and relaunched. IMO I'd still call this a bug rather than "dropping support" but I'm not bothered enough to write a PR for this.

@pezinek
Copy link
Contributor
pezinek commented Jun 15, 2017

@amigian74 I can confirm that PR #7269 is the root cause of this issue and should be IMO reverted, as the approach of matching topic with subscription by using regular expressions is just plain wrong (especially as PR #7269 does not correctly escape characters with special meaning). So for example subscription "/foo/.../" will match "/foo/bar/", anything having "^" or "$" on other place than at the beginning or end of a topic will never match anything, any braces will likely never match as well etc.

@balloob
Copy link
Member
balloob commented Jun 16, 2017

A PR is welcome to fix it @pezinek . But not a revert. The reason why it has been added still needs to be supported.

pezinek added a commit to pezinek/home-assistant that referenced this issue Jun 16, 2017
@pezinek
Copy link
Contributor
pezinek commented Jun 16, 2017

OK, if this change can't be reverted, then I'll fix the escaping of special characters at least, even though I still believe that using regexps in this case is a bad idea.

@balloob balloob mentioned this issue Jun 17, 2017
@balloob balloob mentioned this issue Jul 1, 2017
@home-assistant home-assistant locked and limited conversation to collaborators Oct 20, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants
1611
0