zewelor / bt-mqtt-gateway

A simple Python script which provides a Bluetooth to MQTT gateway, easily extensible via custom workers. See https://github.com/zewelor/bt-mqtt-gateway/wiki for more information.
MIT License
549 stars 116 forks source link

Replace deprecated hold and away modes with presets #266

Closed cybe closed 1 year ago

cybe commented 1 year ago

Description

This addresses #261 were the separate hold and away topics got deprecated and merged into a preset topic. The technical behavior should be the same as before. Asking for a review from @merll, @krasnoukhov or @zewelor.

Pointers:

Type of change

zewelor commented 1 year ago

Looks good thanks !

renarena commented 1 year ago

I made the changes and restarted the docker and HA, but still no preset modes:

Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/connection.py:140
Integration: Home Assistant WebSocket API (documentation, issues)
[139728229773184] Error handling message: Entity climate.thermostat_kitchen_climate does not support this service. (unknown_error)

Something else i have to do?

MQTT:

{...
"mode_state_topic": "thermostat/kitchen/mode", 
"mode_command_topic": "thermostat/kitchen/mode/set", 
"away_mode_state_topic": "thermostat/kitchen/away", 
"away_mode_command_topic": "thermostat/kitchen/away/set", 
"hold_state_topic": "thermostat/kitchen/hold", 
"hold_command_topic": "thermostat/kitchen/hold/set", 
"json_attributes_topic": "thermostat/kitchen/json_attributes", "min_temp": 5.0, "max_temp": 29.5, "temp_step": 0.5
"modes": ["heat", "auto", "off"], 
"hold_modes": ["boost", "comfort", "eco"], 
...
 }}"}
cybe commented 1 year ago

The MQTT snippet suggests that the fix is not in effect. There shouldn't be any away_mode* or hold* topics anymore. They got replaced with preset_mode* topics.

renarena commented 1 year ago

I edited the file in the docker container, executed docker-compose down and up, deleted the oldMQTT topic using MQTT Explorer. What else?

cybe commented 1 year ago

Do not edit the files inside the container. Just pull the new image, as it is already released:

docker-compose pull
docker-compose down
docker-compose up
renarena commented 1 year ago

sorry, the Hi, could you please try out https://github.com/zewelor/bt-mqtt-gateway/pull/266 ? looked not like there is an update i could pull, so i tried to patch the file. Now its working. Thank you!

cybe commented 1 year ago

You're welcome :)