Comments (21)
The inverse is also true. If the Switch is updated if homebridge is offline, the state will not be synced up - if you want the device to hold the ground truth of the system.
you would like mqtt-thing to republish all MQTT topics at start-up with current values in Homekit?
What I would find useful would be to have the plugin get the current state of the device on homebridge startup. E.g., with mqtt-switch-tasmota
you could use the startup command for this:
"startCmd": "cmnd/lights/POWER1",
"startParameter": ""
from homebridge-mqttthing.
Hi,
What are you using "stateGet": "tele/sypialnia/STATE"
for, if anything? This isn't a valid topic configuration setting for mqttthing. Is this the subject used by the physical switch on the wall?
If you want to control a light from a switch, you have two options:
-
Publish the
setOn
topic from your switch to drive the light directly, and make sure that the light responds to asetOn
with a correspondinggetOn
to update the homekit status. -
Add the switch separately to homekit (perhaps using mqttthing type Switch), and configure automations in Homekit to switch on/off the light when the switch state changes.
If your light doesn't publish to confirm that it's state has changed (through its getOn
topic), you might be able to configure a simpler version fo the first option by using the same topic for the light and the switch and configuring this as the light's getOn
and setOn
, but I haven't tried this.
from homebridge-mqttthing.
I do not know how to configure it correctly :(
In the console in tasmota I have such topics:
16:14:07 MQT: stat/sypialnia/RESULT = {"POWER":"OFF"}
16:14:07 MQT: stat/sypialnia/POWER = OFF
16:14:13 MQT: stat/sypialnia/RESULT = {"POWER":"ON"}
16:14:13 MQT: stat/sypialnia/POWER = ON
16:14:27 MQT: tele/sypialnia/STATE = {"Time":"2018-08-15T16:14:27","Uptime":"24T22:48:40","Vcc":3.219,"POWER":"ON","Wifi":{"AP":1,"SSId":"Tenda_2G","RSSI":100,"APMac":"C8:3A:35:2B:E2:01"}}
from homebridge-mqttthing.
This work property with plugin "mqtt-switch-tasmota" :
{
"accessory": "mqtt-switch-tasmota",
"switchType": "light",
"type": "light",
"url": "mqtt://192.168.99.100",
"username": "",
"password": "",
"topics": {
"statusGet": "stat/salon_lampa/POWER",
"statusSet": "cmnd/salon_lampa/power",
"stateGet": "tele/salon_lampa/STATE"
},
"onValue": "ON",
"offValue": "OFF",
"activityTopic": "tele/salon_lampa/LWT",
"activityParameter": "Online",
"startCmd": "cmnd/salon_lampa/TelePeriod",
"startParameter": "120",
"manufacturer": "Itead",
"model": "Sonoff Basic",
"serialNumberMAC": "5C:CF:7F:7A:6C:4D",
"name": "Salon Lampa Switch"
}
How do I properly set the light bulb accessories with mqttthing?
from homebridge-mqttthing.
OK I already know :) The meaning is case-sensitive in topic. Not "Power" but "POWER".
This is the correct configuration:
{
"accessory": "mqttthing",
"type": "lightbulb",
"name": "Salon lampa",
"url": "mqtt://192.168.99.100",
"username": "",
"password": "",
"caption": "",
"topics": {
"getOn": "stat/salon_lampa/POWER",
"setOn": "cmnd/salon_lampa/power"
},
"integerValue": "true",
"onValue": "ON",
"offValue": "OFF"
}
I do not understand the "integerValue" parameter until the end. Is he supposed to be "true" or "false" in my case?
from homebridge-mqttthing.
integerValue: true
can be used as a shortcut for onValue: "1", offValue: "0"
- as the default on/off values are "true" and "false". (If I remember correctly, integerValue
was a configuration setting supported by one of the add-ins that I looked at before writing mqttthing - and I implemented it for compatibility before onValue
and offValue
.) However, since you're setting them to "ON" and "OFF" it will have no effect. Configuring onValue
and offValue
takes precedence over any integerValue
setting.
Boolean types like on/off use true/false unless
integerValue: true
is configured, in which case they default to 1/0. Alternatively, specific values can be configured usingonValue
andoffValue
. Integer and string types are not affected by these settings.
... so in your configuration, you can leave out integerValue
altogether.
from homebridge-mqttthing.
@mientki Did you solve the problem with state?
I can switch the light but it won't update the state if used with a wall switch.
My config:
`
"accessory": "mqtt-switch-tasmota",
"name": "NAME OF THIS ACCESSORY",
"url": "mqtt://ip",
"username": "",
"password": "",
"topics": {
"statusGet": "stat/sonoff_d_tuba/POWER",
"statusSet": "cmnd/sonoff_d_tuba/POWER",
"stateGet": "tele/sonoff_d_tuba/STATE"
},
"onValue": "ON",
"offValue": "OFF",
"activityTopic": "tele/sonoff_d_tuba/LWT",
"activityParameter": "Online",
"startCmd": "cmnd/sonoff_d_tuba/TelePeriod",
"startParameter": "60",
"manufacturer": "Itead",
"model": "Sonoff Basic",
"serialNumberMAC": "11:11:11:11:11:11",
"name": "test142"
`
What for are "startCmd": "cmnd/sonoff_d_tuba/TelePeriod", and "activityTopic": "tele/sonoff_d_tuba/LWT", ?
from homebridge-mqttthing.
try:
"statusSet": "cmnd/sonoff_d_tuba/power",
"power"small letters.
from homebridge-mqttthing.
@mientki Didn't help. Still not updating the state.
from homebridge-mqttthing.
It uses the addition of mqttting. It is much easier to configure. With a large number of accessors, the configuration file is more transparent. My configuration for the sample accessory is:
{
"accessory": "mqttthing",
"type": "lightbulb",
"name": "Salon lamp",
"url": "mqtt: //192.168.99.100",
"username": "",
"password": "",
"caption": "",
"topics": {
"getOn": "stat/salon_lampa/POWER",
"setOn": "cmnd/salon_lampa/power"
}
"onValue": "ON",
"offValue": "OFF"
}
from homebridge-mqttthing.
@mientki
So I also tried mqttthings plugin. Set it up and exactly the same problem. I can switch the light, but I can't get the state. The state is not updating.
Is there any possibility to make sure that the topic is correct? I'm running mosquitto MQTT server.
from homebridge-mqttthing.
I recommend issuing a wildcard MQTT subscription externally to see what messages are being sent and when if you haven’t already tried this. For example:
mosquitto_sub -v -t "#"
It’s also possible to enable logging of the messages received by mqttthing by adding "logMqtt": true
to your configuration.
from homebridge-mqttthing.
@mientki problem solved. Easy mistake. As I was using Sonoff dual, it had to be power1 and POWER1 (or power2 and POWER2).
The only problem now is if I restart the homebridge then the default is always light off. Even if it is actually on. Is there a possibility to fix this?
from homebridge-mqttthing.
The only problem now is if I restart the homebridge then the default is always light off. Even if it is actually on. Is there a possibility to fix this?
I noticed now that it is the same for me.
from homebridge-mqttthing.
Might not be possible to read older MQTT messages. If it is so, than it doesn't know the state and default is off until a new MQTT message comes...
But this is just a guess, maybe there is a fix
from homebridge-mqttthing.
Also, if a Sonoff is offline, then the status is not updated in the home app to not responding. Is there a fix for it?
from homebridge-mqttthing.
Hi, homebridge-mqtt-switch sees the status after a restart. Could this not be implemented into this plug-in?
from homebridge-mqttthing.
Just confirming the feature request here: you would like mqtt-thing to republish all MQTT topics at start-up with current values in Homekit?
from homebridge-mqttthing.
Hi, yes and to check the status of devices status continuously.
from homebridge-mqttthing.
Yes I believe we need the extra start cmnd,
"startCmd": "cmnd/lights/POWER1",
"startParameter": ""
startParameter
is really handy as it can be used in 2 ways, Empty: will return current switch state, or if value provided (ON or OFF) then it can be used to set a default value on start of homebridge.
from homebridge-mqttthing.
Closing as feature request is now in separate issue #31.
from homebridge-mqttthing.
Related Issues (20)
- After updating node.js to version 20.9, the plugin displays a message when running homebridge HOT 2
- value not changed in plugin
- understanding how to use Warmwhite and Coldwhite LED Strips HOT 1
- changeing type from Light bulp - RGBW to White Dimmable does not change set String
- shutter stop button
- Names in Homekit keep resetting with v1.1.46 HOT 20
- Options ignored
- Shelly Plus2PM in Cover/Roller-Mode HOT 1
- Device Re-Pairing After Update
- [Request] Posibility to invert window cover set position HOT 1
- Getting current state of window covers on Homebridge startup HOT 1
- delay between homebridge and homekit
- Consumption above 12000W is ignored
- unable to see logs
- unable to correctly configure thermostat HOT 1
- MQTT Error: AggregateError HOT 1
- Alternative accessory type for garage door HOT 4
- Multiple topics for single property HOT 1
- can’t get status light on or off at homekit HOT 2
- Doorbell accessory not chiming anymore on homepods HOT 1
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 homebridge-mqttthing.