Comments (16)
Hi, I'm on holiday! I'll test it after New Years Day. Bye
from bt-mqtt-gateway.
@unconfigured Can you maybe help?
@jumping2000 Please post your config.yaml?
from bt-mqtt-gateway.
@bbbenji here my config,yaml
mqtt:
host: 192.168.1.101
port: 1883
username: xxxxxx
password: xxxxxx
topic_prefix:
client_id: bt-mqtt-gateway
manager:
topic_subscription:
update_all:
topic: homeassistant/status
payload: online
workers:
thermostat:
args:
devices:
salotto1: 00:1a:22:0c:XX:XX
salotto2: 00:1a:22:0f:XX:XX
topic_prefix: thermostat
topic_subscription: thermostat/+/+/set
update_interval: 100
miflora:
args:
devices:
orchidea: C4:7C:8D:xx:xx:XX
sansevieria: C4:7C:8D:XX:XX:XX
topic_prefix: miflora
update_interval: 600
from bt-mqtt-gateway.
@jumping2000 Looks like you got empty topic_prefix in your config, deleting it should fix that issue. I've also fixed handling case when topic_prefix is empty string, please test this branch https://github.com/zewelor/bt-mqtt-gateway/tree/fix_global_topic_prefix_handling , on your current config ( before removing empty topic_prefix in mqtt config block ).
from bt-mqtt-gateway.
@zewelor thank you, this evening I will try the fix :-)
I have a simple request for you and @bbbenji , I wrote a worker module to scan ble devices like nut beacons (I modified the miscale module) , could you help me to implement the scanning of multiple devices?
https://github.com/jumping2000/bt-mqtt-gateway/blob/master/workers/blescan.py
from bt-mqtt-gateway.
@jumping2000 sure I can take a look. Currently I'm on vacation and I will be back in 2 weeks. Here I don't have setup to test it. From quick look at the code:
https://github.com/jumping2000/bt-mqtt-gateway/blob/master/workers/blescan.py#L39 add some array to keep all of the devices, like self._devices = []. Split ScanProcessor into some single device class, only with mac and presence, and build new device each time handleDiscovery finds new device, and add it to the self._devices arrar . Then you can make property with that array and publish mqtt messages, single per each device ? Similar like here: https://github.com/jumping2000/bt-mqtt-gateway/blob/master/workers/thermostat.py#L98 , just return big array of all messages. I think its better to return single device per mqtt message, than one big json payload with all devices.
from bt-mqtt-gateway.
@jumping2000 Looks like you got empty topic_prefix in your config, deleting it should fix that issue. I've also fixed handling case when topic_prefix is empty string, please test this branch https://github.com/zewelor/bt-mqtt-gateway/tree/fix_global_topic_prefix_handling , on your current config ( before removing empty topic_prefix in mqtt config block ).
Hi, sorry for the delay, I tried both the master and fix-global-config prefix, but the error is still present when I try to update the temperature of the valve using the Home assistant interface.
I think the problem is related to this topic:
thermostat/salotto1/target_temperature/set
"on command wrapper for with thermostat/salotto1/target_temperature/set: b'16.0'
not enough values to unpack (expected 4, got 3)"
from bt-mqtt-gateway.
Try to delete "topic_prefix:" from your config, as its empty so I assume you are not using it ?
from bt-mqtt-gateway.
Try to delete "topic_prefix:" from your config, as its empty so I assume you are not using it ?
I started from scratch;
- sudo rm -r bt-mqtt-gateway
- git clone https://github.com/zewelor/bt-mqtt-gateway.git
- git merge origin/fix_global_topic_prefix_handling
- deleted "topic_prefix:" from my config
I have the error whn I try to change temperature or mode:
temperature error
on command wrapper for with thermostat/salotto1/target_temperature/set: b'18.0'
not enough values to unpack (expected 4, got 3)
Traceback (most recent call last):
File "./gateway.py", line 37, in <module>
mqtt.publish(_WORKERS_QUEUE.get(block=True).execute())
File "/home/dietpi/bt-mqtt-gateway/workers_manager.py", line 26, in execute
messages = self._callback(*self._args)
File "/home/dietpi/bt-mqtt-gateway/workers/thermostat.py", line 75, in on_command
_, device_name, method, _ = topic[len(self.topic_prefix+"/"):].split('/')
ValueError: not enough values to unpack (expected 4, got 3)
not enough values to unpack (expected 4, got 3)
Traceback (most recent call last):
File "./gateway.py", line 37, in <module>
mqtt.publish(_WORKERS_QUEUE.get(block=True).execute())
File "/home/dietpi/bt-mqtt-gateway/workers_manager.py", line 26, in execute
messages = self._callback(*self._args)
File "/home/dietpi/bt-mqtt-gateway/workers/thermostat.py", line 75, in on_command
_, device_name, method, _ = topic[len(self.topic_prefix+"/"):].split('/')
ValueError: not enough values to unpack (expected 4, got 3)
on command wrapper for with thermostat/salotto2/target_temperature/set: b'18.0'
mode error
on command wrapper for with thermostat/salotto1/mode/set: b'manual'
not enough values to unpack (expected 4, got 3)
Traceback (most recent call last):
File "./gateway.py", line 37, in <module>
mqtt.publish(_WORKERS_QUEUE.get(block=True).execute())
File "/home/dietpi/bt-mqtt-gateway/workers_manager.py", line 26, in execute
messages = self._callback(*self._args)
File "/home/dietpi/bt-mqtt-gateway/workers/thermostat.py", line 75, in on_command
_, device_name, method, _ = topic[len(self.topic_prefix+"/"):].split('/')
ValueError: not enough values to unpack (expected 4, got 3)
not enough values to unpack (expected 4, got 3)
Traceback (most recent call last):
File "./gateway.py", line 37, in <module>
mqtt.publish(_WORKERS_QUEUE.get(block=True).execute())
File "/home/dietpi/bt-mqtt-gateway/workers_manager.py", line 26, in execute
messages = self._callback(*self._args)
File "/home/dietpi/bt-mqtt-gateway/workers/thermostat.py", line 75, in on_command
_, device_name, method, _ = topic[len(self.topic_prefix+"/"):].split('/')
ValueError: not enough values to unpack (expected 4, got 3)
from bt-mqtt-gateway.
It could be that global and per thermostat "topic_prefixes" are messed up due to my patch which should have fixed the global topic_prefix. I will have a look at it shortly.
from bt-mqtt-gateway.
It could be that global and per thermostat "topic_prefixes" are messed up due to my patch which should have fixed the global topic_prefix. I will have a look at it shortly.
thank you!
from bt-mqtt-gateway.
@unconfigured also please take a look at your code with
topic[len(self.topic_prefix+"/"):].split('/')
Now I see possible danger with that style, only len of topic is checked. I think it should be more like regexp with string start to remove start of the string, including "/", when string starts with self.topic_prefix.
from bt-mqtt-gateway.
@jumping2000 Please test the latest commit: 33580dd
from bt-mqtt-gateway.
@jumping2000 Please test the latest commit: 33580dd
Hello,
it seems to work!! thank you
on command wrapper for with thermostat/salotto1/target_temperature/set: b'19.5'
on command wrapper for with thermostat/salotto1/target_temperature/set: b'19.5'
[{'topic': 'thermostat/salotto1/low_battery', 'payload': False}, {'topic': 'thermostat/salotto1/valve_state', 'payload': 89}, {'topic': 'thermostat/salotto1/target_temperature', 'payload': 19.5}, {'topic': 'thermostat/salotto1/window_open', 'payload': False}, {'topic': 'thermostat/salotto1/locked', 'payload': False}, {'topic': 'thermostat/salotto1/mode', 'payload': 'heat'}, {'topic': 'thermostat/salotto1/away', 'payload': 'off'}]
[{'topic': 'thermostat/salotto1/low_battery', 'payload': False}, {'topic': 'thermostat/salotto1/valve_state', 'payload': 89}, {'topic': 'thermostat/salotto1/target_temperature', 'payload': 19.5}, {'topic': 'thermostat/salotto1/window_open', 'payload': False}, {'topic': 'thermostat/salotto1/locked', 'payload': False}, {'topic': 'thermostat/salotto1/mode', 'payload': 'heat'}, {'topic': 'thermostat/salotto1/away', 'payload': 'off'}]
from bt-mqtt-gateway.
@jumping2000 we can close that issue ?
from bt-mqtt-gateway.
@jumping2000 we can close that issue ?
Yes!! thank you
P.S. with a friend we are testing a new "worker" to scan the BLE devices!
from bt-mqtt-gateway.
Related Issues (20)
- node_id = mac.replace(":", "-") = AttributeError: 'dict' object has no attribute 'replace' HOT 1
- Does it work with ESPHome?
- Problem with negative temperature / signed values HOT 1
- Gateway not starting as systemctl service HOT 2
- solved: Type error HOT 1
- hardware compatibility HOT 13
- Clarify why this needs to be run in a virtual environment HOT 1
- null values from LYWSD03MMC HOT 5
- blescanmulti worker not publishing to MQTT
- Systemd Installation like in README does not work, service.sh might have superfluous sudo
- Error message if bt-mqtt-gateway is started as home assistant addon HOT 8
- Support for MQTT climate hold and away modes has been removed in HA. HOT 2
- Missing MQTT messages HOT 2
- Anyway to setup on qnap?
- Docker configure.yaml HOT 1
- maybe use eq3btsmart to modernize eq3 thermostat handling? HOT 2
- 100% cpu load from bluepy-helper HOT 2
- Linak Desk Set commands
- Please, Delete this issue
- README venv installation instructions are incorrect
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 bt-mqtt-gateway.