Comments (9)
mqtt_room documentation
mqtt_room source
from core.
Adding to this - there is a lot of confusion around mqtt_room (well from ESPresense).
ESPresense 3.X uses a different topic (which will be deprecated in v4)
espresense/devices/deviceid
as shown in the MQTT_ROOM documentation @danielbrunt57 that might help? but also the below may not?
However - MQTT explorer shows MQTT topic is being populated:
espresense/devices/deviceid/roomname
with data
{"mac":"xxxxxxxxx","id":"watchultra2","name":"WatchUltra2","idType":250,"rssi@1m":-65,"rssi":-73,"raw":1.69,"distance":2.07,"var":0.37,"int":501}
There is something (i'm not skilled enough to identify what) where MQTT_ROOM is not picking up the new MQTT Topic structure properly.
ESPresense/ESPresense#1142
from core.
The new MQTT Topic structure might not the issue behind that. From what I can observe, all devices themself are recognized accordingly, if they are the only devices in the system. Or in other words: only the first device is recognized and initialized by mqtt_room integration.
In my system, I have two mqtt_room sensors, one is Pixel Watch, the other Pixel 7.
Within my configuration / package structure, the pixel 7 one was the first sensor in the list, Pixel Watch the last/second.
Therefore, Pixel Watch was not recognized anymore since 2024.06 Update of Home Assistant.
Changing the order in the pacakge structure or simply disabling the Pixel 7 sensor will let the other one (Pixel Watch) appear.
Activating again the alphabetically first sensor (Pixel 7) will let the Pixel watch disappear.
The message "Setup of sensor platform mqtt_room is taking over 10 seconds." only appears in the logs, if there are more than one sensor active configured.
So in my opinion, it's not the case, that something witihin the topic structure will cause the behaviour but somethin else.
For a workaround I also tried adding a dummy-sensor at the end of my configuration, starting with "z-..." and using a dummy beacon / device-id. But after it seems to work, it doesn't either.
from core.
I think my issue might be different as evidenced by these error messages in HA log after restart:
Logger: homeassistant.components.mqtt_room.sensor
Source: components/mqtt_room/sensor.py:85
integration: mqtt_room (documentation, issues)
First occurred: 3:54:47 AM (4 occurrences)
Last logged: 3:54:47 AM
MQTT integration is not available
2024-06-20 03:54:47.756 ERROR (MainThread) [homeassistant.components.mqtt_room.sensor] MQTT integration is not available
2024-06-20 03:54:47.757 ERROR (MainThread) [homeassistant.components.mqtt_room.sensor] MQTT integration is not available
2024-06-20 03:54:47.757 ERROR (MainThread) [homeassistant.components.mqtt_room.sensor] MQTT integration is not available
2024-06-20 03:54:47.757 ERROR (MainThread) [homeassistant.components.mqtt_room.sensor] MQTT integration is not available
from core.
I also noticed these messages. First thought that they had to do with my dummy test sensor. But as you mentioned you getting the same, I removed the dummy sensor and still seeing this message. But I got only one (because I only have 2 mqtt_room sensors in total).
The behaviour might have changed within the last Core Update (2024.6.3), because I'm 100% sure, that at first, there were only the messages "taking over 10 secs".
How many mqtt_room sensors you have in total? I'm wondering, because your config example shows 4 but also you have 4 ERRORs "MQTT is not available" Therefore, I would expect you have 5 sensors in total?
from core.
When I posted, I had 4 and 3 were not working and there were 3 MQTT error messages. That was HA 2024.6.3. I restored HA 2024.6.2 during troubleshooting the alexa media player initialization issues which restored my sensors file with 5 mqtt_room sensors and now have 4 MQTT error messages. Clear as mud???
from core.
The errors are emanating from here in mqtt_room/sensor,py on all config entries after the first one:
from core.
So, I hacked the code and commented out the if not await...
section, restarted HA and all 5 sensors initialized!
I used Portainer to go into the homeassitant container and the mqtt_room sensor.py file is here; homeassistant:/usr/src/homeassistant/homeassistant/components/mqtt_room
#
I edited sensor.py and commented out the three lines that generate the MQTT error:
async def async_setup_platform(
hass: HomeAssistant,
config: ConfigType,
async_add_entities: AddEntitiesCallback,
discovery_info: DiscoveryInfoType | None = None,
) -> None:
"""Set up MQTT room Sensor."""
# Make sure MQTT integration is enabled and the client is available
# We cannot count on dependencies as the sensor platform setup
# also will be triggered when mqtt is loading the `sensor` platform
# if not await mqtt.async_wait_for_mqtt_client(hass):
# _LOGGER.error("MQTT integration is not available")
# return
async_add_entities(
[
MQTTRoomSensor(
config.get(CONF_NAME),
config[CONF_STATE_TOPIC],
config[CONF_DEVICE_ID],
config[CONF_TIMEOUT],
config[CONF_AWAY_TIMEOUT],
config.get(CONF_UNIQUE_ID),
)
]
)
Something is seriously not right in the code logic now!
This component needs to be migrated to a config_flow setup!
It's 6:25 am here and I'm going to bed...
from core.
Well, that did not fix the issue, it only masked it as the mqtt_room sensors looked okay but they were totally not working as they all showed as not_home
. So, after digging further I came up with this workaround instead of my edit to sensor.py
:
In manifest.json
, add "hacs" to dependencies:
"domain": "mqtt_room",
"name": "MQTT Room Presence",
"codeowners": [],
"dependencies": ["mqtt","hacs"],
"documentation": "https://www.home-assistant.io/integrations/mqtt_room",
"iot_class": "local_push"
}
All 5 of my sensors are now working:
from core.
Related Issues (20)
- Group sensor loses its `state_class`, `device_class`, and `unit_of_measurement` for no apparent reason. HOT 1
- Unsupported Tuya Switch
- HA losing connect with Overkiz frequently while using local API HOT 6
- Validation Error: Timeout on Writing to Nibe Heat Pump During Configuration HOT 8
- New Aladdin Connect integration requires OAuth credentials, no documentation for retrieval HOT 20
- Error when calling the service number/set_value. unknown error HOT 2
- Trådfri integration says lamps are entities no longer used HOT 5
- Problem with group.awesome_people
- Tibber integration does not update monthly cost since June 18 HOT 2
- mFI mPower Ubiquity can not be paired to HomeAssistant. The provided documentation does not work anymore (after update) HOT 1
- Zooz Multi-Relay Zen16 keeps creating new sensors HOT 1
- Setting fan speed from homekit automation results in incorrect speed HOT 5
- Icon format in forecast changed HOT 9
- Growatt integration doesn't provide most entities for Growatt NOAH 2000 Balcony Solar Storage HOT 1
- Light transitions from and to 0% no longer work HOT 3
- Tuya Fan Controller showing zero entities
- Input Numbers not showing up for utility meters HOT 1
- Number increment should support an optional number to raise by and templating support HOT 1
- assist on web client and android cannot start timers HOT 2
- ESPHome Dallas Temp Update-Interval HOT 2
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 core.