Comments (12)
sensor:
- platform: mqtt
state_topic: "zigate/attribute_changed/21d3/01/0402/0000"
name: 'Temperature'
unit_of_measurement: "°C"
value_template: '{{ value_json.value }}'
This is a Xiaomi temperature sensor, addr 21d3, endpoint 01, cluster 0x0402, attribute 0x0000
I agree it's not really user friendly, but it works
from zigate.
Currently I use it with Home Assistant
from zigate.
Cool, I will try to use it with mosquitto on OpenHab
from zigate.
Closing since no update
from zigate.
Hi @doudz, since you said you were doing it, I'm trying to integrate my ZiGate (plugged with USB-TTL module) with Home Assistant using your MQTT broker implementation as it certainly is the most elegant way to do it.
However I'm currently struggling figuring out the proper configuration.
Is device discovery supposed to work with Home Assistant's MQTT discovery?
Are the topics for discovery, command and state supposed to match out of the box?
Or is customization needed?
Here what I've tried right now but I doubt this would ever work as Home Assistant expects the discovery topic to follow the <discovery_prefix>/<component>/[<node_id>/]<object_id>/<>
format:
mqtt:
discovery: true
discovery_prefix: zigate/device_changed
light:
- platform: mqtt
command_topic: "zigate/command"
Also, I guess state_value_template
are needed to extract values from messages as described at https://www.home-assistant.io/components/light.mqtt/
Would you mind sharing an example Home Assistant configuration snippet for your MQTT broker?
from zigate.
Hmm, I just stumbled on https://github.com/Koenkk/zigbee2mqtt and https://github.com/danielwelch/hassio-zigbee2mqtt
from zigate.
Oh... That's what I was looking for before buying a zigate...
from zigate.
Currently my mqtt broker doesn't support discovery.
I'll send you a example of what I use on my system soon
from zigate.
Thanks, that helped!
FWIW, here is the best I have managed to achieve so far with the MQTT Template Light platform to control my IKEA Tradfri Lights (on/off and level control working):
light:
- platform: mqtt_template
command_topic: "zigate/command"
command_on_template: >
{%- if brightness is defined -%}
{"function": "action_move_level_onoff", "args": ["5c2f", 1, 1, {{ brightness / 255 * 100 }}]}
{%- else -%}
{"function": "action_onoff", "args": ["5c2f", 1, 1]}
{%- endif -%}
command_off_template: '{"function": "action_onoff", "args": ["5c2f", 1, 0]}'
optimistic: true
brightness_template: '' # Not None to allow controlling brightness
state_topic: "zigate/attribute_changed/5c2f/01/0006/0000"
state_template: '{{ value_json["value"] }}'
This still misses light level state changes and initial device state messages pushed to zigate/device_changed/5c2f
.
Now, none of the current MQTT light platforms is gathering all required features to allow for a perfect fit:
light.mqtt
is missing command templates features to be able to format command messages as JSONlight.mqtt_template
is missing abrightness_state_topic
option to processzigate/attribute_changed/5c2f/01/0008/0000
messages.light.mqtt_json
is missing command templates and abrightness_state_topic
option to processzigate/attribute_changed/5c2f/01/0008/0000
messages.
At this point, I'm considering to adapt your project (what's the license by the way?) to send all device and attribute change events to the same topic and use the mqtt.light_template
platform with some configuration like the following:
light:
- platform: mqtt_template
command_topic: "zigate/command"
command_on_template: >
{%- if brightness is defined -%}
{"function": "action_move_level_onoff", "args": ["5c2f", 1, 1, {{ brightness / 255 * 100 }}]}
{%- else -%}
{"function": "action_onoff", "args": ["5c2f", 1, 1]}
{%- endif -%}
command_off_template: '{"function": "action_onoff", "args": ["5c2f", 1, 0]}'
state_topic: "zigate/device_changed/5c2f"
state_template: '{{ value_json["endpoints"][0]["clusters"][0]["attributes"]["value"] }}'
brightness_template: '{{ value_json["endpoints"][0]["clusters"][1]["attributes"]["value"] }}'
from zigate.
Yes I agree, I think there's no other way .
About the licence, I have no choose right now, but the MIT licence is probably the best choice
from zigate.
Oh... That's what I was looking for before buying a zigate...
@doudz quite off-topic, but why did you choose a zigate instead ?
I'm owning one and I've just bought stuff to try to replace it by zigbee2mqtt.
from zigate.
@lolorc what was your problem with ZiGate?
from zigate.
Related Issues (20)
- Erreur de dépendance HOT 21
- Question sur le SmartButton HUE HOT 1
- Erreur lors de l'installation des dépendances HOT 2
- Error when clicking a lot on xiaomi switch button HOT 1
- [New feature]&[Bug] "Permit join" for specific router HOT 3
- Unknown response 0x8035 on Aqara Window Door Sensor HOT 4
- Erreur JavaScript HOT 1
- Failed to eval "decode_xiaomi(value)
- Event is not JSON serializable: <Event zigate.attribute_updated[L] ...> HOT 4
- How to join an existing network ? HOT 4
- Adding new devices HOT 1
- Uncaught TypeError: Cannot read property 'id' of undefined
- Probleme switch IKEA E1743
- Support for firmware 3.1d HOT 1
- Supprimer toutes les données pour migration Homeassistante --> ZHA HOT 2
- Zigate2zigpy utilisable ? HOT 2
- installation zigate HOT 5
- No available actions on Sunricher Micro Smart Dimmer HOT 13
- struct.error: unpack requires a buffer of 9 bytes
- Problem with MQTT publishing
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 zigate.