-
inXiaomi Smart Home via MQTT
This post is deleted! -
Hi OrTiN
mosquitto_sub -v -t 'xiaomi/#'
brought no success - just a mistake:
-bash: mosquitto_sub: Kommando nicht gefunden
pi@raspberrypi:~ $
I don’t know where the mistake is. As I said before, I am a mosquitto beginner - do I have to configure anything after installation?
Greetings
REVO -
Are your MQTT-Server Mosquito is running on the same machine were you opend the second console?
You must connect per ssh to the server where mosquito is running in the second console. -
@revo said in inXiaomi Smart Home via MQTT:
-bash: mosquitto_sub: Kommando nicht gefunden
Hi, do you have mosquitto clients installed?
sudo apt-get install mosquitto-clients
Pimatic = Smart Home
-
For me it was the most difficult plugin so far - but I managed it - with your help - thank you!
@V1per
You’re right, mosquitto runs on the Pimatic system and I had both consoles opened via SSH.@wutu
That was the clue I needed. it worked immediately after the installation.xiaomi/magnet/deviceID/status open
xiaomi/magnet/deviceID/status close
many thanks again,
Greetings
REVO -
@OrTiN : Thanks for the great write up! Worked great, but one little extra you might want to add up there: To be able to receive packages in your LAN, you’ll need to enable the developer mode: https://github.com/ioBroker/ioBroker.mihome
One more question: How do you handle the return of the state for motion sensors and push buttons? They only publish to mqtt when they are triggered… The Mqtt Device doesn’t have an auto set back setting…
Works great! Thanks again
-
You can simply publish an mqtt message to the relevant topic
Reset “no_motion”
publish mqtt message "0" on topic "xiaomi/motion/deviceID/no_motion"
Reset “motion”
publish mqtt message "-" on topic "xiaomi/motion/deviceID/status"
Switch action reset
when $xiaomi-smartswitch-test.smartswitch = "click" or $xiaomi-smartswitch-test.smartswitch = "double_click" or $xiaomi-smartswitch-test.smartswitch = "long_click_release" then publish mqtt message "-" on topic "xiaomi/switch/deviceID/status" after 5 seconds
-
@ortin said in inXiaomi Smart Home via MQTT:
You can simply publish an mqtt message to the relevant topic
Hi, thanks for your reply.
I created some rules in pimatic to reflect what I think is correct. Do you know if there is any delay for the movement sensors? They seem to react slow and once triggered, they rest for some time… My rules:Rule to return movement: when mqtt-movement is present then publish mqtt message "no_motion" on topic "xiaomi/motion/devid/status" after 5 seconds
Any ideas how to improve the sensors? Thanks a lot!!
-
Yes, there is some delay. The delay is something like 60s. In that time you can not retrigger the sensor. I made a rule to detect motion. A further rule reacts on no_motion for 180 seconds.
In this way the PIR works perfect. As long I’m in the kitchen for example the light is on. The period of 180s is long enough to retrigger the sensor and when I leave the the light will be switched of after a while. -
Dear all,
I have tested above mentioned Howto and it’s working perfect!! Thanks a lot!
By the way: is there a easy way to control the Gateway (RGB light and may radio) via Pimatic?
Thanks in advance!
Johann
-
@OrTiN
Nice and simple HowTo, like it very much! Thank you! -
@johann-prahm said in inXiaomi Smart Home via MQTT:
By the way: is there a easy way to control the Gateway (RGB light and may radio) via Pimatic?
Never checked. But I think it is possible somehow. Must find some time to go for it.
-
If anyone has a working script to publish commands to the gateway?
Found this one: https://github.com/hamwong/mihome (forked version of the git from topicstart) but it crashes after starting. Receiving info from the gateway multicast is working fine.Like my projects and help? Consider donating electroneum etnjwAKGPqF6omQWRmpp9u2BPyVDG9VuyRQjNJ1S8yfBdfR9qeUQ46kRy8KS2CNqbpNLRrsgmNW6F2TMzxmZgPrh6KctrkrYbm
-
I’ve made a plugin for the aqara Xiaomi gateway: https://www.npmjs.com/package/pimatic-aqara
-
Moved my post here: https://forum.pimatic.org/topic/4203/aqara-xiaomi-plugin-released/18