Page 2 of 2

Re: MQTT integration

Posted: Saturday 20 February 2016 11:28
by pepijn
Did you know GPIO is supported native by Domoticz?

Re: MQTT integration

Posted: Saturday 20 February 2016 16:26
by Andrex
Yes, I see that but my relays are on a separate Pi.
By the way, is there a way to invert the state of the ON/OFF GPIO?
Because my relay board turns ON the relays when the GPIO is 0, so the Domoticz act contrariwise (the switches are all OFF but the relays are all ON).
Thanks!

Re: MQTT integration

Posted: Saturday 20 February 2016 23:09
by nayr
Domoticz supports a Master/Slave configuration so you can hook multiple Domo's together and have remote nodes.

and for inverting gpio, try: echo 1> /sys/class/gpio/gpioN/active_low

Re: MQTT integration

Posted: Sunday 21 February 2016 10:17
by Andrex
Thanks Nayr, the inversion of the GPIO works!!!

Re: MQTT integration

Posted: Wednesday 24 February 2016 20:03
by Derik
mmm

What can i do more with MQTT
I did make a MQTT broker with mysensors...
Only i do not understand what i can do with MQTT

What are the settings :
ScreenShot061.jpg
ScreenShot061.jpg (88.93 KiB) Viewed 3502 times
And what are the best/beautiful options that in can make, with this...

And it is always so simple ;) what can i do with MQTT and Node red??

Re: MQTT integration

Posted: Thursday 13 July 2017 12:32
by salvacalatayud
I'm new in all this domoticz things. What I want to know is how to translate the domoticz mqtt in order to manage a modbus plc. What I want is to integrate a plc into domoticz via node red.

Thanks

Re: MQTT integration

Posted: Monday 16 October 2017 10:35
by salopette
Hello, I have a question if someone can help me?
Please excuse me for my English, I use Google Translate.

How can I connect this sketch with domoticz and controll?

https://github.com/thexperiments/esp826 ... tt_gateway



Thank you!

Re: MQTT integration

Posted: Tuesday 17 October 2017 22:50
by salopette
Can someone tell me
How can I control this in Domoticz?

Default topic is /ZB40_GATEWAY. You can controll it via MQTT with the following topics.

Topic Payload (only one at a time)
/ZB40_GATEWAY/ALL/ up, down, stop
/ZB40_GATEWAY/1/ up, down, stop
/ZB40_GATEWAY/2/ up, down, stop
/ZB40_GATEWAY/3/ up, down, stop

Re: MQTT integration

Posted: Tuesday 17 October 2017 23:02
by SweetPants
salopette wrote: Tuesday 17 October 2017 22:50 Can someone tell me
How can I control this in Domoticz?

Default topic is /ZB40_GATEWAY. You can controll it via MQTT with the following topics.

Topic Payload (only one at a time)
/ZB40_GATEWAY/ALL/ up, down, stop
/ZB40_GATEWAY/1/ up, down, stop
/ZB40_GATEWAY/2/ up, down, stop
/ZB40_GATEWAY/3/ up, down, stop
If you have a (mosquitto) MQTT broker installed and working, you can create dummy switches and send commands using mosquitto_pub

Re: MQTT integration

Posted: Wednesday 18 October 2017 7:29
by salopette
Yes I have Mqtt Brocker installed on Raspberry.
and I control my Sonoff relay with it.
Have also created virtual switches, but I do not understand where and how I must insert the lines with Domoticz.
/ZB40_GATEWAY/ALL/ up, down, stop

Image

Could someone describe it to me exactly?

Thank you

Re: MQTT integration

Posted: Wednesday 18 October 2017 18:36
by SweetPants
Domoticz has two topics domoticz/in and domoticz/out. Please take a look at https://www.domoticz.com/wiki/MQTT for different JSON formats to send/receive

Re: MQTT integration

Posted: Friday 20 October 2017 11:51
by salopette
Hello, I have looked here https://www.domoticz.com/wiki/MQTT, but I do not understand how I have to adjust in the sketch?

I now create a Virtuall switch, when I enter the command via browser, I see everything.
But how do I go on?
my MQTT is on 192.168.178.37/ port 1883

http://192.168.178.37:8080/json.htm?typ ... es&rid=266

Code: Select all

{
ActTime: 1508492733,
ServerTime: "2017-10-20 11:45:33",
Sunrise: "07:56",
Sunset: "18:14",
result: [
{
AddjMulti: 1,
AddjMulti2: 1,
AddjValue: 0,
AddjValue2: 0,
BatteryLevel: 255,
CustomImage: 0,
Data: "Open",
Description: "",
Favorite: 0,
HardwareID: 7,
HardwareName: "Virtual",
HardwareType: "Dummy (Does nothing, use for virtual switches only)",
HardwareTypeVal: 15,
HaveDimmer: true,
HaveGroupCmd: true,
HaveTimeout: false,
ID: "0001415A",
Image: "Light",
IsSubDevice: false,
LastUpdate: "2017-10-20 08:47:18",
Level: 0,
LevelInt: 0,
MaxDimLevel: 100,
Name: "/ZB40_GATEWAY/ALL/",
Notifications: "false",
PlanID: "0",
PlanIDs: [],
Protected: false,
ShowNotifications: true,
SignalLevel: "-",
Status: "Open",
StrParam1: "",
StrParam2: "",
SubType: "Switch",
SwitchType: "Venetian Blinds EU",
SwitchTypeVal: 15,
Timers: "false",
Type: "Light/Switch",
TypeImg: "blinds",
Unit: 1,
Used: 1,
UsedByCamera: false,
XOffset: "0",
YOffset: "0",
idx: "266"
}
],
status: "OK",
title: "Devices"
}

MQTT/JSON integration

Posted: Saturday 10 March 2018 14:30
by Wijnand
Hello guys,

I am playing with Domoticz now for a few days. My biggest problems with Domoticz and MQTT are the way they are using topics and JSON.

1. Domoticz impose the topics domoticz/in and domoticz/out. Why? It gives you not the freedom affined the MQTT standard. Keep the subscripe and publish topics open ( e.i ALF4all/domoticz and/or ALF4all/domoticz/${floorplan name}/${plan name} ), so you are not overwhelmed with messages if you are using a public MQTT-broker (like HiveMQ).

2. JSON is designed to keep messages readable. An object in Domoticz like "idx":1 (device index) is clear, objects as "nvalue" and "svalue" says nothing. Why not using objects as "temperature" and "humidity"? An object as "svalue":"20.5; 33.3; 2" for a Temp + Humidity type sensor is not readable at all. Better in JSON documents is to split up the data in seperate objects like: {"temperature":"20.5", "humidity":"33.3","humidity-status":"2"}.

Even better: {"temperature":"20.5", "humidity":"33.3","humidity-status":"dry"}.

Perhaps it would be nice if this way is also implemented (not diffecult I think) in Domoticz.

Regards...
Wijnand

b.t.w. As device hardware/firmware I use ESP8266 (thing) -> Arduino IDE -> ArduinoJson.h -> PubSubClient.h -> MQTT -> Domoticz.